# Elastic APM Agent on .net 6 supports multithreading scenarios?

**URL:** <https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [November 8, 2023, 2:34am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674 "2023-11-08T02:34:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcos\_Ivan\_Robles\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcos_ivan_robles_h/32/121557_2.png) [@Marcos\_Ivan\_Robles\_H](https://discuss.elastic.co/u/Marcos_Ivan_Robles_H)\
**Post date:** [November 8, 2023, 2:34am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674/1 "2023-11-08T02:34:52Z")

</div>

I wonder if Elastic APM Agent on .net 6 supports multi threading scenarios because I am implementing it manually, I mean, I am creating the transactions with the [Public API](https://www.elastic.co/guide/en/apm/agent/dotnet/current/public-api.html) in a background service application with .net 6 .

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [November 8, 2023, 7:30am UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674/2 "2023-11-08T07:30:25Z")

</div>

Hi @Marcos_Ivan_Robles_H,

Yes, that should work just fine using the manual API.

---

<div class="post-metadata">

**Author:** ![Marcos\_Ivan\_Robles\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcos_ivan_robles_h/32/121557_2.png) [@Marcos\_Ivan\_Robles\_H](https://discuss.elastic.co/u/Marcos_Ivan_Robles_H)\
**Post date:** [November 8, 2023, 3:26pm UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674/3 "2023-11-08T15:26:36Z")

</div>

Hi Steve, thanks for the answer.

Is there any Elastic documentation talking about multi threading scenarios and elastic amp agent with .net core?

I know maybe the errors that I am facing are specific to my use case when doing processes in parallel , but if there are some examples of elastic apm together with multi threading scenarios it would be great.

Thank you!

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [November 8, 2023, 3:56pm UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674/4 "2023-11-08T15:56:49Z")

</div>

My answer was geared toward using the APM agent from a `BackgroundService` in a worker service style app. I have no specific examples of that, but it should work.

What issues are you experiencing? Can you share any code?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 6, 2023, 3:57pm UTC](https://discuss.elastic.co/t/elastic-apm-agent-on-net-6-supports-multithreading-scenarios/346674/5 "2023-12-06T15:57:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
