diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-11 18:51:01 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-01-11 18:51:01 +0300 |
commit | 35b501f30ae9e121151ad6a2140d036e5ef3b0f5 (patch) | |
tree | 9d6e05cdb918bec61c1452e78a3e612a2fabe877 /lib/gitlab/metrics/sidekiq_middleware.rb | |
parent | f41b535ced0cdddb67661bdb0a6216216dc6b89c (diff) |
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.
Diffstat (limited to 'lib/gitlab/metrics/sidekiq_middleware.rb')
-rw-r--r-- | lib/gitlab/metrics/sidekiq_middleware.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/gitlab/metrics/sidekiq_middleware.rb b/lib/gitlab/metrics/sidekiq_middleware.rb index ad441decfa2..fd98aa3412e 100644 --- a/lib/gitlab/metrics/sidekiq_middleware.rb +++ b/lib/gitlab/metrics/sidekiq_middleware.rb @@ -5,19 +5,14 @@ module Gitlab # This middleware is intended to be used as a server-side middleware. class SidekiqMiddleware def call(worker, message, queue) - trans = Transaction.new + trans = Transaction.new("#{worker.class.name}#perform") begin trans.run { yield } ensure - tag_worker(trans, worker) trans.finish end end - - def tag_worker(trans, worker) - trans.add_tag(:action, "#{worker.class.name}#perform") - end end end end |