@@ -37,26 +37,30 @@ make_col event:parse_json(log)
37
37
38
38
make_col
39
39
time: parse_isotime(event.timestamp),
40
+ application: string(event.application),
41
+ environment: string(event.environment),
40
42
duration: duration_ms(event.duration_ms),
41
43
level: string(event.level),
42
44
name: string(event.name),
43
45
message: string(event.message),
44
- metric: string(event.metric),
45
46
named_tags: event.named_tags,
46
47
payload: event.payload,
48
+ metric: string(event.metric),
49
+ metric_amount: float64(event.metric_amount),
47
50
tags: array(event.tags),
51
+ exception: event.exception,
48
52
host: string(event.host),
49
- application: string(event.application),
50
- environment: string(event.environment),
51
- level_index: int64(event.level_index),
52
53
pid: int64(event.pid),
53
54
thread: string(event.thread),
54
55
file: string(event.file),
55
56
line: int64(event.line),
56
- backtrace: array(event.backtrace),
57
- metric_amount: int64(event.metric_amount),
58
57
dimensions: event.dimensions,
59
- exception: event.exception
58
+ backtrace: array(event.backtrace),
59
+ level_index: int64(event.level_index)
60
+
61
+ set_valid_from(time)
62
+ drop_col timestamp, log, event, stream
63
+ rename_col timestamp: time
60
64
~~~
61
65
62
66
Now queries can be built to drill down into each of these fields, including ` payload ` which is a nested object.
@@ -65,15 +69,24 @@ For example to find all failed Sidekiq job calls where the causing exception cla
65
69
~~~ ruby
66
70
filter environment = " uat2"
67
71
filter level = " error"
68
- filter metric ~ /Sidekiq/
72
+ filter metric = " sidekiq.job.perform "
69
73
filter (string(exception.cause.name) = " NoMethodError" )
70
74
~~~
71
75
72
- Or, to create a dashboard showing the duration of all successful Sidekiq jobs:
76
+ Example: create a dashboard showing the duration of all successful Sidekiq jobs:
73
77
~~~ ruby
74
78
filter environment = " production"
75
79
filter level = " info"
76
- filter metric ~ /Sidekiq.*/
80
+ filter metric = " sidekiq.job.perform"
81
+ timechart duration: avg(duration), group_by(name)
82
+ ~~~
83
+
84
+ Example: create a dashboard showing the queue latency of all Sidekiq jobs.
85
+ The queue latency is the time between when the job was enqueued and when it was started:
86
+ ~~~ ruby
87
+ filter environment = " production"
88
+ filter level = " info"
89
+ filter metric = " sidekiq.queue.latency"
77
90
timechart duration: avg(duration), group_by(name)
78
91
~~~
79
92
@@ -83,7 +96,14 @@ timechart duration:avg(duration), group_by(name)
83
96
84
97
For complete documentation see: https://logger.rocketjob.io/rails
85
98
86
- ## Upgrading to Semantic Logger v4.15 - Sidekiq Support
99
+ ## Upgrading to Semantic Logger V4.16 - Sidekiq Metrics Support
100
+
101
+ Rails Semantic Logger now supports Sidekiq metrics.
102
+ Below are the metrics that are now available when the JSON logging format is used:
103
+ - ` sidekiq.job.perform ` - The duration of each Sidekiq job.
104
+ - ` sidekiq.queue.latency ` - The time between when a Sidekiq job was enqueued and when it was started.
105
+
106
+ ## Upgrading to Semantic Logger v4.15 & V4.16 - Sidekiq Support
87
107
88
108
Rails Semantic Logger introduces direct support for Sidekiq v4, v5, v6, and v7.
89
109
Please remove any previous custom patches or configurations to make Sidekiq work with Semantic Logger.
0 commit comments