Skip to content

Commit 8d3abc4

Browse files
committed
use correct trace state
1 parent 5b19c7d commit 8d3abc4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def dropped_result(span_context, attributes, sample_rate=None):
5151
# these will only be added the first time in a root span sampling decision
5252
trace_state = span_context.trace_state
5353

54-
if TRACESTATE_SAMPLED_KEY not in span_context.trace_state:
55-
trace_state = span_context.trace_state.add(TRACESTATE_SAMPLED_KEY, "false")
54+
if TRACESTATE_SAMPLED_KEY not in trace_state:
55+
trace_state = trace_state.add(TRACESTATE_SAMPLED_KEY, "false")
5656

5757
if sample_rate and TRACESTATE_SAMPLE_RATE_KEY not in trace_state:
5858
trace_state = trace_state.add(TRACESTATE_SAMPLE_RATE_KEY, str(sample_rate))
@@ -70,7 +70,7 @@ def sampled_result(span_context, attributes, sample_rate):
7070
trace_state = span_context.trace_state
7171

7272
if TRACESTATE_SAMPLED_KEY not in trace_state:
73-
trace_state = span_context.trace_state.add(TRACESTATE_SAMPLED_KEY, "true")
73+
trace_state = trace_state.add(TRACESTATE_SAMPLED_KEY, "true")
7474
if TRACESTATE_SAMPLE_RATE_KEY not in trace_state:
7575
trace_state = trace_state.add(TRACESTATE_SAMPLE_RATE_KEY, str(sample_rate))
7676

0 commit comments

Comments
 (0)