We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a8b35d commit ccec6caCopy full SHA for ccec6ca
sentry_sdk/client.py
@@ -196,7 +196,7 @@ def _should_capture(
196
197
if (
198
self.options["sample_rate"] < 1.0
199
- and random.random() >= self.options["sample_rate"]
+ and random.random() <= self.options["sample_rate"]
200
):
201
return False
202
sentry_sdk/hub.py
@@ -436,7 +436,7 @@ def finish_trace(self, span):
436
if span.sampled is None:
437
# span.sampled = True -> Span forcibly sampled
438
sample_rate = self.client.options["traces_sample_rate"]
439
- if sample_rate < 1.0 and random.random() >= sample_rate:
+ if sample_rate < 1.0 and random.random() <= sample_rate:
440
return None
441
442
return self.capture_event(
0 commit comments