diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /lib/gitlab/sidekiq_logging/json_formatter.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'lib/gitlab/sidekiq_logging/json_formatter.rb')
-rw-r--r-- | lib/gitlab/sidekiq_logging/json_formatter.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/gitlab/sidekiq_logging/json_formatter.rb b/lib/gitlab/sidekiq_logging/json_formatter.rb index 64782e1e1d1..8894b48417c 100644 --- a/lib/gitlab/sidekiq_logging/json_formatter.rb +++ b/lib/gitlab/sidekiq_logging/json_formatter.rb @@ -18,10 +18,15 @@ module Gitlab when String output[:message] = data when Hash - convert_to_iso8601!(data) - convert_retry_to_integer!(data) - stringify_args!(data) output.merge!(data) + + # jobstr is redundant and can include information we wanted to + # exclude (like arguments) + output.delete(:jobstr) + + convert_to_iso8601!(output) + convert_retry_to_integer!(output) + process_args!(output) end output.to_json + "\n" @@ -56,8 +61,11 @@ module Gitlab end end - def stringify_args!(payload) - payload['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(payload['args'].map(&:to_s)) if payload['args'] + def process_args!(payload) + return unless payload['args'] + + payload['args'] = Gitlab::ErrorTracking::Processor::SidekiqProcessor + .loggable_arguments(payload['args'], payload['class']) end end end |