Less Annoying Sidekiq Bugsnag Errors

Curated ago by @pelargir

Description

This middleware makes Bugsnag ignore network connection errors raised from Sidekiq jobs. Instead of reporting errors to Bugsnag every time the job retries, we only report these errors if/when the job finally dies. The goal is to eliminate extra noise caused by transient network errors.

1
2
3
Sidekiq.configure_server do |config|
  config.death_handlers << BugsnagSidekiqDeathHandler.handler
end

This configures Sidekiq with a death handler that reports exceptions to Bugsnag.