0

Is there a way to integrate Bugsnag to rescue all exceptions for Sidekiq and send notifications? I can't find it in the docs.

def call(_worker, _msg, _queue)
Bugsnag.before_notify_callbacks << lambda do |notif|
  notif.add_tab(
    :gem_version,
    metascrape: Metascrape::VERSION
  )
end
yield

rescue ActiveRecord::RecordNotFound => e Bugsnag.notify e ensure Bugsnag.before_notify_callbacks.clear end end

Natus Drew
  • 1,876
  • 1
  • 21
  • 23

1 Answers1

1

Why do you think you need to do anything? The docs indicate it should just work.

Bugsnag ruby works out of the box with Rails, Sidekiq, Resque, DelayedJob (3+), Mailman, Rake and Rack. It should be easy to add support for other frameworks, either by sending a pull request here or adding a hook to those projects.

https://bugsnag.com/docs/notifiers/ruby

Mike Perham
  • 21,300
  • 6
  • 59
  • 61