diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-17 10:00:51 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-17 18:14:25 +0200 |
commit | 2e552c6bf0a867b18298409217688f8c14e56207 (patch) | |
tree | f24f99403f02546244ce72a46c18876188c297d7 /lib | |
parent | 7b944e01bddea2ae2ee8e4f68976df9cd8ce63bc (diff) | |
download | gitlab-ce-2e552c6bf0a867b18298409217688f8c14e56207.tar.gz |
Filter out sensitive parameters of metrics data
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/rack_middleware.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/metrics/rack_middleware.rb b/lib/gitlab/metrics/rack_middleware.rb index 3fe27779d03..e61670f491c 100644 --- a/lib/gitlab/metrics/rack_middleware.rb +++ b/lib/gitlab/metrics/rack_middleware.rb @@ -35,7 +35,7 @@ module Gitlab def transaction_from_env(env) trans = Transaction.new - trans.set(:request_uri, env['REQUEST_URI']) + trans.set(:request_uri, filtered_path(env)) trans.set(:request_method, env['REQUEST_METHOD']) trans @@ -54,6 +54,10 @@ module Gitlab private + def filtered_path(env) + ActionDispatch::Request.new(env).filtered_path.presence || env['REQUEST_URI'] + end + def endpoint_paths_cache @endpoint_paths_cache ||= Hash.new do |hash, http_method| hash[http_method] = Hash.new do |inner_hash, raw_path| |