Skip to content

Commit 5b19c7d

Browse files
committed
just a mapping apparently
1 parent 3702a4a commit 5b19c7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ 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.keys():
54+
if TRACESTATE_SAMPLED_KEY not in span_context.trace_state:
5555
trace_state = span_context.trace_state.add(TRACESTATE_SAMPLED_KEY, "false")
5656

57-
if sample_rate and TRACESTATE_SAMPLE_RATE_KEY not in trace_state.keys():
57+
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))
5959

6060
return SamplingResult(
@@ -69,9 +69,9 @@ def sampled_result(span_context, attributes, sample_rate):
6969
# these will only be added the first time in a root span sampling decision
7070
trace_state = span_context.trace_state
7171

72-
if TRACESTATE_SAMPLED_KEY not in trace_state.keys():
72+
if TRACESTATE_SAMPLED_KEY not in trace_state:
7373
trace_state = span_context.trace_state.add(TRACESTATE_SAMPLED_KEY, "true")
74-
if TRACESTATE_SAMPLE_RATE_KEY not in trace_state.keys():
74+
if TRACESTATE_SAMPLE_RATE_KEY not in trace_state:
7575
trace_state = trace_state.add(TRACESTATE_SAMPLE_RATE_KEY, str(sample_rate))
7676

7777
return SamplingResult(

0 commit comments

Comments
 (0)