# Distributed Tracing on .Net FullFramework

**URL:** <https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [April 18, 2020, 5:18pm UTC](https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663 "2020-04-18T17:18:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajivharris](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rajivharris](https://discuss.elastic.co/u/rajivharris)\
**Post date:** [April 18, 2020, 5:18pm UTC](https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663/1 "2020-04-18T17:18:19Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** : 7.6.2

**Elasticsearch version** : 7.6.2

**APM Server version** : 7.6.2

**APM Agent language and version** : Elastic.Apm.AspNetFullFramework.1.4.0

**Browser version** : Edge Chromium 81

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: download page

**Fresh install or upgraded from other version?** Fresh Install

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
No default option

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
Followed the steps mentioned in the APM documentation to setup distributed tracing for [ASP.NET](http://ASP.NET) Web Api 2 in .Net Full Framework. Each application trace is captured as a separate one. Expected root span to show child spans in transaction.

Not sure what I am missing.

Application Architecture:  
WebApplication1  
-\> WebApplication2  
-\> WebApplication31  
-\> WebApplication32

Code Repo Link: [https://github.com/rajivharris/ElasticAPMDistributedTracingFullFWK](https://github.com/rajivharris/ElasticAPMDistributedTracingFullFWK)

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

---

<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:** [April 20, 2020, 10:34am UTC](https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663/2 "2020-04-20T10:34:52Z")

</div>

Welcome on the forum @rajivharris 👏

Well, it seems you run into a bug. The issue was that an old version of `System.Diagnostics.DiagnosticSource` was loaded and because of that the agent was not able to capture the outgoing HTTP calls - therefore it did not connect the different web apps into the same trace. We change a couple of things on this recently which'll be released with the next release. I'll see if that'd prevent something like this later.

Nevertheless by setting some redirects you can make this work. I [opened a PR](https://github.com/rajivharris/ElasticAPMDistributedTracingFullFWK/pull/1) against your sample that shows how to make it work. I know this is not that nice, again, hopefully we can get rid of the need for the redirect in the next release.

Also, one nit to what you say:

> Each application trace is captured as a separate one. Expected root span to show child spans in transaction.

I'm not sure there is a misunderstanding here, but just to make sure we are on the same page: what'll happen here is that you'll still have 4 transactions (for the 4 web apps) - in `WebApplication1` and `WebApplication2` the transaction will have a child span which is the outgoing HTTP request and all 4 transactions will form together a trace. So the way these apps are connected is that they are part of the same trace. More on this [here](https://www.elastic.co/guide/en/apm/get-started/current/distributed-tracing.html).

---

<div class="post-metadata">

**Author:** ![rajivharris](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rajivharris](https://discuss.elastic.co/u/rajivharris)\
**Post date:** [April 20, 2020, 1:30pm UTC](https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663/3 "2020-04-20T13:30:57Z")

</div>

Thanks Greg!  
After proper binding redirection of diagnostics dll, I can see all child spans captured properly as part of root span.

---

<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:** [May 11, 2020, 9:31am UTC](https://discuss.elastic.co/t/distributed-tracing-on-net-fullframework/228663/4 "2020-05-11T09:31:08Z")

</div>

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