Distributed Tracing on .Net FullFramework

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 :slight_smile:

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 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

Steps to reproduce:
1.
2.
3.

Errors in browser console (if relevant):

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

Welcome on the forum @rajivharris :clap:

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 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.

1 Like

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

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