gitlab-org--gitlab-foss/lib/gitlab/metrics/sidekiq_middleware.rb
Yorick Peterse 35b501f30a Tag all transaction metrics with an "action" tag
Without this it's impossible to find out what methods/views/queries are
executed by a certain controller or Sidekiq worker. While this will
increase the total number of series it should stay within reasonable
limits due to the amount of "actions" being small enough.
2016-01-11 16:51:01 +01:00

18 lines
409 B
Ruby

module Gitlab
module Metrics
# Sidekiq middleware for tracking jobs.
#
# This middleware is intended to be used as a server-side middleware.
class SidekiqMiddleware
def call(worker, message, queue)
trans = Transaction.new("#{worker.class.name}#perform")
begin
trans.run { yield }
ensure
trans.finish
end
end
end
end
end