Skip to content

Commit eb2df70

Browse files
committed
dropped result too
1 parent 2acef08 commit eb2df70

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def should_sample(
123123
# Explicit sampled value provided at start_span
124124
if attributes.get(SentrySpanAttribute.CUSTOM_SAMPLED) is not None:
125125
sample_rate = float(attributes[SentrySpanAttribute.CUSTOM_SAMPLED])
126-
return sampled_result(parent_span_context, attributes, sample_rate)
126+
if sample_rate > 0:
127+
return sampled_result(parent_span_context, attributes, sample_rate)
128+
else:
129+
return dropped_result(parent_span_context, attributes)
127130

128131
sample_rate = None
129132

0 commit comments

Comments
 (0)