question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

APM does not seem to use Asp.Net 3.0+ Tracing Context (W3C Trace Context/Activity)?

See original GitHub issue

In Asp.Net Core 3.0, they adopted the W3C Trace Context standard

https://devblogs.microsoft.com/aspnet/improvements-in-net-core-3-0-for-troubleshooting-and-monitoring-distributed-apps/

The AspNetCore APM agent does not seem to be using the same tracing context as the framework, which I believe is Activity.Current.

The trace.id logged to ES is not the same TraceId that the framework uses (and logs in a scope).

This means we cannot view logs (in Kibana) of a trace you are viewing in Kibana APM app.

I’m not sure if something is not set up correctly, or the APM agent is not using the same tracing context as the framework.

😿

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gregkalaposcommented, Apr 7, 2020

We had some progress on this and I feel everything which is possible is already covered.

  • W3C TraceContext support is already released - this means the Elastic agent uses the header format with the same header name as defined in the standard - this is already out
  • #800 Makes sure that the trace id of Activity is the same as the trace id of the transactions/spans captured by the Elastic agent - this will be released with the next release.

So Activity.Current.TraceId will be the same as the trace id in elastic and you’ll be able to find traces based on Activity.Current.TraceId within Elastic.

One thing to keep in mind here is that Activity itself is still something that is not mapped to any concept within Elastic - so we keep the trace id across Activity and Elastic APM in-sync, but Activity.Id is still the id of the activity and that is still independent from a transaction or a span within elastic. https://github.com/elastic/apm-agent-dotnet/issues/303 is an issue about maybe mapping Activity to something within Elastic, but that’s undecided at this point.

Other note I’d like to add here is that Activity still supports hierarchical ids - in case hierarchical ids are used there is no trace id, and we can’t do much about that. So we only keep TraceId in-sync with Activity if ActivityIdFormat.W3C is the idFormat (that is basically the one that implements TraceContext, the hierarchical id format predates TraceContext).

Closing now, hope this is already some meaningful step.

0reactions
gregkalaposcommented, Apr 18, 2020

Hi @viktor-nikolaev,

we try to avoid publicly announcing release dates upfront and to be honest I don’t really know about a specific date at this point. Only thing I can say is that for the next 1-2 weeks no release is planned (there are some things in-progress right now), but it’s not like you’ll need to wait multiple months for the next release either - so something in between.

You can watch the repo for new releases - that way you’ll know it immediately.

Sorry that I can’t be more specific, but we believe this is still better than communicating a specific date and creating stress internally and ship something that’s not ready or fail to deliver.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improvements in .NET Core 3.0 for troubleshooting and ...
Distributed Tracing and Logging · Demo set up · Correlated logs · Initiate distributed trace in .NET Core 3.0 app · W3C Trace...
Read more >
Trace Context
This specification defines standard HTTP headers and a value format to propagate context information that enables distributed tracing scenarios.
Read more >
Distributed tracing and telemetry correlation in Azure ...
This article provides information about distributed tracing and telemetry correlation.
Read more >
c# - How can I access W3C TraceContext Headers in a .net ...
Activity Id in .net 5 has already been configured as the w3c standard. It means that all Actions will be identifiable by a...
Read more >
[c#] Using W3C Trace Context standard in distributed tracing
In my last article, I wrote about the W3C trace context standard and what kind of ... NET Core versions, the context was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found