Sha256: c71a9750a52f81c3e513284e37d94e1f7c08897c79ef0bed227877614ce7beb4
Contents?: true
Size: 962 Bytes
Versions: 25
Compression:
Stored size: 962 Bytes
Contents
require 'honeybadger/plugin' require 'honeybadger' module Honeybadger module Plugins module Sidekiq class Middleware def call(worker, msg, queue) Honeybadger.context.clear! Honeybadger::Trace.instrument("#{msg['class']}#perform", { :source => 'sidekiq', :jid => msg['jid'], :class => msg['class'] }) do yield end end end Plugin.register do requirement { defined?(::Sidekiq) } execution do ::Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add Middleware end end if defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3' ::Sidekiq.configure_server do |config| config.error_handlers << Proc.new {|ex,context| Honeybadger.notify_or_ignore(ex, parameters: context) } end end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems