{{ message }}
ref: Use old sampling context format in span streaming - #6848
Merged
Conversation
sentrivana
marked this pull request as ready for review
July 20, 2026 13:20
alexander-alderman-webb
approved these changes
Jul 20, 2026
Contributor
This was referenced Jul 22, 2026
mgaligniana
pushed a commit
to mgaligniana/sentry-python
that referenced
this pull request
Aug 9, 2026
### Description Reverting `sampling_context` to look like it used to in transaction-based tracing. Caveat: There's a bunch of keys that are not populated in span streaming, mostly because they're not known at span start (`span_id`, `sampled`, etc.). I've kept them in as `None` as that's how the legacy path did it, too (rather than omitting them). Note: When bumping the sdk version in sentry and seer to a version that has this change, the sampling_context code needs to change there, too. #### Issues resolves getsentry#6846 #### Reminders - Please add tests to validate your changes, and lint your code using `uv run ruff`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
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.

Description
Reverting
sampling_contextto look like it used to in transaction-based tracing.Caveat: There's a bunch of keys that are not populated in span streaming, mostly because they're not known at span start (
span_id,sampled, etc.). I've kept them in asNoneas that's how the legacy path did it, too (rather than omitting them).Note: When bumping the sdk version in sentry and seer to a version that has this change, the sampling_context code needs to change there, too.
Issues
resolves #6846
Reminders
uv run ruff.feat:,fix:,ref:,meta:)