WIP: System.Diagnostic wrappers - #3238
Closed
jamescrosswell wants to merge 12 commits into
Closed
Conversation
jamescrosswell
commented
Mar 28, 2024
Collaborator
Author
|
Unfortunately in some of our code the details of our internal tracing bleed out via a public interface in the sentry-dotnet/src/Sentry/SentryMessageHandler.cs Lines 59 to 75 in 0ee3904 Both the To avoid a breaking change then, it might be necessary to create copies of these classes that use the new |
…otnet into diagnosticsource-otel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another experiment related to #3159
The plan here is to leverage
System.Diagnostics.DiagnosticSourceunder the hood for tracing (this is the technology underpinning OTel in .NET). This has been part of .NET since version 5.0.0 so we'll enable it by default for users targeting net5.0 and later.For users targeting .NET Framework or .NET Core 3.1 and earlier this will be opt in via the
Sentry.DiagnosticSourcepackage.TODO
SentryHttpMessageHandlerandSentryGraphQLHttpMessageHandlercreate spans and propagates contextHttpContextExtensionscreates spans and propagates contextSentryTracingMiddlewarecreates spans and propagates contextSentryFunctionsWorkerMiddlewarecreates spans and propagates contextSentrySqlListenerandEFDiagnosticSourceHelpercreate spansSentryQueryPerformanceListenercreates spansSentryPropagator. That extendsOpenTelemetry.Context.Propagation.BaggagePropagatorso we'll need to extract the relevant bits to some helper class that is used by both BaggagePropagator andActivitySpanProcessor. Need to work out when/why this gets leveraged in the OpenTelemetry code so that we can mimic this as well.OpenTelemetryTransactionProcessor? Possibly rename this toActivityTransactionProcessorand move it toSentry.DiagnosticSource...Hub.GetSpan(), such asHub.GetTraceHeaderandHub.GetBaggage... how will these work with Activity.Current? How will propagation etc. work?Out of scope
Sentry.OpenTelemetryuses OpenTelemetry instrumentation (not the new tracing interfaces).The following integrations are also out of scope as they don't include any tracing functionality: