summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-11-01 14:14:17 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-11-01 14:14:17 +0000
commit5c1459ef0f1fa4f091ccb735aba9fd918f53105d (patch)
tree9a40a734a6960920b13ce1894c28abc885ba07b5 /lib
parente1f118999309ece630793161bba47d7ccbe008fd (diff)
parentd5859bb9d59b3750ac6e9b8c4c17d69c4c3ed077 (diff)
downloadgitlab-ce-5c1459ef0f1fa4f091ccb735aba9fd918f53105d.tar.gz
Merge branch '35914-merge-request-update-worker-is-slow' into 'master'
Add metrics tagging to the sidekiq middleware See merge request gitlab-org/gitlab-ce!15111
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/metrics/sidekiq_middleware.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/metrics/sidekiq_middleware.rb b/lib/gitlab/metrics/sidekiq_middleware.rb
index f9dd8e41912..b983a40611f 100644
--- a/lib/gitlab/metrics/sidekiq_middleware.rb
+++ b/lib/gitlab/metrics/sidekiq_middleware.rb
@@ -11,6 +11,8 @@ module Gitlab
# Old gitlad-shell messages don't provide enqueued_at/created_at attributes
trans.set(:sidekiq_queue_duration, Time.now.to_f - (message['enqueued_at'] || message['created_at'] || 0))
trans.run { yield }
+
+ worker.metrics_tags.each { |tag, value| trans.add_tag(tag, value) } if worker.respond_to?(:metrics_tags)
rescue Exception => error # rubocop: disable Lint/RescueException
trans.add_event(:sidekiq_exception)