opentelemetry-instrumentation-active_job 0.7.1 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- 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/handlers.rb +1 -1
- data/lib/opentelemetry/instrumentation/active_job/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6596ca74536a5ebd8fbff3e7529c419eaf1ae8338228916d6392c9f437f5874a
|
4
|
+
data.tar.gz: 9cb094923456136ea279f8f12dfb9b21973d71478c95ea3f29f4af0ddc2cd925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3f8de8a994f503e226b18afe81a5dac2df0d98d0eb915b8c164777c50332836f29278b6af595ad7f93afb3c1d3436257034bf6e150914cdc572dbe76f31f6cc
|
7
|
+
data.tar.gz: 189ec1ed576d3c7320bf3b633088934ed8aa1aec8c4f5530459e573f87e8fc63a829a329498082919ce5827ef05de092a0720f830887747a697ed5cc71c9f534
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-active_job
|
2
2
|
|
3
|
+
### v0.7.3 / 2024-07-22
|
4
|
+
|
5
|
+
* FIXED: ActiveJob::Handlers.unsubscribe
|
6
|
+
|
7
|
+
### v0.7.2 / 2024-07-02
|
8
|
+
|
9
|
+
* DOCS: Fix CHANGELOGs to reflect a past breaking change
|
10
|
+
|
3
11
|
### v0.7.1 / 2023-11-23
|
4
12
|
|
5
13
|
* CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
|
@@ -20,7 +28,7 @@
|
|
20
28
|
|
21
29
|
### v0.6.0 / 2023-09-07
|
22
30
|
|
23
|
-
*
|
31
|
+
* BREAKING CHANGE: Align messaging instrumentation operation names [#648](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/648)
|
24
32
|
|
25
33
|
### v0.5.2 / 2023-08-03
|
26
34
|
|
@@ -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
|
@@ -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.3
|
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-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -142,28 +142,28 @@ 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
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: '1.20'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: '1.20'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: simplecov
|
169
169
|
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.3/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.3
|
239
239
|
post_install_message:
|
240
240
|
rdoc_options: []
|
241
241
|
require_paths:
|