Commit 779c4701 authored by Paul Slaughter's avatar Paul Slaughter

Use to_s on variables in LoggerTracer

- It's likely this was causing an issue with Kibana
  picking up our logs
- See https://gitlab.com/gitlab-org/gitlab/-/issues/331697#note_722162232
parent 8e4c4cf0
...@@ -45,14 +45,12 @@ module Gitlab ...@@ -45,14 +45,12 @@ module Gitlab
::Gitlab::GraphqlLogger.info(info) ::Gitlab::GraphqlLogger.info(info)
end end
def query_variables_for_logging(query)
clean_variables(query.provided_variables)
end
def clean_variables(variables) def clean_variables(variables)
ActiveSupport::ParameterFilter filtered = ActiveSupport::ParameterFilter
.new(::Rails.application.config.filter_parameters) .new(::Rails.application.config.filter_parameters)
.filter(variables) .filter(variables)
filtered&.to_s
end end
end end
end end
......
...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Graphql::Tracers::LoggerTracer do ...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Graphql::Tracers::LoggerTracer do
query_fingerprint: query.fingerprint, query_fingerprint: query.fingerprint,
query_string: query_string, query_string: query_string,
trace_type: "execute_query", trace_type: "execute_query",
variables: variables variables: variables.to_s
}) })
dummy_schema.execute(query_string, variables: variables) dummy_schema.execute(query_string, variables: variables)
......
...@@ -32,7 +32,7 @@ RSpec.describe 'GraphQL' do ...@@ -32,7 +32,7 @@ RSpec.describe 'GraphQL' do
# operation_fingerprint starts with operation name # operation_fingerprint starts with operation name
operation_fingerprint: %r{^anonymous\/}, operation_fingerprint: %r{^anonymous\/},
is_mutation: false, is_mutation: false,
variables: variables, variables: variables.to_s,
query_string: query query_string: query
} }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment