Merged
Conversation
3ed04a4 to
2ff8748
Compare
2ff8748 to
7943096
Compare
af0d12c to
2dddafb
Compare
stayallive
approved these changes
Jun 12, 2023
Collaborator
stayallive
left a comment
There was a problem hiding this comment.
I have a hard time finding any wrong coce-wise. Looks good!
Just a single TODO we (might) need to address but otherwise good to go!
Merged
3 tasks
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.
TL;DR
These changes will kick off a movement where the performance feature is no longer required to implement distributed tracing.
At its core is a new
PropagationContext, an object holding all required properties to implement distributed tracing in Sentry: a trace ID, span ID, parent span ID, and a Dynamic Sampling Context.The
PropagationContextis attached to each scope and is used as a fallback if tracing is not enabled (Options::isTracingEnabled()isfalse).New API
Naming is not final!
Sentry\continueTraceA new top-level function to continue a trace. This function is context-aware, as in it will either mutate the PropagationContext on the scope or return a populated
TransactionContextif tracing is enabled, based on the values of a passed insentry-traceandbaggageheader.While this is not a great API, we have to maintain BC and are willing to live with this for now.
Sentry\traceparentA new top-level function to receive the trace context to be used as an HTML meta tag for SSR applications or as a header value to be attached to outgoing HTTP requests. This function is context-aware, as in it will either return the trace context of the current span if tracing is enabled or fall back to this value from the PropagationContext stored on the scope.
Sentry\baggageA new top-level function to receive the Dynamic Sampling Context to be used as an HTML meta tag for SSR applications or as a header value to be attached to outgoing HTTP requests. This function is context-aware, as in it will either return the Dynamic Sampling Context of the current transaction if tracing is enabled or fall back to this value from the PropagationContext stored on the scope.
Each event always contains a trace context
If tracing is disabled, we will now use the PropagationContext as a fallback to attach a
tracecontext to each event, in the case of this SDK, to all error, transaction, and check-in events.Each event always contains a Dynamic Sampling Context (trace) envelope header item
As this SDK still uses the
/storeendpoint if tracing is disabled, we can only attach the DSC to check-in events in this case.DynamicSamplingContext::fromOptionsTo propagate a Dynamic Sampling Context in case tracing is disabled, a new method was added that constructs the Dynamic Sampling Context from the current options of the client.
Part of #1525