opentelemetry-instrumentation-sidekiq 0.5.0 → 0.6.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 -0
- data/lib/opentelemetry/instrumentation/sidekiq/instrumentation.rb +1 -1
- data/lib/opentelemetry/instrumentation/sidekiq/middlewares/client/tracer_middleware.rb +4 -2
- data/lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb +5 -3
- data/lib/opentelemetry/instrumentation/sidekiq/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f59b0c373512a72d8b43705d86cd176e8c9c3c98daaf268b6a6e9ae6f1c8f3
|
4
|
+
data.tar.gz: 23474ce25ad1da1527cbb6c528a12f31d674468fafd43e36edd1ce420d1a2098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67cb2fe1ea747b32529bde4f95c2be62b145bc1c9d8456e66321b28d2debe8cfa6245ebc5364fd9283f59e2a12cbfb992d1a067e10cf7de48855a948a3d97250
|
7
|
+
data.tar.gz: e4444ce255afde7f1d6cd7874126318d7adb3d8f1de76e694b3598d985921911ad9d2a90838cd336fefdac6369e7821714ab91156bd363d4c6ddcc554851f4a3
|
data/CHANGELOG.md
ADDED
@@ -9,18 +9,20 @@ module OpenTelemetry
|
|
9
9
|
module Sidekiq
|
10
10
|
module Middlewares
|
11
11
|
module Client
|
12
|
+
# TracerMiddleware propagates context and instruments Sidekiq client
|
13
|
+
# by way of its middleware system
|
12
14
|
class TracerMiddleware
|
13
15
|
def call(_worker_class, job, _queue, _redis_pool)
|
14
16
|
tracer.in_span(
|
15
17
|
job['wrapped']&.to_s || job['class'],
|
16
18
|
attributes: {
|
17
19
|
'messaging.message_id' => job['jid'],
|
18
|
-
'messaging.destination' => job['queue']
|
20
|
+
'messaging.destination' => job['queue']
|
19
21
|
},
|
20
22
|
kind: :producer
|
21
23
|
) do |span|
|
22
24
|
OpenTelemetry.propagation.text.inject(job)
|
23
|
-
span.add_event(
|
25
|
+
span.add_event('created_at', timestamp: job['created_at'])
|
24
26
|
yield
|
25
27
|
end
|
26
28
|
end
|
@@ -9,6 +9,8 @@ module OpenTelemetry
|
|
9
9
|
module Sidekiq
|
10
10
|
module Middlewares
|
11
11
|
module Server
|
12
|
+
# TracerMiddleware propagates context and instruments Sidekiq requests
|
13
|
+
# by way of its middleware system
|
12
14
|
class TracerMiddleware
|
13
15
|
def call(_worker, msg, _queue)
|
14
16
|
parent_context = OpenTelemetry.propagation.text.extract(msg)
|
@@ -16,13 +18,13 @@ module OpenTelemetry
|
|
16
18
|
msg['wrapped']&.to_s || msg['class'],
|
17
19
|
attributes: {
|
18
20
|
'messaging.message_id' => msg['jid'],
|
19
|
-
'messaging.destination' => msg['queue']
|
21
|
+
'messaging.destination' => msg['queue']
|
20
22
|
},
|
21
23
|
with_parent_context: parent_context,
|
22
24
|
kind: :consumer
|
23
25
|
) do |span|
|
24
|
-
span.add_event(
|
25
|
-
span.add_event(
|
26
|
+
span.add_event('created_at', timestamp: msg['created_at'])
|
27
|
+
span.add_event('enqueued_at', timestamp: msg['enqueued_at'])
|
26
28
|
yield
|
27
29
|
end
|
28
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -157,6 +157,7 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- CHANGELOG.md
|
160
161
|
- LICENSE
|
161
162
|
- lib/opentelemetry-instrumentation-sidekiq.rb
|
162
163
|
- lib/opentelemetry/instrumentation.rb
|
@@ -184,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
185
|
- !ruby/object:Gem::Version
|
185
186
|
version: '0'
|
186
187
|
requirements: []
|
187
|
-
rubygems_version: 3.
|
188
|
+
rubygems_version: 3.1.2
|
188
189
|
signing_key:
|
189
190
|
specification_version: 4
|
190
191
|
summary: Sidekiq instrumentation for the OpenTelemetry framework
|