# Dotnet APM context propgagation

**URL:** <https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [November 16, 2020, 9:53pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597 "2020-11-16T21:53:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![illegalnumbers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illegalnumbers/32/79113_2.png) [@illegalnumbers](https://discuss.elastic.co/u/illegalnumbers)\
**Post date:** [November 16, 2020, 9:53pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597/1 "2020-11-16T21:53:11Z")

</div>

Does something similar to [https://github.com/elastic/apm-agent-java/pull/396](https://github.com/elastic/apm-agent-java/pull/396) exist for the latest version of the Kibana APM agent? I'd like to forward a transaction if the headers for the trace are available.

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [November 16, 2020, 10:22pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597/2 "2020-11-16T22:22:33Z")

</div>

Hi @illegalnumbers,

Yes - [This](https://www.elastic.co/guide/en/apm/agent/dotnet/current/public-api.html#manually-propagating-distributed-tracing-context) part of the doc describes how this works in the .NET APM Agent.

---

<div class="post-metadata">

**Author:** ![illegalnumbers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illegalnumbers/32/79113_2.png) [@illegalnumbers](https://discuss.elastic.co/u/illegalnumbers)\
**Post date:** [November 16, 2020, 10:44pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597/3 "2020-11-16T22:44:06Z")

</div>

Am I to understand then that if a request, say from a DelegatingHandler, has the elastic-apm headers on it then `Agent.Tracer.CurrentSpan` will be populated automatically?

---

<div class="post-metadata">

**Author:** ![illegalnumbers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/illegalnumbers/32/79113_2.png) [@illegalnumbers](https://discuss.elastic.co/u/illegalnumbers)\
**Post date:** [November 16, 2020, 10:49pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597/4 "2020-11-16T22:49:17Z")

</div>

For context, I have a [ASP.NET](http://ASP.NET) Core application that is a microservice that ingests Azure Service bus messages. After ingesting it runs a variety of http calls to other microservices. I plugged in the quickstart stuff but none of those http calls are logged so my thought was that I should consume any transaction headers on any queries that I make to other services if they are present and manually use the public api for tracers to setup my transactions. Unless there is a better way to consume this?

---

<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 7, 2020, 6:49pm UTC](https://discuss.elastic.co/t/dotnet-apm-context-propgagation/255597/5 "2020-12-07T18:49:19Z")

</div>

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