fix(core): Allow non-recording spans to carry explicit sampling decisions#21406
Draft
andreiborza wants to merge 8 commits into
Draft
fix(core): Allow non-recording spans to carry explicit sampling decisions#21406andreiborza wants to merge 8 commits into
andreiborza wants to merge 8 commits into
Conversation
…ions Non-recording spans can now carry a `sampled` flag and `parentSpanId` on their span context, so `spanToTraceHeader`/`spanToTraceparentHeader` and `spanToJSON` reflect the real decision. In Tracing without Performance mode, root non-recording spans keep the sampling decision deferred (no `sentry-trace` flag, no `sentry-sampled`/`sample_rate` in the DSC) instead of asserting a negative decision that would suppress downstream sampling. Spans created for an unsampled trace (or ignored spans) carry an explicit `sampled: false`.
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f27ea61. Configure here.
9a455d0 to
69d87c1
Compare
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.

Non-recording spans can now carry a
sampledflag andparentSpanIdon their span context, sospanToTraceHeader/spanToTraceparentHeaderandspanToJSONreflect the real decision.In Tracing without Performance mode, root non-recording spans keep the sampling decision deferred (no
sentry-traceflag, nosentry-sampled/sample_ratein the DSC) instead of asserting a negative decision that would suppress downstream sampling.Spans created for an unsampled trace (or ignored spans) carry an explicit
sampled: false.Placeholder/idle spans also inherit
traceId/parentSpanIdfrom the propagation context and capture their scopes.