Commit ea2d0e11 authored by Stan Hu's avatar Stan Hu

Merge branch 'improve-logging-of-sidekikq-scheduled-at' into 'master'

Convert Sidekiq scheduled_at to a timestamp field

See merge request gitlab-org/gitlab!74360
parents 02e564a7 c5d52ecc
...@@ -6,7 +6,7 @@ require 'json' ...@@ -6,7 +6,7 @@ require 'json'
module Gitlab module Gitlab
module SidekiqLogging module SidekiqLogging
class JSONFormatter 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) def call(severity, timestamp, progname, data)
output = { output = {
......
...@@ -17,6 +17,7 @@ RSpec.describe Gitlab::SidekiqLogging::JSONFormatter do ...@@ -17,6 +17,7 @@ RSpec.describe Gitlab::SidekiqLogging::JSONFormatter do
'class' => 'PostReceive', 'class' => 'PostReceive',
'bar' => 'test', 'bar' => 'test',
'created_at' => timestamp, 'created_at' => timestamp,
'scheduled_at' => timestamp,
'enqueued_at' => timestamp, 'enqueued_at' => timestamp,
'started_at' => timestamp, 'started_at' => timestamp,
'retried_at' => timestamp, 'retried_at' => timestamp,
...@@ -31,6 +32,7 @@ RSpec.describe Gitlab::SidekiqLogging::JSONFormatter do ...@@ -31,6 +32,7 @@ RSpec.describe Gitlab::SidekiqLogging::JSONFormatter do
'severity' => 'INFO', 'severity' => 'INFO',
'time' => timestamp_iso8601, 'time' => timestamp_iso8601,
'created_at' => timestamp_iso8601, 'created_at' => timestamp_iso8601,
'scheduled_at' => timestamp_iso8601,
'enqueued_at' => timestamp_iso8601, 'enqueued_at' => timestamp_iso8601,
'started_at' => timestamp_iso8601, 'started_at' => timestamp_iso8601,
'retried_at' => timestamp_iso8601, 'retried_at' => timestamp_iso8601,
......
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