Search code examples
ruby-on-railssidekiqrollbar

Does Sidekiq report errors to Rollbar automatically?


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.


Solution

  • 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