Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sentry_sdk/profiler/continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ def determine_profile_session_sampling_decision(sample_rate):
if not sample_rate:
return False

return random.random() < float(sample_rate)
sample_rate_f = float(sample_rate)
if sample_rate_f <= 0.0:
return False
if sample_rate_f >= 1.0:
return True

return random.random() < sample_rate_f


class ContinuousProfile:
Expand Down