opentelemetry-instrumentation-active_job 0.7.2 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/opentelemetry/instrumentation/active_job/handlers/enqueue.rb +13 -10
- data/lib/opentelemetry/instrumentation/active_job/handlers/perform.rb +13 -10
- data/lib/opentelemetry/instrumentation/active_job/handlers.rb +1 -1
- data/lib/opentelemetry/instrumentation/active_job/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1891d4bd1469e53cf227e6dd45ce33af844c7d993fbde60564d25189f00ae614
|
4
|
+
data.tar.gz: 847dca4d8748a754c1afb83260dbad467a3b9efc2d9a758297441551ad659c68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2523337eb8e3bb71900cc056e1976c63bb80f9ba19155167bccf153a83db4964e29b373dc96805ed8594dbf367acb3dd459307ef940794e0ff4194335f66652
|
7
|
+
data.tar.gz: 17ccc797815874557a36b8a20af8caa26ce918f5ba6f007b0131fe3fa3c2c537f7d25459ec6b49b55b29b4370587505d04ad82f98f5ed0a844e918d1c326dcec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-active_job
|
2
2
|
|
3
|
+
### v0.7.4 / 2024-07-30
|
4
|
+
|
5
|
+
* FIXED: Honour dynamic changes in configuration
|
6
|
+
|
7
|
+
### v0.7.3 / 2024-07-22
|
8
|
+
|
9
|
+
* FIXED: ActiveJob::Handlers.unsubscribe
|
10
|
+
|
3
11
|
### v0.7.2 / 2024-07-02
|
4
12
|
|
5
13
|
* DOCS: Fix CHANGELOGs to reflect a past breaking change
|
@@ -10,15 +10,6 @@ module OpenTelemetry
|
|
10
10
|
module Handlers
|
11
11
|
# Handles `enqueue.active_job` and `enqueue_at.active_job` to generate egress spans
|
12
12
|
class Enqueue < Default
|
13
|
-
def initialize(...)
|
14
|
-
super
|
15
|
-
@span_name_formatter = if @config[:span_naming] == :job_class
|
16
|
-
->(job) { "#{job.class.name} publish" }
|
17
|
-
else
|
18
|
-
->(job) { "#{job.queue_name} publish" }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
13
|
# Overrides the `Default#start_span` method to create an egress span
|
23
14
|
# and registers it with the current context
|
24
15
|
#
|
@@ -28,10 +19,22 @@ module OpenTelemetry
|
|
28
19
|
# @return [Hash] with the span and generated context tokens
|
29
20
|
def start_span(name, _id, payload)
|
30
21
|
job = payload.fetch(:job)
|
31
|
-
span = tracer.start_span(
|
22
|
+
span = tracer.start_span(span_name(job), kind: :producer, attributes: @mapper.call(payload))
|
32
23
|
OpenTelemetry.propagation.inject(job.__otel_headers) # This must be transmitted over the wire
|
33
24
|
{ span: span, ctx_token: OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span)) }
|
34
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def span_name(job)
|
30
|
+
prefix = if @config[:span_naming] == :job_class
|
31
|
+
job.class.name
|
32
|
+
else
|
33
|
+
job.queue_name
|
34
|
+
end
|
35
|
+
|
36
|
+
"#{prefix} publish"
|
37
|
+
end
|
35
38
|
end
|
36
39
|
end
|
37
40
|
end
|
@@ -10,15 +10,6 @@ module OpenTelemetry
|
|
10
10
|
module Handlers
|
11
11
|
# Handles perform.active_job to generate ingress spans
|
12
12
|
class Perform < Default
|
13
|
-
def initialize(...)
|
14
|
-
super
|
15
|
-
@span_name_formatter = if @config[:span_naming] == :job_class
|
16
|
-
->(job) { "#{job.class.name} process" }
|
17
|
-
else
|
18
|
-
->(job) { "#{job.queue_name} process" }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
13
|
# Overrides the `Default#start_span` method to create an ingress span
|
23
14
|
# and registers it with the current context
|
24
15
|
#
|
@@ -30,7 +21,7 @@ module OpenTelemetry
|
|
30
21
|
job = payload.fetch(:job)
|
31
22
|
parent_context = OpenTelemetry.propagation.extract(job.__otel_headers)
|
32
23
|
|
33
|
-
span_name =
|
24
|
+
span_name = span_name(job)
|
34
25
|
|
35
26
|
# TODO: Refactor into a propagation strategy
|
36
27
|
propagation_style = @config[:propagation_style]
|
@@ -57,6 +48,18 @@ module OpenTelemetry
|
|
57
48
|
|
58
49
|
OpenTelemetry::Context.attach(internal_context)
|
59
50
|
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def span_name(job)
|
55
|
+
prefix = if @config[:span_naming] == :job_class
|
56
|
+
job.class.name
|
57
|
+
else
|
58
|
+
job.queue_name
|
59
|
+
end
|
60
|
+
|
61
|
+
"#{prefix} process"
|
62
|
+
end
|
60
63
|
end
|
61
64
|
end
|
62
65
|
end
|
@@ -64,7 +64,7 @@ module OpenTelemetry
|
|
64
64
|
# Removes Event Handler Subscriptions for ActiveJob notifications
|
65
65
|
# @note this method is not thread-safe and should not be used in a multi-threaded context
|
66
66
|
def unsubscribe
|
67
|
-
@subscriptions&.each { |subscriber| ActiveSupport::Notifications.unsubscribe(subscriber) }
|
67
|
+
@subscriptions&.each { |subscriber| ::ActiveSupport::Notifications.unsubscribe(subscriber) }
|
68
68
|
@subscriptions = nil
|
69
69
|
end
|
70
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-active_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.65.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.65.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rubocop-performance
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,10 +232,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
232
232
|
licenses:
|
233
233
|
- Apache-2.0
|
234
234
|
metadata:
|
235
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.
|
235
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.4/file/CHANGELOG.md
|
236
236
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/active_job
|
237
237
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
238
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.
|
238
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.4
|
239
239
|
post_install_message:
|
240
240
|
rdoc_options: []
|
241
241
|
require_paths:
|