Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support W3C format for distributed trace context propagation #5925

Closed
SergeyKanzhelev opened this issue Jun 12, 2018 · 8 comments
Closed

Support W3C format for distributed trace context propagation #5925

SergeyKanzhelev opened this issue Jun 12, 2018 · 8 comments
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@SergeyKanzhelev
Copy link

Motivation

Support extraction and injection of distributed tracing context in a format of W3C headers.

Support for new headers in ASP.NET depend on support for tracestate collection in Activity class of DiagnosticsSource.

CC: @seth-capistron, @vancem, @jacpull, @lmolkova, @glennc, @davidfowl

@aspnet-hello aspnet-hello transferred this issue from aspnet/Hosting Dec 18, 2018
@aspnet-hello aspnet-hello added this to the 3.0.0 milestone Dec 18, 2018
@aspnet-hello aspnet-hello added area-hosting enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Dec 18, 2018
@muratg
Copy link
Contributor

muratg commented Jan 9, 2019

cc @shirhatti @davidfowl @Tratcher

@discostu105
Copy link

Please consider the case of "multiple" tracecontext users/providers in one process. This will be the use-case for the Dynatrace .NET Agent.

Challenge:

  • Currently, the Dynatrace .NET Agent would auto-instrument itself into various methods (asp.net core middleware for incoming HTTP, HttpClient for outgoing HTTP). At these places, it would
    • read HTTP headers (traceparent & tracestate), keep it's state, propagate that state in-process. If no traceparent was present, it would create it's own traceId.
    • For an outgoing HTTP call, the Agent would add HTTP headers (traceparent & tracestate) itself. It would take care of properly changing tracestate (keep other entries, satisfy the spec).
  • Now, if .NET Core / ASP.NET Core / DiagnosticSource would support TraceContext natively, a few things would change (IMHO, please correct if wrong):
    • DiagnosticSource would also read traceparent & tracestate. It would remember them (via DiagnosticSource Activity).
    • In case no traceparent was present, would it create it's own traceId?
    • In case of an outgoing HTTP call, DiagnosticSource would take care of placing traceparent and tracestate HTTP headers.

I see these problems:

  • traceId generation. Both DiagnosticSource and Dynatrace Agent would create one.
  • traceparent generation. Who will decide upon new SpanId, TraceOptions flags?
  • tracestate handling. For this case, I guess the Dynatrace Agent just needs to become aware of DiagnosticSource and re-use it's TraceState collection, rather than writing the whole tracestate HTTP header itself. That's doable.

Add OpenCensus, OpenTracing into the mix. Who controls id's and who ultimately writes HTTP headers?

@analogrelay
Copy link
Contributor

Epic #8924

@lmolkova
Copy link

Fixed with #8495, dotnet/corefx#35882, dotnet/corefx#33207

@analogrelay
Copy link
Contributor

@SergeyKanzhelev as far as you know, is there further work needed in ASP.NET Core here? (Catching up on stuff, sorry if this has been discussed before :))

(cc @glennc)

@SergeyKanzhelev
Copy link
Author

@anurse there are other issues for different aspects of distributed tracing. This issue is OK to close.

@analogrelay
Copy link
Contributor

Thanks @SergeyKanzhelev !

@mmayr-at
Copy link

Please consider the case of "multiple" tracecontext users/providers in one process. This will be the use-case for the Dynatrace .NET Agent.

Challenge:

  • Currently, the Dynatrace .NET Agent would auto-instrument itself into various methods (asp.net core middleware for incoming HTTP, HttpClient for outgoing HTTP). At these places, it would

    • read HTTP headers (traceparent & tracestate), keep it's state, propagate that state in-process. If no traceparent was present, it would create it's own traceId.
    • For an outgoing HTTP call, the Agent would add HTTP headers (traceparent & tracestate) itself. It would take care of properly changing tracestate (keep other entries, satisfy the spec).
  • Now, if .NET Core / ASP.NET Core / DiagnosticSource would support TraceContext natively, a few things would change (IMHO, please correct if wrong):

    • DiagnosticSource would also read traceparent & tracestate. It would remember them (via DiagnosticSource Activity).
    • In case no traceparent was present, would it create it's own traceId?
    • In case of an outgoing HTTP call, DiagnosticSource would take care of placing traceparent and tracestate HTTP headers.

I see these problems:

  • traceId generation. Both DiagnosticSource and Dynatrace Agent would create one.
  • traceparent generation. Who will decide upon new SpanId, TraceOptions flags?
  • tracestate handling. For this case, I guess the Dynatrace Agent just needs to become aware of DiagnosticSource and re-use it's TraceState collection, rather than writing the whole tracestate HTTP header itself. That's doable.

Add OpenCensus, OpenTracing into the mix. Who controls id's and who ultimately writes HTTP headers?

@davidfowl Here the issue with the question from @discostu105 I was mentioning today during our conversation in the NDC workshop.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

9 participants