Skip to content

Commit

Permalink
Register SentryContextClientMiddleware on sidekiq workers (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromepl committed Apr 9, 2022
1 parent 039a4fc commit 72396ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sentry-sidekiq/lib/sentry-sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Railtie < ::Rails::Railtie
config.server_middleware do |chain|
chain.add Sentry::Sidekiq::SentryContextServerMiddleware
end
config.client_middleware do |chain|
chain.add Sentry::Sidekiq::SentryContextClientMiddleware
end
end

Sidekiq.configure_client do |config|
Expand Down
1 change: 1 addition & 0 deletions sentry-sidekiq/spec/sentry/sidekiq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
it "registers error handlers and middlewares" do
expect(Sidekiq.error_handlers).to include(described_class::ErrorHandler)
expect(Sidekiq.server_middleware.entries.first.klass).to eq(described_class::SentryContextServerMiddleware)
expect(Sidekiq.client_middleware.entries.first.klass).to eq(described_class::SentryContextClientMiddleware)
end

it "captues exception raised in the worker" do
Expand Down

0 comments on commit 72396ce

Please sign in to comment.