sidekiq-instrument 0.7.2 → 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: 15f6647c70a9728ad1feb253f921cc68994a32256de015a1c45f147b6aff72ec
4
- data.tar.gz: c645b679c715dfe90a6713e56a9b2f3720105ffc065249e7eaec9a614e3e67b9
3
+ metadata.gz: 7c79cacef1cb058038cfd3c55495349dbbd4b4c023114bb4760e83868647a9b1
4
+ data.tar.gz: c2c1ad52812042a210fc7549b48520977ec33836b850b17110002d3b23d442d4
5
5
  SHA512:
6
- metadata.gz: 957b8590030205b27196985aed50e0b4801772ea8a1a7b25f30bc98cb369c8d623b49936d3acd974b5be703925eee0d6f790abffc7b2b05e71bcd481a098399f
7
- data.tar.gz: ed94944e7cf926f9f54056d072c493d111ad7070da3917f8650d282f045da8ecd4a2547ffb0789a3ce2e49f40ecd6c4a88b1175adf10dbf5dda2194eb1b23b2f
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,16 +9,16 @@ 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))
18
+ Statter.dogstatsd&.timing('sidekiq.runtime', execution_time_ms, worker_dog_options(worker, job))
19
19
  Statter.statsd.measure(metric_name(worker, 'runtime'), execution_time_ms)
20
20
  rescue Exception => e
21
- dd_options = worker_dog_options(worker)
21
+ dd_options = worker_dog_options(worker, job)
22
22
  dd_options[:tags] << "error:#{e.class.name}"
23
23
 
24
24
  # if we have retries left, increment the enqueue.retry counter to indicate the job is going back on the queue
@@ -8,8 +8,13 @@ module Sidekiq::Instrument
8
8
  end
9
9
  end
10
10
 
11
- def worker_dog_options(worker)
12
- { tags: ["queue:#{queue_name(worker)}", "worker:#{underscore(class_name(worker))}"] }
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)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Instrument
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'
4
4
  end
5
5
  end
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.2
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-09 00:00:00.000000000 Z
11
+ date: 2024-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq