sidekiq_publisher 1.7.0.rc0 → 1.7.0.rc1

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: 857fd87d65ea4d55711d45e269148eeb0b14454a27ae4315c507815b22c86ea4
4
- data.tar.gz: 7d3d092e6e2df1c64734c6a60a8bc8b084fba68c8e684f4e0e578c99fdea117b
3
+ metadata.gz: 7b46548489774867e03fcbd1c4359909cc12d4baf7a92091d06bf45bba3d3120
4
+ data.tar.gz: c8f0fcd1ec8127f62e880a6282baeeb8b851583d06db25d0ac2e3d85287e1e32
5
5
  SHA512:
6
- metadata.gz: 2938169bd4db7a074936bc48f46456c4ec2700a5bfc60adf4039ffc87666f3ba99f5c42504e72dfa34c55fc71568f4e7ef695489d3c9165db66c996a3a6363bb
7
- data.tar.gz: da2bbee1abf0fb70a7afb05b48d5c7c692ea9911ae5b26f35500eb69792a54872213d509c7842564bcc5b659c1070415cb0bd52d71e4cfcdb5acb6705a2fafa3
6
+ metadata.gz: 36d2cfa5d35ef29acde6294318d34fbbccf2960d2bd5304ec35bdf0b1c76d4abf6f4130daf0cd37046f101242e236c4855e2a777a7ca6cddb62ca8ae0fad07ea
7
+ data.tar.gz: 1ac0af71177ed8b6188f0c845e2bb832c73f911326cb8b078f64ce506ce80bc5d6078b0a5a6c9ae0c29839a996f3d92f43f417e2efd38320b615b57c73ac8dbf
@@ -5,6 +5,8 @@ require "ddtrace"
5
5
 
6
6
  module SidekiqPublisher
7
7
  module DatadogAPM
8
+ OPERATION = "sidekiq_publisher"
9
+
8
10
  class << self
9
11
  attr_writer :service
10
12
 
@@ -24,11 +26,13 @@ module SidekiqPublisher
24
26
 
25
27
  private
26
28
 
27
- def start_span(operation, payload)
28
- # Internal sanity check
29
- raise "Fix operation name: #{operation}" if operation.end_with?("sidekiq_publisher")
29
+ def start_span(operation, payload, resource = nil)
30
+ resource ||= operation
31
+ payload[:datadog_span] = Datadog.tracer.trace(operation, service: service, resource: resource)
32
+ end
30
33
 
31
- payload[:datadog_span] = Datadog.tracer.trace(operation, service: service)
34
+ def start_primary_span(resource, payload)
35
+ start_span(OPERATION, payload, resource)
32
36
  end
33
37
 
34
38
  def finish_span(payload)
@@ -43,7 +47,7 @@ module SidekiqPublisher
43
47
 
44
48
  class ListenerSubscriber < Subscriber
45
49
  def start(_name, _id, payload)
46
- start_span("listener.timeout", payload)
50
+ start_primary_span("listener.timeout", payload)
47
51
  end
48
52
 
49
53
  subscribe_to "timeout.listener.sidekiq_publisher"
@@ -52,7 +56,7 @@ module SidekiqPublisher
52
56
  class RunnerSubscriber < Subscriber
53
57
  def start(name, _id, payload)
54
58
  op_name = name.split(".").first
55
- start_span("publisher.#{op_name}", payload)
59
+ start_primary_span("publisher.#{op_name}", payload)
56
60
  end
57
61
 
58
62
  subscribe_to "start.publisher.sidekiq_publisher"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "1.7.0.rc0"
4
+ VERSION = "1.7.0.rc1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0.rc0
4
+ version: 1.7.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-06 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob