diff options
author | Nick Thomas <nick@gitlab.com> | 2018-05-16 12:34:31 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-05-16 12:34:31 +0000 |
commit | e5dc6b156ed032672fbefff33cfc84506cd21661 (patch) | |
tree | ea0f5c27297b7dd9ae0ce123fa4aa89bbc2a422b /lib | |
parent | 51df79f891c262c7bdba61ad6931cb08cc37d7fb (diff) | |
parent | 33af33d7cbf947055a2a40dc2dddf74dfb13079c (diff) | |
download | gitlab-ce-e5dc6b156ed032672fbefff33cfc84506cd21661.tar.gz |
Merge branch 'fix-metrics-doorkeeper' into 'master'
Fix GitLab Performance Monitoring content types for Doorkeeper
Closes #46412
See merge request gitlab-org/gitlab-ce!18984
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/web_transaction.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/metrics/web_transaction.rb b/lib/gitlab/metrics/web_transaction.rb index 7cf33ca9e8a..3799aaebf1c 100644 --- a/lib/gitlab/metrics/web_transaction.rb +++ b/lib/gitlab/metrics/web_transaction.rb @@ -28,7 +28,11 @@ module Gitlab controller = @env[CONTROLLER_KEY] action = "#{controller.action_name}" - suffix = controller.request_format + + # Devise exposes a method called "request_format" that does the below. + # However, this method is not available to all controllers (e.g. certain + # Doorkeeper controllers). As such we use the underlying code directly. + suffix = controller.request.format.try(:ref) if suffix && suffix != :html action += ".#{suffix}" |