Skip to content

Commit

Permalink
In case the sentry-trace says we defer the sampling descission, overr…
Browse files Browse the repository at this point in the history
…ide the sampled field in trace_state
  • Loading branch information
antonpirker committed Feb 28, 2025
1 parent 0064118 commit 0f56682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/opentelemetry/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _incoming_otel_span_context(self):
# for twp to work, we also need to consider deferred sampling when the sampling
# flag is not present, so the above TraceFlags are not sufficient
if self._propagation_context.parent_sampled is None:
trace_state = trace_state.add(TRACESTATE_SAMPLED_KEY, "deferred")
trace_state = trace_state.update(TRACESTATE_SAMPLED_KEY, "deferred")

span_context = SpanContext(
trace_id=int(self._propagation_context.trace_id, 16),
Expand Down

0 comments on commit 0f56682

Please sign in to comment.