datadog-queue-bus 0.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/datadog-queue-bus.gemspec +2 -2
- data/lib/datadog-queue-bus.rb +1 -1
- data/lib/datadog_queue_bus/middleware.rb +4 -3
- data/lib/datadog_queue_bus/version.rb +1 -1
- data/spec/datadog_queue_bus/middleware_spec.rb +7 -6
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a6175afd834e209f14ee348e5240be85778076d6bd64c680fa17e95e80f142
|
4
|
+
data.tar.gz: e53de70efd6c0f20594996d9ec4ac58882eb7f544b88d65270bc8c2b0ef75476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f12b7f475b4f23b3db949023360bf80b964c6c7d1382c2812bb72d96867ec3bcdf13bfd8b09e1e1eb91bb5bff7446252bfbd1934d776c4f0edbd34a928d5263c
|
7
|
+
data.tar.gz: 425cc91c71b90d94a24ef983afe57aa40569bd8fc467e0242c317b755e452d3d7dbf774db24b8f9e757ce0dbcfdca5151c75db64ae1b75e8487940a58e23796b
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [2.0.0]
|
8
|
+
- Replaces ddtrace with the updated `datadog` gem
|
9
|
+
|
10
|
+
## [1.0.0]
|
11
|
+
- Updates ddtrace to the 1.X line and uses that version's `Datadog::Tracer` syntax
|
8
12
|
|
9
13
|
## [0.1.0]
|
10
14
|
|
data/datadog-queue-bus.gemspec
CHANGED
@@ -30,10 +30,10 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
31
31
|
spec.require_paths = ['lib']
|
32
32
|
|
33
|
-
spec.add_dependency '
|
33
|
+
spec.add_dependency 'datadog', '~> 2.0'
|
34
34
|
spec.add_dependency 'queue-bus', '~> 0.6'
|
35
35
|
|
36
|
-
spec.add_development_dependency 'bundler', '~>
|
36
|
+
spec.add_development_dependency 'bundler', '~> 2.4'
|
37
37
|
spec.add_development_dependency 'rake', '~> 10.0'
|
38
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
39
|
spec.add_development_dependency 'rubocop', '~> 0.72'
|
data/lib/datadog-queue-bus.rb
CHANGED
@@ -13,9 +13,10 @@ module DatadogQueueBus
|
|
13
13
|
resource += " event=#{event_type}" if event_type
|
14
14
|
resource += " sub=#{sub_key}" if sub_key
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# def trace(name, continue_from: nil, **span_options, &block)
|
17
|
+
Datadog::Tracing.trace('queue-bus.worker',
|
18
|
+
service: DatadogQueueBus.service_name,
|
19
|
+
resource: resource) do |span|
|
19
20
|
attrs.keys.grep(/^bus_/).each do |key|
|
20
21
|
span.set_tag("queue-bus.#{key}", attrs[key])
|
21
22
|
end
|
@@ -11,9 +11,10 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
11
11
|
'bus_class_proxy' => 'QueueBus::Driver'
|
12
12
|
}
|
13
13
|
end
|
14
|
+
let(:tracer) { Datadog::Tracing }
|
14
15
|
|
15
16
|
it 'uses the class_proxy_class as the resource name' do
|
16
|
-
expect(
|
17
|
+
expect(tracer)
|
17
18
|
.to receive(:trace)
|
18
19
|
.with('queue-bus.worker', hash_including(resource: 'QueueBus::Driver'))
|
19
20
|
subject.call(attrs)
|
@@ -27,7 +28,7 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
27
28
|
end
|
28
29
|
|
29
30
|
it 'sends the service name' do
|
30
|
-
expect(
|
31
|
+
expect(tracer)
|
31
32
|
.to receive(:trace)
|
32
33
|
.with('queue-bus.worker', hash_including(service: name))
|
33
34
|
subject.call(attrs)
|
@@ -40,7 +41,7 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
40
41
|
end
|
41
42
|
|
42
43
|
it 'includes the event in the resource' do
|
43
|
-
expect(
|
44
|
+
expect(tracer)
|
44
45
|
.to receive(:trace)
|
45
46
|
.with('queue-bus.worker',
|
46
47
|
hash_including(resource: a_string_matching(/event=my_event/)))
|
@@ -54,7 +55,7 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
54
55
|
end
|
55
56
|
|
56
57
|
it 'includes the sub key in the resource name' do
|
57
|
-
expect(
|
58
|
+
expect(tracer)
|
58
59
|
.to receive(:trace)
|
59
60
|
.with('queue-bus.worker',
|
60
61
|
hash_including(resource: a_string_matching(/sub=my_subscription/)))
|
@@ -69,7 +70,7 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
69
70
|
|
70
71
|
it 'includes all attributes that start with bus_' do
|
71
72
|
span = spy('span')
|
72
|
-
expect(
|
73
|
+
expect(tracer).to receive(:trace).and_yield(span)
|
73
74
|
subject.call(attrs)
|
74
75
|
expect(span).to have_received(:set_tag).with('queue-bus.bus_class_proxy', 'QueueBus::Driver')
|
75
76
|
expect(span).to have_received(:set_tag).with('queue-bus.bus_field', 'my_field')
|
@@ -83,7 +84,7 @@ RSpec.describe DatadogQueueBus::Middleware do
|
|
83
84
|
|
84
85
|
it 'includes all attributes that start with bus_' do
|
85
86
|
span = spy('span')
|
86
|
-
expect(
|
87
|
+
expect(tracer).to receive(:trace).and_yield(span)
|
87
88
|
subject.call(attrs)
|
88
89
|
expect(span).to have_received(:set_tag).with('queue-bus.bus_class_proxy', 'QueueBus::Driver')
|
89
90
|
expect(span).not_to have_received(:set_tag).with('queue-bus.user_id', 1234)
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datadog-queue-bus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kbacha
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: datadog
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: queue-bus
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.4'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ homepage: https://github.com/queue-bus/datadog-queue-bus
|
|
127
127
|
licenses:
|
128
128
|
- MIT
|
129
129
|
metadata: {}
|
130
|
-
post_install_message:
|
130
|
+
post_install_message:
|
131
131
|
rdoc_options: []
|
132
132
|
require_paths:
|
133
133
|
- lib
|
@@ -142,9 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
|
146
|
-
|
147
|
-
signing_key:
|
145
|
+
rubygems_version: 3.2.33
|
146
|
+
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: A Datadog APM integration for queue-bus
|
150
149
|
test_files:
|