Skip to content

Commit 1b8521b

Browse files
committed
simplify
1 parent 69dfe92 commit 1b8521b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,8 @@ def should_sample(
141141
# Check if there is a traces_sampler
142142
# Traces_sampler is responsible to check parent sampled to have full transactions.
143143
has_traces_sampler = callable(client.options.get("traces_sampler"))
144-
custom_parent_sampled = attributes.get(
145-
SentrySpanAttribute.CUSTOM_PARENT_SAMPLED
146-
)
147-
if custom_parent_sampled is not None:
148-
parent_sampled = custom_parent_sampled
149-
else:
144+
parent_sampled = attributes.get(SentrySpanAttribute.CUSTOM_PARENT_SAMPLED)
145+
if parent_sampled is None:
150146
parent_sampled = get_parent_sampled(parent_span_context, trace_id)
151147

152148
if is_root_span and has_traces_sampler:

0 commit comments

Comments
 (0)