queue_classic_plus 4.0.0.alpha11 → 4.0.0.alpha12

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: 53bcc9820afd73035eac622633277005186232b40cee67736b6e7365dc00ccee
4
+ data.tar.gz: cfcb45c257cc50fdbeca8dd594aba7b0387ad6e210f7a1a314022488aae885cf
5
5
  SHA512:
6
- metadata.gz: 40100aa7380005e2d58ce5047bf94ddba43caadf4d0b55966fdf2a311c1ae68bd402ba4af00d99957c970139a2d2331466309e3ed6694da44a14ac8abc18b571
7
- data.tar.gz: 6c969f33a7c29f0f4e6120305b09d40e2f982631cf2e33e7d25deb16d9b2223cfb6801bd16926fac02ec17bdc330a91515925e4f5c9386f32d9edc1755314925
6
+ metadata.gz: 9bbd716d0c1a11645745f4929543bac35220db15e9bd76baf9677643cb5f66138ed7cc1a9c040d0bcfa91b57bb9afb84042339759e1a687c2bcdff805e14861e
7
+ data.tar.gz: ec310250c95292616e98e894ece699f6dc10adb7824684d0cfd209f56146c4b49f3d7ee32a37763a52947af7af8c05a7c0568a20327db22936ffe7f3328771ca
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec
5
5
 
6
6
  gem "queue_classic_matchers", github: 'rainforestapp/queue_classic_matchers'
7
7
  gem 'pry'
8
+ gem 'dry-configurable'
8
9
 
9
10
  group :development do
10
11
  gem "guard-rspec", require: false
@@ -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.alpha12'.freeze
3
3
  end
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.alpha12
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