queue_classic_plus 4.0.0.alpha11 → 4.0.0.alpha13

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: ff8976dc68cd90745c7f0761be48d57abefb93066f094781d2f7d8c5d1bad0c4
4
- data.tar.gz: '05283113c365e521b0c2e6e29166ef6e4b88e0e93206fde58c3bb592ae05e87c'
3
+ metadata.gz: 0fad0727ccc431b046daa9fa899876a8ff9da6737f332568b16f0caff2a9b611
4
+ data.tar.gz: e5049e96e9b9fa22a3cfa9af539110deefadcc2895567d762c17757a882c50c9
5
5
  SHA512:
6
- metadata.gz: 40100aa7380005e2d58ce5047bf94ddba43caadf4d0b55966fdf2a311c1ae68bd402ba4af00d99957c970139a2d2331466309e3ed6694da44a14ac8abc18b571
7
- data.tar.gz: 6c969f33a7c29f0f4e6120305b09d40e2f982631cf2e33e7d25deb16d9b2223cfb6801bd16926fac02ec17bdc330a91515925e4f5c9386f32d9edc1755314925
6
+ metadata.gz: '093dce00414281ddb7ea7ea910033a6859eb57fc0d3f1b1c953a5451690009d0209d730f2d6964da12307e8418ff7247f51e398fda6ffacc145450bf12825841'
7
+ data.tar.gz: 162549c1ded09273f540abd9f554b1f84164112557f2adee9945451262682f684749ca3fb88b3fb177c599a34e7cc040978085d082e3f6a65bf7325867ecaebd
@@ -1,9 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'dry-configurable'
4
+
3
5
  module QueueClassicDatadog
6
+ extend Dry::Configurable
7
+
8
+ setting :dd_service
9
+
4
10
  def _perform(*args)
11
+ service_name = QueueClassicDatadog.config.dd_service || 'qc.job'
12
+
5
13
  if Gem.loaded_specs['ddtrace'].version >= Gem::Version.new('1')
6
- Datadog::Tracing.trace('qc.job', service: 'qc.job', resource: "#{name}#perform") do |_|
14
+ Datadog::Tracing.trace('qc.job', service: service_name, resource: "#{name}#perform") do |_|
7
15
  super
8
16
  end
9
17
  else
@@ -1,3 +1,3 @@
1
1
  module QueueClassicPlus
2
- VERSION = '4.0.0.alpha11'.freeze
2
+ VERSION = '4.0.0.alpha13'.freeze
3
3
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "queue_classic", "4.0.0.pre.alpha1"
22
+ spec.add_dependency "dry-configurable", "1.1.0"
22
23
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
23
24
  spec.add_development_dependency "bundler", "~> 1.6"
24
25
  else
data/spec/datadog_spec.rb CHANGED
@@ -15,4 +15,18 @@ describe 'requiring queue_classic_plus/new_relic' do
15
15
  )
16
16
  subject
17
17
  end
18
+
19
+ context "when service name is configured" do
20
+ let(:configured_service_name) { "configured_service_name" }
21
+
22
+ it "traces using the service name" do
23
+ require 'queue_classic_plus/datadog'
24
+ QueueClassicDatadog.config.dd_service = configured_service_name
25
+
26
+ expect(Datadog::Tracing).to receive(:trace).with(
27
+ 'qc.job', service: configured_service_name, resource: 'FunkyName#perform'
28
+ )
29
+ subject
30
+ end
31
+ end
18
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_classic_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha11
4
+ version: 4.0.0.alpha13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-01-10 00:00:00.000000000 Z
13
+ date: 2023-08-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: queue_classic
@@ -26,6 +26,20 @@ dependencies:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
28
  version: 4.0.0.pre.alpha1
29
+ - !ruby/object:Gem::Dependency
30
+ name: dry-configurable
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 1.1.0
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 1.1.0
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: bundler
31
45
  requirement: !ruby/object:Gem::Requirement