Does Sidekiq report errors to Rollbar automatically?
Asked Answered
E

2

6

I see Mike recommends using an error service to report errors that happen during sidekiq jobs over here: https://www.mikeperham.com/2013/08/25/please-use-an-error-service

There's also this gem, which looks like it adds a middleware to do exactly that: https://github.com/allenwei/sidekiq-rollbar

But there's an issue reported for that gem which indicates that Sidekiq already does this.

Does anyone know what the answer is? Will Sidekiq report errors that happen during jobs via Rollbar automatically, if Rollbar is configured to handle exceptions in a Rails project? Or do I have to write something, or use the gem to do that?

I know Rollbar can use Sidekiq to provide a queue - that just confuses the issue when I try to google for answers.

Eke answered 26/4, 2016 at 23:42 Comment(0)
S
5

Yes, the rollbar gem will add a global exception handler if it detects Sidekiq: https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/plugins/sidekiq.rb#L14

Seat answered 27/4, 2016 at 4:0 Comment(0)
S
0

I haven't used Rollbar personally, but since Sidekiq runs within the context of your Rails environment, you should receive errors from your Sidekiq workers. You should also receive errors from any rake tasks or the Rails console in production. I have used Airbrake and AppSignal with Sidekiq and both report errors from Sidekiq.

Scrofula answered 27/4, 2016 at 0:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.