-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Support after-retry reporting to sentry-sidekiq #1532
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1532 +/- ##
==========================================
+ Coverage 98.21% 98.73% +0.52%
==========================================
Files 218 125 -93
Lines 10624 6879 -3745
==========================================
- Hits 10434 6792 -3642
+ Misses 190 87 -103
Continue to review full report at Codecov.
|
When set to true, `sentry-sidekiq` only reports exceptions when the job has been fully retried.
@@ -11,6 +11,15 @@ def call(ex, context) | |||
scope = Sentry.get_current_scope | |||
scope.set_transaction_name(context_filter.transaction_name) unless scope.transaction_name | |||
|
|||
retry_option = context.dig(:job, "retry") | |||
|
|||
if Sentry.configuration.sidekiq.report_after_job_retries && retry_option.is_a?(Integer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@st0012 it looks like retry_option
is a boolean here; when would it be an integer?
Never mind, I realized the job itself has to be configured with sidekiq_options retry: SOME_INTEGER
for this feature to work.
This PR adds a new
config.sidekiq.report_after_job_retries
option (default:false
).When activated,
sentry-sidekiq
will wait for a job's retries to be exhausted before reporting the exception. Worker without theretry
option will not be affected.Closes #781