opentelemetry-api 1.6.0 → 1.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d906385f921e5a001d2a55b62de37ecfc2ff0bb250ca5dae4e7a8b1d743059d
4
- data.tar.gz: ac3aac34b4f235135611bd32915575e53d99fc10c16677b93032543390563af4
3
+ metadata.gz: 4dbc39ae2e689608cb056105d3c038362070fe52d8ee653de0426f1c55766faf
4
+ data.tar.gz: c9a9c610b7f5f986d18df5e5b3a76d5fed3fcf94067abef7eeaaa79a32fa9a7b
5
5
  SHA512:
6
- metadata.gz: '0308c3366ce2430ee93ae3a78dfa75b704c4ab5f043fc053071b81b181ed72ea89199bad78b44bdc12b7d260d57aeec2d0331e73fcc88da7b7f2b2f48e365de9'
7
- data.tar.gz: 7a2d69028ea2e4d816947490d9053c7864608c8d5a55a616f8c0b2f2a79d7d50e9449d833e99ee94d24477c1a12de583a695c6c2731c0b17f9c87016e39e70d4
6
+ metadata.gz: e2f0d816874f16b73a7b137a1452beea256834d4ed6b777fe88981ec9216de730b28b07fe23f001b41491f2038be168116fc08b17848f22156b6dc3a584ddf73
7
+ data.tar.gz: b32b57334ebac36284710f5fc1a1e5f3277458b9caa91a94063f104e038bde8238c3293d25598b43ea693d2d2a261f7d9be0a2e285696e5d942ec27ae649893e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release History: opentelemetry-api
2
2
 
3
+ ### v1.7.0 / 2025-09-17
4
+
5
+ * BREAKING CHANGE: Remove Span APIs for attributes and events
6
+
7
+ * ADDED: Add record_exception option for in_span
8
+ * FIXED: Remove Span APIs for attributes and events
9
+
3
10
  ### v1.6.0 / 2025-08-14
4
11
 
5
12
  - ADDED: Add noop methods on Trace::Span for `attributes` and `events`
@@ -78,18 +78,6 @@ module OpenTelemetry
78
78
  self
79
79
  end
80
80
 
81
- # Retrieve attributes
82
- #
83
- # Note that the OpenTelemetry project
84
- # {https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
85
- # documents} certain "standard attributes" that have prescribed semantic
86
- # meanings.
87
- #
88
- # @return [hash] returns empty hash
89
- def attributes
90
- {}
91
- end
92
-
93
81
  # Add a link to a {Span}.
94
82
  #
95
83
  # Adding links at span creation using the `links` option is preferred
@@ -135,18 +123,6 @@ module OpenTelemetry
135
123
  self
136
124
  end
137
125
 
138
- # Retrieve events
139
- #
140
- # Note that the OpenTelemetry project
141
- # {https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
142
- # documents} certain "standard event names and keys" which have
143
- # prescribed semantic meanings.
144
- #
145
- # @return [array] returns empty array
146
- def events
147
- []
148
- end
149
-
150
126
  # Record an exception during the execution of this span. Multiple exceptions
151
127
  # can be recorded on a span.
152
128
  #
@@ -31,12 +31,12 @@ module OpenTelemetry
31
31
  #
32
32
  # @yield [span, context] yields the newly created span and a context containing the
33
33
  # span to the block.
34
- def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
34
+ def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil, record_exception: true)
35
35
  span = nil
36
36
  span = start_span(name, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind)
37
37
  Trace.with_span(span) { |s, c| yield s, c }
38
38
  rescue Exception => e # rubocop:disable Lint/RescueException
39
- span&.record_exception(e)
39
+ span&.record_exception(e) if record_exception
40
40
  span&.status = Status.error("Unhandled exception of type: #{e.class}")
41
41
  raise e
42
42
  ensure
@@ -58,10 +58,13 @@ module OpenTelemetry
58
58
  def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
59
59
  span = OpenTelemetry::Trace.current_span(with_parent)
60
60
 
61
- if span.context.valid?
62
- span
61
+ if span.recording?
62
+ OpenTelemetry::Trace.non_recording_span(span.context)
63
63
  else
64
- Span::INVALID
64
+ # Either the span is valid and non-recording, in which case we return it,
65
+ # or there was no span in the Context and Trace.current_span returned Span::INVALID,
66
+ # which is what we're supposed to return.
67
+ span
65
68
  end
66
69
  end
67
70
  end
@@ -6,5 +6,5 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  ## Current OpenTelemetry version
9
- VERSION = '1.6.0'
9
+ VERSION = '1.7.0'
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.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: 2025-08-14 00:00:00.000000000 Z
11
+ date: 2025-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ipsa
@@ -215,10 +215,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
215
215
  licenses:
216
216
  - Apache-2.0
217
217
  metadata:
218
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.6.0/file.CHANGELOG.html
218
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.7.0/file.CHANGELOG.html
219
219
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/api
220
220
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
221
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.6.0
221
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.7.0
222
222
  post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths: