debian-mirror-gitlab/lib/gitlab/sidekiq_death_handler.rb

20 lines
447 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
module Gitlab
module SidekiqDeathHandler
class << self
include ::Gitlab::SidekiqMiddleware::MetricsHelper
def handler(job, _exception)
2021-03-11 19:13:27 +05:30
labels = create_labels(job['class'].constantize, job['queue'], job)
2021-02-22 17:27:13 +05:30
counter.increment(labels)
end
def counter
@counter ||= ::Gitlab::Metrics.counter(:sidekiq_jobs_dead_total, 'Sidekiq dead jobs')
end
end
end
end