diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /lib/gitlab/instrumentation_helper.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/gitlab/instrumentation_helper.rb')
-rw-r--r-- | lib/gitlab/instrumentation_helper.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/instrumentation_helper.rb b/lib/gitlab/instrumentation_helper.rb index d7228099eaf..6b0f01757b7 100644 --- a/lib/gitlab/instrumentation_helper.rb +++ b/lib/gitlab/instrumentation_helper.rb @@ -13,7 +13,8 @@ module Gitlab :rugged_duration_s, :elasticsearch_calls, :elasticsearch_duration_s, - *::Gitlab::Instrumentation::Redis.known_payload_keys] + *::Gitlab::Instrumentation::Redis.known_payload_keys, + *::Gitlab::Metrics::Subscribers::ActiveRecord::DB_COUNTERS] end def add_instrumentation_data(payload) @@ -22,6 +23,7 @@ module Gitlab instrument_redis(payload) instrument_elasticsearch(payload) instrument_throttle(payload) + instrument_active_record(payload) end def instrument_gitaly(payload) @@ -62,6 +64,12 @@ module Gitlab payload[:throttle_safelist] = safelist if safelist.present? end + def instrument_active_record(payload) + db_counters = ::Gitlab::Metrics::Subscribers::ActiveRecord.db_counter_payload + + payload.merge!(db_counters) + end + # Returns the queuing duration for a Sidekiq job in seconds, as a float, if the # `enqueued_at` field or `created_at` field is available. # |