Skip to content
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

add report_after_job_retries support for ActiveJob #2500

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

modosc
Copy link
Contributor

@modosc modosc commented Dec 18, 2024

Description

this pr adds report_after_job_retries support to ActiveJob (configured via config.rails.active_job_report_after_job_retries).

the easiest way to do this would have been to use retry_on in the base ActiveJob class (similar to here) but that's difficult to do properly which is (i think) why the current ActiveJob integration doesn't do it.

instead we can take advantage of the retry_stopped.active_job notification that's published when a job runs out of retries. this makes our setup a single call to ActiveSupport::Notifications.subscribe.

fixes #2499

@modosc modosc force-pushed the active-job-report_after_job_retries branch from 5ecd340 to 2be327a Compare December 18, 2024 16:31
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 92.48%. Comparing base (d21c500) to head (923d2d3).

Files with missing lines Patch % Lines
sentry-rails/lib/sentry/rails/active_job.rb 33.33% 10 Missing ⚠️
sentry-rails/lib/sentry/rails/railtie.rb 33.33% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (d21c500) and HEAD (923d2d3). Click for more details.

HEAD has 183 uploads less than BASE
Flag BASE (d21c500) HEAD (923d2d3)
257 74
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2500      +/-   ##
==========================================
- Coverage   98.19%   92.48%   -5.72%     
==========================================
  Files         128      122       -6     
  Lines        4833     4713     -120     
==========================================
- Hits         4746     4359     -387     
- Misses         87      354     +267     
Components Coverage Δ
sentry-ruby 98.57% <ø> (ø)
sentry-rails 45.93% <40.00%> (-51.14%) ⬇️
sentry-sidekiq 97.42% <ø> (ø)
sentry-resque 92.85% <ø> (ø)
sentry-delayed_job 95.65% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (ø)
Files with missing lines Coverage Δ
sentry-rails/lib/sentry/rails/configuration.rb 88.37% <100.00%> (-11.63%) ⬇️
sentry-rails/lib/sentry/rails/railtie.rb 25.30% <33.33%> (-73.45%) ⬇️
sentry-rails/lib/sentry/rails/active_job.rb 37.50% <33.33%> (-62.50%) ⬇️

... and 20 files with indirect coverage changes

@modosc modosc force-pushed the active-job-report_after_job_retries branch from 79897d2 to 0ce620d Compare December 18, 2024 16:39
@modosc modosc changed the title add report_after_job_retries support for activejob add report_after_job_retries support for ActiveJob Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement report_after_job_retries in ActiveJob adapter
2 participants