Repository navigation
chore: Inline span-streaming branch of tracing shims in replays - #124720
Merged
alexander-alderman-webb merged 3 commits intoOct 12, 2026
Merged
Conversation
alexander-alderman-webb
force-pushed
the
webb/replays/remove-tracing-shim
branch
from
September 22, 2026 11:28
e78e9bd to
f90af46
Compare
alexander-alderman-webb
marked this pull request as ready for review
September 22, 2026 11:28
cleptric
reviewed
Oct 1, 2026
Comment on lines
+163
to
+186
| traces.new_trace() | ||
| span = None | ||
| if self.sample_rate_get: | ||
| active_propagation_context = ( | ||
| sentry_sdk.get_current_scope().get_active_propagation_context() | ||
| ) | ||
| prev_sampling_context = active_propagation_context.custom_sampling_context | ||
| Scope.set_custom_sampling_context({"sample_rate": self.sample_rate_get}) | ||
| try: | ||
| span = traces.start_span( | ||
| name="replays.endpoints.project_replay_summary.get", | ||
| attributes={"sentry.op": "replays.endpoints.project_replay_summary.get"}, | ||
| parent_span=None, | ||
| ) | ||
| finally: | ||
| active_propagation_context.custom_sampling_context = prev_sampling_context | ||
| if span is None: | ||
| span = traces.start_span( | ||
| name="replays.endpoints.project_replay_summary.get", | ||
| attributes={"sentry.op": "replays.endpoints.project_replay_summary.get"}, | ||
| parent_span=None, | ||
| ) | ||
|
|
||
| with span: |
Member
There was a problem hiding this comment.
Might be worth to keep some wrapper for this. Also present in other PRs, but this one is a lot of boilerplate.
alexander-alderman-webb
force-pushed
the
webb/replays/remove-tracing-shim
branch
from
October 12, 2026 07:26
87ceb07 to
5023f3e
Compare
pabloDeputter
approved these changes
Oct 12, 2026
3 tasks done
This branch was successfully deployed
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.
Inline the branches of
utils.tracing.start_span(),utils.tracing.trace(),utils.tracing.set_span_tag()andutils.tracing.set_span_data()that run when the streaming trace lifecycle is enabled.Since edfb641 the streaming trace lifecycle is always enabled.
Add
repr()around the second argument toStreamedSpan.set_attribute()when mypy complains. Callingrepr()is the existing runtime fallback in the SDK.Set attributes in the
attributesparameter totraces.start_span()instead of callingStreamedSpan.set_attribute()where reasonable.