-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support after-retry reporting to sentry-sidekiq (#1532)
* Improve test setup * Rename process_job to execute_worker * Add config.sidekiq.report_after_job_retries When set to true, `sentry-sidekiq` only reports exceptions when the job has been fully retried. * Update changelog
- Loading branch information
Showing
8 changed files
with
132 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Sentry | ||
class Configuration | ||
attr_reader :sidekiq | ||
|
||
add_post_initialization_callback do | ||
@sidekiq = Sentry::Sidekiq::Configuration.new | ||
end | ||
end | ||
|
||
module Sidekiq | ||
class Configuration | ||
# Set this option to true if you want Sentry to only capture the last job | ||
# retry if it fails. | ||
attr_accessor :report_after_job_retries | ||
|
||
def initialize | ||
@report_after_job_retries = false | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "spec_helper" | ||
|
||
RSpec.describe Sentry::Sidekiq::Configuration do | ||
it "adds #delayed_job option to Sentry::Configuration" do | ||
config = Sentry::Configuration.new | ||
|
||
expect(config.sidekiq).to be_a(described_class) | ||
end | ||
|
||
describe "#report_after_job_retries" do | ||
it "has correct default value" do | ||
expect(subject.report_after_job_retries).to eq(false) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters