diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-11 03:43:44 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-12 17:58:55 +0300 |
commit | 51ca79228bc2d22b12d47ba177610d228793dc94 (patch) | |
tree | be4b156aa088aeb78eca6c198dd78810a1db5fc8 /app | |
parent | d29e81b2aa7fc26736eb09309bbbf2ab5a5d5050 (diff) |
Log queue duration in production_json.log
`queue_duration` is a useful metric that is currently in api_json.log
but not in production_json.log. We should add it because it tells us how
long the request sat in Workhorse before Unicorn processed it. Having
this field enables the support team to better troubleshoot when delays
began to happen.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 26cd5dc801f..af0b0c64814 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -137,6 +137,8 @@ class ApplicationController < ActionController::Base if response.status == 422 && response.body.present? && response.content_type == 'application/json'.freeze payload[:response] = response.body end + + payload[:queue_duration] = request.env[::Gitlab::Middleware::RailsQueueDuration::GITLAB_RAILS_QUEUE_DURATION_KEY] end ## |