2020-03-09 14:07:59 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module SidekiqLogging
|
|
|
|
module LogsJobs
|
|
|
|
def base_message(payload)
|
|
|
|
"#{payload['class']} JID-#{payload['jid']}"
|
|
|
|
end
|
|
|
|
|
2020-04-07 05:09:13 -04:00
|
|
|
# NOTE: Arguments are truncated/stringified in sidekiq_logging/json_formatter.rb
|
2020-03-09 14:07:59 -04:00
|
|
|
def parse_job(job)
|
|
|
|
# Error information from the previous try is in the payload for
|
|
|
|
# displaying in the Sidekiq UI, but is very confusing in logs!
|
|
|
|
job = job.except('error_backtrace', 'error_class', 'error_message')
|
2021-02-05 04:09:10 -05:00
|
|
|
job['class'] = job.delete('wrapped') if job['wrapped'].present?
|
2020-03-09 14:07:59 -04:00
|
|
|
|
|
|
|
# Add process id params
|
|
|
|
job['pid'] = ::Process.pid
|
|
|
|
|
2020-11-13 13:09:11 -05:00
|
|
|
job.delete('args') unless SidekiqLogArguments.enabled?
|
2020-03-09 14:07:59 -04:00
|
|
|
|
|
|
|
job
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|