opentelemetry-instrumentation-active_job 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a97f945551875f7cf9ad9c77ea091cfde61c5f228d7ec094cc7dfcc4437b952e
4
- data.tar.gz: 4c22491f11e2ea05f38792dcddce8276de6f8cc7b02f022b0a369de6228a2d29
3
+ metadata.gz: 807743f1d99ab374f13bfe585b5b08446e21385c00ce1e57ea11e03de587c8d3
4
+ data.tar.gz: 3e17adc59557e2a7bcfb19c1f2ae7039aedeba599cf91e127cf8a063296bcc46
5
5
  SHA512:
6
- metadata.gz: f79857630e1199c3bea5ea1333b3dd0e8dec8ad0561e9055d17e536e27fbd26e44104504a0d2aac6f292d23c700f6739322bd51e40e16ed8f39206dc44a0b67d
7
- data.tar.gz: 1d100ca69c1eb47453a4544f1cf49634d6d7a9de98b76e846ae5e4f70a805e86c9292a8934747230e63cbe8c6f7c72d50febc55657fa4c2eb280996b8c1bd1c0
6
+ metadata.gz: 56d09fcfd8fef7d5d2b575a55cd8b2cdb952892f946726fac6636bf4b4453a48cb4d1704873c6753058bc88a16cd29fd0e7f8eee14c992bebaf9b544e7906d84
7
+ data.tar.gz: 9b158893c3b9c4fff339cba8d051fd69045d1547df43686cfac26c85f92314861b8fda09ade92464e5552c4f6fe815c1a4975a4e3c19069ff64cbd34a236fe9c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
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
+
3
7
  ### v0.7.1 / 2023-11-23
4
8
 
5
9
  * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
@@ -20,7 +24,7 @@
20
24
 
21
25
  ### v0.6.0 / 2023-09-07
22
26
 
23
- * FIXED: Align messaging instrumentation operation names
27
+ * BREAKING CHANGE: Align messaging instrumentation operation names [#648](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/648)
24
28
 
25
29
  ### v0.5.2 / 2023-08-03
26
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
- tokens = [OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span))]
44
+ token = OpenTelemetry::Context.attach(OpenTelemetry::Trace.context_with_span(span))
45
45
 
46
- { span: span, ctx_tokens: tokens }
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
- tokens = otel&.fetch(:ctx_tokens)
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, tokens)
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 tokens [Array] to unregister
71
- def finish_span(span, tokens)
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
- # pops the context stack
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, ctx_tokens: tokens }
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
- tokens.concat(attach_consumer_context(span))
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 [Array] Context tokens that must be detached when finished
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
- [consumer_context, internal_context].map { |context| OpenTelemetry::Context.attach(context) }
58
+ OpenTelemetry::Context.attach(internal_context)
63
59
  end
64
60
  end
65
61
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module ActiveJob
10
- VERSION = '0.7.1'
10
+ VERSION = '0.7.2'
11
11
  end
12
12
  end
13
13
  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.1
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: 2023-11-23 00:00:00.000000000 Z
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,28 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.56.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.56.1
152
+ version: 1.64.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.19.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.19.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.1/file/CHANGELOG.md
235
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.2/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.1
238
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-active_job/0.7.2
239
239
  post_install_message:
240
240
  rdoc_options: []
241
241
  require_paths: