-
-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron CheckIn events are affected by sample_rate
#2202
Comments
@flood4life oops you're right, ty for reporting this! I did miss this case because I don't test with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
We are trialling the Cron Monitoring beta (which looks like a very promising product!), and have noticed a strangely erratic nature of our cron check ins: Sentry often reported them as timed out or missing when according to our data the scheduled workers ran on time and in reasonable time.
We also have set the
sample_rate
config option to0.25
to report fewer exceptions to Sentry.I followed the source code for capturing the CheckIn events and discovered that they are affected by the
sample_rate
parameter: https://github.com/getsentry/sentry-ruby/blob/master/sentry-ruby/lib/sentry/client.rb#L51-L54It appears that
TransactionEvent
is the only type ofEvent
that is not affected bysample_rate
, and is using its own dedicated config for sampling. I feel like the simplest solution here could be extending this check to ignoreCheckInEvent
s as well. However,sample_rate
affecting events other than errors was a bit surprising for us as well, so perhaps the docs could be improved to reflect this gotcha?If you agree with my proposed solution, I'm happy to take a stab at submitting a patch.
As a workaround for now, we have removed the
sample_rate
config option and instead applied the same logic inbefore_send
, but only for Exception events.Reproduction Steps
Configure
sample_rate
to be below 1, instrument a worker with cron monitoring, and perform it a bunch of timesExpected Behavior
All CheckIn events reach Sentry
Actual Behavior
CheckIn events are sampled
Ruby Version
3.2.2
SDK Version
5.15.1
Integration and Its Version
No response
Sentry Config
The text was updated successfully, but these errors were encountered: