Class: Traxor::Sidekiq::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/traxor/sidekiq/error_handler.rb

Constant Summary collapse

EXCEPTION_METRIC =
'sidekiq.worker.exception.count'

Instance Method Summary collapse

Instance Method Details

#call(_ex, ctx) ⇒ Object



10
11
12
13
14
# File 'lib/traxor/sidekiq/error_handler.rb', line 10

def call(_ex, ctx)
  context = ctx.with_indifferent_access
  tags = { sidekiq_worker: context[:job][:class], sidekiq_queue: context[:job][:queue] }
  Metric.count EXCEPTION_METRIC, 1, tags
end