opentelemetry-instrumentation-active_job 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/opentelemetry/instrumentation/active_job/handlers/default.rb +7 -8
- data/lib/opentelemetry/instrumentation/active_job/handlers/enqueue.rb +1 -2
- data/lib/opentelemetry/instrumentation/active_job/handlers/perform.rb +3 -7
- data/lib/opentelemetry/instrumentation/active_job/instrumentation.rb +1 -1
- data/lib/opentelemetry/instrumentation/active_job/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 807743f1d99ab374f13bfe585b5b08446e21385c00ce1e57ea11e03de587c8d3
|
4
|
+
data.tar.gz: 3e17adc59557e2a7bcfb19c1f2ae7039aedeba599cf91e127cf8a063296bcc46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56d09fcfd8fef7d5d2b575a55cd8b2cdb952892f946726fac6636bf4b4453a48cb4d1704873c6753058bc88a16cd29fd0e7f8eee14c992bebaf9b544e7906d84
|
7
|
+
data.tar.gz: 9b158893c3b9c4fff339cba8d051fd69045d1547df43686cfac26c85f92314861b8fda09ade92464e5552c4f6fe815c1a4975a4e3c19069ff64cbd34a236fe9c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-active_job
|
2
2
|
|
3
|
+
### v0.7.2 / 2024-07-02
|
4
|
+
|
5
|
+
* DOCS: Fix CHANGELOGs to reflect a past breaking change
|
6
|
+
|
7
|
+
### v0.7.1 / 2023-11-23
|
8
|
+
|
9
|
+
* CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
|
10
|
+
|
3
11
|
### v0.7.0 / 2023-11-22
|
4
12
|
|
5
13
|
* BREAKING CHANGE: Drop Rails 6.0 EOL
|
@@ -16,7 +24,7 @@
|
|
16
24
|
|
17
25
|
### v0.6.0 / 2023-09-07
|
18
26
|
|
19
|
-
*
|
27
|
+
* BREAKING CHANGE: Align messaging instrumentation operation names [#648](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/648)
|
20
28
|
|
21
29
|
### v0.5.2 / 2023-08-03
|
22
30
|
|
@@ -41,9 +41,9 @@ module OpenTelemetry
|
|
41
41
|
# @return [Hash] with the span and generated context tokens
|
42
42
|
def start_span(name, _id, payload)
|
43
43
|
span = tracer.start_span(name, attributes: @mapper.call(payload))
|
44
|
-
|
44
|
+
token = OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span))
|
45
45
|
|
46
|
-
{ span: span,
|
46
|
+
{ span: span, ctx_token: token }
|
47
47
|
end
|
48
48
|
|
49
49
|
# Creates a span and registers it with the current context
|
@@ -55,20 +55,20 @@ module OpenTelemetry
|
|
55
55
|
def finish(_name, _id, payload)
|
56
56
|
otel = payload.delete(:__otel)
|
57
57
|
span = otel&.fetch(:span)
|
58
|
-
|
58
|
+
token = otel&.fetch(:ctx_token)
|
59
59
|
|
60
60
|
on_exception((payload[:error] || payload[:exception_object]), span)
|
61
61
|
rescue StandardError => e
|
62
62
|
OpenTelemetry.handle_error(exception: e)
|
63
63
|
ensure
|
64
|
-
finish_span(span,
|
64
|
+
finish_span(span, token)
|
65
65
|
end
|
66
66
|
|
67
67
|
# Finishes the provided spans and also detaches the associated contexts
|
68
68
|
#
|
69
69
|
# @param span [OpenTelemetry::Trace::Span]
|
70
|
-
# @param
|
71
|
-
def finish_span(span,
|
70
|
+
# @param token [Numeric] to unregister
|
71
|
+
def finish_span(span, token)
|
72
72
|
# closes the span after all attributes have been finalized
|
73
73
|
begin
|
74
74
|
if span&.recording?
|
@@ -79,8 +79,7 @@ module OpenTelemetry
|
|
79
79
|
OpenTelemetry.handle_error(exception: e)
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
|
-
tokens&.reverse&.each do |token|
|
82
|
+
begin
|
84
83
|
OpenTelemetry::Context.detach(token)
|
85
84
|
rescue StandardError => e
|
86
85
|
OpenTelemetry.handle_error(exception: e)
|
@@ -29,9 +29,8 @@ module OpenTelemetry
|
|
29
29
|
def start_span(name, _id, payload)
|
30
30
|
job = payload.fetch(:job)
|
31
31
|
span = tracer.start_span(@span_name_formatter.call(job), kind: :producer, attributes: @mapper.call(payload))
|
32
|
-
tokens = [OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span))]
|
33
32
|
OpenTelemetry.propagation.inject(job.__otel_headers) # This must be transmitted over the wire
|
34
|
-
{ span: span,
|
33
|
+
{ span: span, ctx_token: OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span)) }
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -27,7 +27,6 @@ module OpenTelemetry
|
|
27
27
|
# @param payload [Hash] containing job run information
|
28
28
|
# @return [Hash] with the span and generated context tokens
|
29
29
|
def start_span(name, _id, payload)
|
30
|
-
tokens = []
|
31
30
|
job = payload.fetch(:job)
|
32
31
|
parent_context = OpenTelemetry.propagation.extract(job.__otel_headers)
|
33
32
|
|
@@ -36,7 +35,6 @@ module OpenTelemetry
|
|
36
35
|
# TODO: Refactor into a propagation strategy
|
37
36
|
propagation_style = @config[:propagation_style]
|
38
37
|
if propagation_style == :child
|
39
|
-
tokens << OpenTelemetry::Context.attach(parent_context)
|
40
38
|
span = tracer.start_span(span_name, kind: :consumer, attributes: @mapper.call(payload))
|
41
39
|
else
|
42
40
|
span_context = OpenTelemetry::Trace.current_span(parent_context).context
|
@@ -44,9 +42,7 @@ module OpenTelemetry
|
|
44
42
|
span = tracer.start_root_span(span_name, kind: :consumer, attributes: @mapper.call(payload), links: links)
|
45
43
|
end
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
{ span: span, ctx_tokens: tokens }
|
45
|
+
{ span: span, ctx_token: attach_consumer_context(span) }
|
50
46
|
end
|
51
47
|
|
52
48
|
# This method attaches a span to multiple contexts:
|
@@ -54,12 +50,12 @@ module OpenTelemetry
|
|
54
50
|
# This is used later to enrich the ingress span in children, e.g. setting span status to error when a child event like `discard` terminates due to an error
|
55
51
|
# 2. Registers the ingress span as the "active" span, which is the default behavior of the SDK.
|
56
52
|
# @param span [OpenTelemetry::Trace::Span] the currently active span used to record the exception and set the status
|
57
|
-
# @return [
|
53
|
+
# @return [Numeric] Context token that must be detached when finished
|
58
54
|
def attach_consumer_context(span)
|
59
55
|
consumer_context = OpenTelemetry::Trace.context_with_span(span)
|
60
56
|
internal_context = OpenTelemetry::Instrumentation::ActiveJob.context_with_span(span, parent_context: consumer_context)
|
61
57
|
|
62
|
-
|
58
|
+
OpenTelemetry::Context.attach(internal_context)
|
63
59
|
end
|
64
60
|
end
|
65
61
|
end
|
@@ -68,7 +68,7 @@ module OpenTelemetry
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def patch_activejob
|
71
|
-
::ActiveJob::Base.prepend(Patches::Base) unless ::ActiveJob::Base
|
71
|
+
::ActiveJob::Base.prepend(Patches::Base) unless ::ActiveJob::Base <= Patches::Base
|
72
72
|
|
73
73
|
Handlers.subscribe
|
74
74
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -142,14 +142,28 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.64.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.64.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-performance
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.20'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.20'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: simplecov
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,10 +232,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
218
232
|
licenses:
|
219
233
|
- Apache-2.0
|
220
234
|
metadata:
|
221
|
-
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.2/file/CHANGELOG.md
|
222
236
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/active_job
|
223
237
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
224
|
-
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.2
|
225
239
|
post_install_message:
|
226
240
|
rdoc_options: []
|
227
241
|
require_paths:
|