diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /lib/gitlab/sidekiq_logging | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'lib/gitlab/sidekiq_logging')
-rw-r--r-- | lib/gitlab/sidekiq_logging/deduplication_logger.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/sidekiq_logging/json_formatter.rb | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/sidekiq_logging/deduplication_logger.rb b/lib/gitlab/sidekiq_logging/deduplication_logger.rb index c5654819ffb..f4f6cb2a306 100644 --- a/lib/gitlab/sidekiq_logging/deduplication_logger.rb +++ b/lib/gitlab/sidekiq_logging/deduplication_logger.rb @@ -6,7 +6,7 @@ module Gitlab include Singleton include LogsJobs - def log(job, deduplication_type, deduplication_options = {}) + def deduplicated_log(job, deduplication_type, deduplication_options = {}) payload = parse_job(job) payload['job_status'] = 'deduplicated' payload['message'] = "#{base_message(payload)}: deduplicated: #{deduplication_type}" @@ -17,6 +17,14 @@ module Gitlab Sidekiq.logger.info payload end + + def rescheduled_log(job) + payload = parse_job(job) + payload['job_status'] = 'rescheduled' + payload['message'] = "#{base_message(payload)}: rescheduled" + + Sidekiq.logger.info payload + end end end end diff --git a/lib/gitlab/sidekiq_logging/json_formatter.rb b/lib/gitlab/sidekiq_logging/json_formatter.rb index 8894b48417c..a6281bbdf26 100644 --- a/lib/gitlab/sidekiq_logging/json_formatter.rb +++ b/lib/gitlab/sidekiq_logging/json_formatter.rb @@ -6,7 +6,7 @@ require 'json' module Gitlab module SidekiqLogging class JSONFormatter - TIMESTAMP_FIELDS = %w[created_at enqueued_at started_at retried_at failed_at completed_at].freeze + TIMESTAMP_FIELDS = %w[created_at scheduled_at enqueued_at started_at retried_at failed_at completed_at].freeze def call(severity, timestamp, progname, data) output = { |