diff --git a/sentry_sdk/integrations/opentelemetry/sampler.py b/sentry_sdk/integrations/opentelemetry/sampler.py index 8f8d9f5362..88b2719434 100644 --- a/sentry_sdk/integrations/opentelemetry/sampler.py +++ b/sentry_sdk/integrations/opentelemetry/sampler.py @@ -191,6 +191,7 @@ def should_sample( parent_sampled = get_parent_sampled(parent_span_context, trace_id) parent_sample_rate = get_parent_sample_rate(parent_span_context, trace_id) parent_sample_rand = get_parent_sample_rand(parent_span_context, trace_id) + if parent_sample_rand is not None: sample_rand = parent_sample_rand else: