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
feat: Tracing without Performance #1516
Merged
Merged
Conversation
This file contains 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
cleptric
force-pushed
the
tracing-without-performance-hub-based
branch
8 times, most recently
from
April 24, 2023 13:27
3ed04a4
to
2ff8748
Compare
cleptric
changed the title
feat: Tracing without perf experiments
feat: Tracing without Performance
May 8, 2023
cleptric
force-pushed
the
tracing-without-performance-hub-based
branch
from
May 8, 2023 00:19
2ff8748
to
7943096
Compare
cleptric
force-pushed
the
tracing-without-performance-hub-based
branch
2 times, most recently
from
May 16, 2023 15:21
af0d12c
to
2dddafb
Compare
stayallive
approved these changes
Jun 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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
PropagationContext
is 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\continueTrace
A 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
TransactionContext
if tracing is enabled, based on the values of a passed insentry-trace
andbaggage
header.While this is not a great API, we have to maintain BC and are willing to live with this for now.
Sentry\traceparent
A 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\baggage
A 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
trace
context 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
/store
endpoint if tracing is disabled, we can only attach the DSC to check-in events in this case.DynamicSamplingContext::fromOptions
To 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