sentry-ruby icon indicating copy to clipboard operation
sentry-ruby copied to clipboard

The number of attempts before notifications will be sent.

Open manme opened this issue 3 years ago • 8 comments

Describe the idea

I would like to have the option: attempt_threshold - the number of attempts before notifications will be sent. The option: report_after_job_retries - is a boolean and does not allow to send a notifications after N retry.

Why do you think it's beneficial to most of the users

The user will receive a notification after the third retry because it could be solved automatically (external service was not available or similar), no more spam notifications.

Possible implementation

Similar to https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/plugins/sidekiq.rb#L43

manme avatar Nov 30 '21 11:11 manme

https://github.com/getsentry/sentry-ruby/issues/1570 looks pretty similar to what you propose here but with more detail. Would you say it matches your expectation?

st0012 avatar Dec 05 '21 17:12 st0012

Thanks for your response. As I understand, #1570 does not solve my problem: I want to get a notification in Sentry from a job that has failed N times (not on a first attempt) where N < sidekiq retry. For example, I get a notification after the third attempt, and the job will stay in Retries (with a default retry value of 25). Then as a developer, I have time to fix the bug and won't receive notification from jobs that failed because of network problems as it's not a bug, just a temporary issue.

manme avatar Dec 05 '21 21:12 manme

@manme I see. What'll happen after the first report then? In your example, the SDK should send the event after the 4th retry failed, right?. After that, should it send events for the 5th, 6th...etc. failures?

st0012 avatar Dec 19 '21 19:12 st0012

I agree with the initial author, this would be very useful, especially for jobs depending on an external service and/or unreliable network, where it is not a problem if the job is retried for a few times.

I would expect all failures after the threshold to be sent to Sentry.

renchap avatar Dec 19 '21 20:12 renchap

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jan 28 '22 15:01 github-actions[bot]

:+1: I was just looking for this exact feature as well with the same use case.

We integrate with a third party and a small percentage of requests fail and then succeed on the second retry due to things outside our control. I'd ideally like to be able to set a threshold on the job level, so that each job could be configured separately.

Sam-Killgallon avatar Feb 09 '22 15:02 Sam-Killgallon

yes! I was about to submit a request for the exact same feature. I want the first one or two or N retries to NOT send anything to sentry, because that means that the error is a network error and is recovered quickly. I want all of the rest of the errors sent.

benhutton avatar Feb 17 '22 21:02 benhutton