diff options
Diffstat (limited to 'lib/gitlab/graphql/query_analyzers/logger_analyzer.rb')
-rw-r--r-- | lib/gitlab/graphql/query_analyzers/logger_analyzer.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb b/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb index 1285365376f..0665ea8b6c9 100644 --- a/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb +++ b/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb @@ -49,13 +49,21 @@ module Gitlab private def process_variables(variables) - if variables.respond_to?(:to_s) - variables.to_s + filtered_variables = filter_sensitive_variables(variables) + + if filtered_variables.respond_to?(:to_s) + filtered_variables.to_s else - variables + filtered_variables end end + def filter_sensitive_variables(variables) + ActiveSupport::ParameterFilter + .new(::Rails.application.config.filter_parameters) + .filter(variables) + end + def duration(time_started) Gitlab::Metrics::System.monotonic_time - time_started end |