lib/honeybadger/plugins/sidekiq.rb in honeybadger-2.1.6.beta.1 vs lib/honeybadger/plugins/sidekiq.rb in honeybadger-2.2.0.beta.1

- old
+ new

@@ -5,11 +5,12 @@ 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 + klass = msg['wrapped'] || msg['class'] + Honeybadger::Trace.instrument("#{klass}#perform", { :source => 'sidekiq', :jid => msg['jid'], :class => klass }) do yield end end end @@ -25,10 +26,12 @@ if defined?(::Sidekiq::VERSION) && ::Sidekiq::VERSION > '3' ::Sidekiq.configure_server do |sidekiq| sidekiq.error_handlers << lambda {|ex, params| return if params['retry'] && params['retry_count'].to_i < config[:'sidekiq.attempt_threshold'].to_i - Honeybadger.notify_or_ignore(ex, parameters: params) + opts = {parameters: params} + opts[:component] = params['wrapped'] || params['class'] if config[:'sidekiq.use_component'] + Honeybadger.notify_or_ignore(ex, opts) } end end end end