-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Libraries like HttpClient use legacy activity creation, requiring hacks in OpenTelemetry SDK #63868
Comments
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti, @safern Issue DetailsProblem DescriptionDistributed tracing can be supported by .NET applications by instrumenting them using
The latter API were introduced recently and reflects OpenTelemetry specifications for tracing. By contrast the former is the legacy .NET-specific API were used to implement instrumentation for distributed tracing initially. Currently, Additional Information
|
We have tried adding Allowing more functionality that is only available to
My understanding is that instrumentations like OpenTelemetry and AppInsights would still rely on cc: @dotnet/ncl as areas overlap here |
Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity Issue DetailsProblem DescriptionDistributed tracing can be supported by .NET applications by instrumenting them using
The latter API were introduced recently and reflects OpenTelemetry specifications for tracing. By contrast the former is the legacy .NET-specific API were used to implement instrumentation for distributed tracing initially. Currently, Additional Information
|
Follow up from the meeting:
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsProblem DescriptionDistributed tracing can be supported by .NET applications by instrumenting them using
The latter API were introduced recently and reflects OpenTelemetry specifications for tracing. By contrast the former is the legacy .NET-specific API were used to implement instrumentation for distributed tracing initially. Currently, Additional Information
|
There are a few steps here:
So with the current API shape,
Just by adding All of this context is available to a custom If the existing events are not sufficient, should we instead look at providing a callback that allows instrumentations to inject a custom handler? |
DiagnosticSource callbacks are still required for OpenTelemetry (and for other scenarios as well) Shifting from creating activity using legacy way (i.e new Activity("name")), to the ActivitySource way (i.e activitySource.startActivity(Kind.Client,..)) is the only ask. This would allow instrumentations in OpenTelemetry to avoid current hacks its doing to:
|
@denisivan0v I think we can close this now as it is addressed by @ManickaP PR? |
@denisivan0v can we close this issue? or are we waiting for something more? |
I'll close this since the PR is in. We can reopen and revisit if something turns out to be missing. |
Problem Description
Distributed tracing can be supported by .NET applications by instrumenting them using
System.Diagnostics.Activity
API. In addition, there are two APIs to be used to produce and consume events generated by instrumented application:System.Diagnostics.DiagnosticSource
/System.Diagnostics.DiagnosticListener
System.Diagnostics.ActivitySource
/System.Diagnostics.ActivityListener
The latter API were introduced recently and reflects OpenTelemetry specifications for tracing. By contrast the former is the legacy .NET-specific API were used to implement instrumentation for distributed tracing initially.
Currently,
HttpClient
still leveragesSystem.Diagnostics.DiagnosticSource
for distributed tracing instrumentation which requires OpenTelemetry SDK to use hacks and reflection. Going forward, this may also make it harder to stay up-to-date with progress done in OpenTelemetry specifications bringing even more complexity to OpenTelemetry SDK. For example, HTTP retries and redirects implementation require SpanLink objects (as per proposal here) that can only be supported bySystem.Diagnostics.ActivitySource
.Additional Information
The text was updated successfully, but these errors were encountered: