sidekiq-instrument 0.7.1 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c79cacef1cb058038cfd3c55495349dbbd4b4c023114bb4760e83868647a9b1
|
4
|
+
data.tar.gz: c2c1ad52812042a210fc7549b48520977ec33836b850b17110002d3b23d442d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c586597549a8eb0a7002ea2f1b290737a39d5fb08f66565f613c5f77448c32027f961b44a3c2cd743f05f80f0bdaf3e4fcc8297357e8b3f6eb43bd3b25d0c14a
|
7
|
+
data.tar.gz: 88d1aee1549d0189be4c6e71cefdb6dc7d975f932c9e47b20ce7b9245646f2eb01d29e2b079e300197afa028888c9e26c2e5eefbebed4fdf8d20013170667fb4
|
@@ -20,7 +20,7 @@ module Sidekiq::Instrument
|
|
20
20
|
if Sidekiq::Context.current[:class].present?
|
21
21
|
WorkerMetrics.trace_workers_increment_counter(klass.name.underscore)
|
22
22
|
Statter.statsd.increment(metric_name(class_instance, 'enqueue'))
|
23
|
-
Statter.dogstatsd&.increment('sidekiq.enqueue', worker_dog_options(class_instance))
|
23
|
+
Statter.dogstatsd&.increment('sidekiq.enqueue', worker_dog_options(class_instance, job))
|
24
24
|
end
|
25
25
|
|
26
26
|
Statter.dogstatsd&.flush(sync: true)
|
@@ -9,23 +9,27 @@ module Sidekiq::Instrument
|
|
9
9
|
|
10
10
|
def call(worker, job, _queue, &block)
|
11
11
|
dequeue_string = is_retry(job) ? 'dequeue.retry' : 'dequeue'
|
12
|
-
Statter.dogstatsd&.increment("sidekiq.#{dequeue_string}", worker_dog_options(worker))
|
12
|
+
Statter.dogstatsd&.increment("sidekiq.#{dequeue_string}", worker_dog_options(worker, job))
|
13
13
|
Statter.statsd.increment(metric_name(worker, dequeue_string))
|
14
14
|
|
15
15
|
start_time = Time.now
|
16
16
|
yield block
|
17
17
|
execution_time_ms = (Time.now - start_time) * 1000
|
18
|
+
Statter.dogstatsd&.timing('sidekiq.runtime', execution_time_ms, worker_dog_options(worker, job))
|
18
19
|
Statter.statsd.measure(metric_name(worker, 'runtime'), execution_time_ms)
|
19
|
-
|
20
|
-
|
20
|
+
rescue Exception => e
|
21
|
+
dd_options = worker_dog_options(worker, job)
|
22
|
+
dd_options[:tags] << "error:#{e.class.name}"
|
23
|
+
|
21
24
|
# if we have retries left, increment the enqueue.retry counter to indicate the job is going back on the queue
|
22
25
|
if max_retries(worker) > current_retries(job) + 1
|
23
26
|
WorkerMetrics.trace_workers_increment_counter(worker.class.to_s.underscore)
|
24
|
-
Statter.dogstatsd&.increment('sidekiq.enqueue.retry',
|
27
|
+
Statter.dogstatsd&.increment('sidekiq.enqueue.retry', dd_options)
|
25
28
|
end
|
26
29
|
|
30
|
+
Statter.dogstatsd&.increment('sidekiq.error', dd_options)
|
27
31
|
Statter.statsd.increment(metric_name(worker, 'error'))
|
28
|
-
|
32
|
+
|
29
33
|
raise e
|
30
34
|
ensure
|
31
35
|
WorkerMetrics.trace_workers_decrement_counter(worker.class.to_s.underscore)
|
@@ -8,8 +8,13 @@ module Sidekiq::Instrument
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
def worker_dog_options(worker)
|
12
|
-
{
|
11
|
+
def worker_dog_options(worker, job)
|
12
|
+
{
|
13
|
+
tags: [
|
14
|
+
"queue:#{queue_name(worker)}",
|
15
|
+
"worker:#{underscore(class_name(worker))}"
|
16
|
+
].concat(job.fetch('tags', []))
|
17
|
+
}
|
13
18
|
end
|
14
19
|
|
15
20
|
def max_retries(worker)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-instrument
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loan Application Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|