diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-18 02:34:27 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-18 16:53:39 +0300 |
commit | 1136c0c8e98d4f0d3fb4f50219657cabe0d45c99 (patch) | |
tree | 7c555a4d2fa9796cdcba2ac4de2514a974179f31 /config | |
parent | 037096ef6c2c2f804302efb429bcd1eb5123b5e9 (diff) |
Add Rugged calls and duration to API and Rails logs
This adds `rugged_duration_ms` and `rugged_calls` fields to
`api_json.log` and `production_json.log`. This will make it easier to
identify performance issues caused by excessive I/O.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64676
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/lograge.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index fbec28186eb..3d84b4e44ce 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -34,6 +34,13 @@ unless Sidekiq.server? payload[:gitaly_duration] = Gitlab::GitalyClient.query_time_ms end + rugged_calls = Gitlab::RuggedInstrumentation.query_count + + if rugged_calls > 0 + payload[:rugged_calls] = rugged_calls + payload[:rugged_duration_ms] = Gitlab::RuggedInstrumentation.query_time_ms + end + payload[:response] = event.payload[:response] if event.payload[:response] payload[Labkit::Correlation::CorrelationId::LOG_KEY] = Labkit::Correlation::CorrelationId.current_id |