diff options
author | Stan Hu <stanhu@gmail.com> | 2018-05-15 21:25:32 +0300 |
---|---|---|
committer | Mek Stittri <mstittri@gitlab.com> | 2018-05-15 22:24:20 +0300 |
commit | b3c2745cb6808bafbe2511765b5a90040c99f297 (patch) | |
tree | e30fc2eb08711c43f38a32e5ed5c8b656e0af721 /lib | |
parent | 9f121081d647b97565899171153011d5b0cf6914 (diff) |
Merge branch 'fix-metrics-content-types' into 'master'
Fix setting Gitlab metrics content types
Closes gitlab-com/infrastructure#3499
See merge request gitlab-org/gitlab-ce!18975
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/web_transaction.rb | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/gitlab/metrics/web_transaction.rb b/lib/gitlab/metrics/web_transaction.rb index 89ff02a96d6..7cf33ca9e8a 100644 --- a/lib/gitlab/metrics/web_transaction.rb +++ b/lib/gitlab/metrics/web_transaction.rb @@ -4,18 +4,6 @@ module Gitlab CONTROLLER_KEY = 'action_controller.instance'.freeze ENDPOINT_KEY = 'api.endpoint'.freeze - CONTENT_TYPES = { - 'text/html' => :html, - 'text/plain' => :txt, - 'application/json' => :json, - 'text/js' => :js, - 'application/atom+xml' => :atom, - 'image/png' => :png, - 'image/jpeg' => :jpeg, - 'image/gif' => :gif, - 'image/svg+xml' => :svg - }.freeze - def initialize(env) super() @env = env @@ -40,7 +28,7 @@ module Gitlab controller = @env[CONTROLLER_KEY] action = "#{controller.action_name}" - suffix = CONTENT_TYPES[controller.content_type] + suffix = controller.request_format if suffix && suffix != :html action += ".#{suffix}" |