Skip to content

Commit b47bc70

Browse files
committed
note
1 parent c017b01 commit b47bc70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def should_sample(
120120
if not has_tracing_enabled(client.options):
121121
return dropped_result(parent_span_context, attributes)
122122

123-
has_parent = parent_span_context.is_valid
124-
is_root_span = not has_parent or parent_span_context.is_remote
123+
# parent_span_context.is_valid means this span has a parent, remote or local
124+
is_root_span = not parent_span_context.is_valid or parent_span_context.is_remote
125125

126126
# Explicit sampled value provided at start_span
127127
if attributes.get(SentrySpanAttribute.CUSTOM_SAMPLED) is not None:

0 commit comments

Comments
 (0)