opentelemetry-api 1.4.0 → 1.6.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 +4 -4
- data/CHANGELOG.md +96 -84
- data/README.md +1 -2
- data/lib/opentelemetry/context.rb +7 -8
- data/lib/opentelemetry/trace/span.rb +24 -0
- data/lib/opentelemetry/trace/tracer.rb +1 -1
- data/lib/opentelemetry/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d906385f921e5a001d2a55b62de37ecfc2ff0bb250ca5dae4e7a8b1d743059d
|
4
|
+
data.tar.gz: ac3aac34b4f235135611bd32915575e53d99fc10c16677b93032543390563af4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0308c3366ce2430ee93ae3a78dfa75b704c4ab5f043fc053071b81b181ed72ea89199bad78b44bdc12b7d260d57aeec2d0331e73fcc88da7b7f2b2f48e365de9'
|
7
|
+
data.tar.gz: 7a2d69028ea2e4d816947490d9053c7864608c8d5a55a616f8c0b2f2a79d7d50e9449d833e99ee94d24477c1a12de583a695c6c2731c0b17f9c87016e39e70d4
|
data/CHANGELOG.md
CHANGED
@@ -1,188 +1,200 @@
|
|
1
1
|
# Release History: opentelemetry-api
|
2
2
|
|
3
|
+
### v1.6.0 / 2025-08-14
|
4
|
+
|
5
|
+
- ADDED: Add noop methods on Trace::Span for `attributes` and `events`
|
6
|
+
|
7
|
+
### v1.5.0 / 2025-02-20
|
8
|
+
|
9
|
+
- ADDED: Support 3.1 Min Version
|
10
|
+
- FIXED: Use a Fiber attribute for Context
|
11
|
+
|
3
12
|
### v1.4.0 / 2024-08-27
|
4
13
|
|
5
|
-
|
14
|
+
- ADDED: Include backtrace first line for better debug info
|
6
15
|
|
7
16
|
### v1.3.0 / 2024-07-24
|
8
17
|
|
9
|
-
|
18
|
+
- ADDED: Add add_link to span api/sdk
|
10
19
|
|
11
20
|
### v1.2.5 / 2024-02-20
|
12
21
|
|
13
|
-
|
22
|
+
- FIXED: Replace Context stack on clear
|
14
23
|
|
15
24
|
### v1.2.4 / 2024-02-06
|
16
25
|
|
17
|
-
|
26
|
+
- FIXED: SystemStackError in Composite Text Map Propagator (#1590)
|
18
27
|
|
19
28
|
### v1.2.3 / 2023-09-18
|
20
29
|
|
21
|
-
|
22
|
-
|
30
|
+
- FIXED: Optimize span and trace ID generation
|
31
|
+
- FIXED: Small perf improvement to generate_r
|
23
32
|
|
24
33
|
### v1.2.2 / 2023-08-15
|
25
34
|
|
26
|
-
|
27
|
-
|
28
|
-
|
35
|
+
- FIXED: Patch the issue for frozen string on ruby < 3.0 with string interpolation
|
36
|
+
- FIXED: Performance regression in_span
|
37
|
+
- FIXED: In_span performance
|
29
38
|
|
30
39
|
### v1.2.1 / 2023-07-29
|
31
40
|
|
32
|
-
|
41
|
+
- DOCS: Describe Tracer#in_span arguments
|
33
42
|
|
34
43
|
### v1.2.0 / 2023-06-08
|
35
44
|
|
36
|
-
|
45
|
+
- BREAKING CHANGE: Remove support for EoL Ruby 2.7
|
37
46
|
|
38
|
-
|
47
|
+
- ADDED: Remove support for EoL Ruby 2.7
|
39
48
|
|
40
49
|
### v1.1.0 / 2022-09-14
|
41
50
|
|
42
|
-
|
43
|
-
|
51
|
+
- ADDED: Consistent probability sampler
|
52
|
+
- FIXED: Get API onto rubocop 1.3
|
44
53
|
|
45
54
|
### v1.0.2 / 2022-05-02
|
46
55
|
|
47
|
-
|
56
|
+
- FIXED: Text map propagator extraction should use argument context
|
48
57
|
|
49
58
|
### v1.0.1 / 2021-12-01
|
50
59
|
|
51
|
-
|
60
|
+
- FIXED: Deprecate api rack env getter
|
52
61
|
|
53
62
|
### v1.0.0 / 2021-09-29
|
54
63
|
|
55
|
-
|
64
|
+
- (No significant changes)
|
56
65
|
|
57
66
|
### v1.0.0.rc3 / 2021-08-12
|
58
67
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
- BREAKING CHANGE: Remove optional parent_context from in_span
|
69
|
+
- BREAKING CHANGE: Refactor Baggage to remove Noop\*
|
70
|
+
- BREAKING CHANGE: Total order constraint on span.status=
|
71
|
+
|
72
|
+
- ADDED: Add Tracer.non_recording_span to API
|
73
|
+
- ADDED: Make API's NoopTextMapPropagator private
|
74
|
+
- FIXED: Remove optional parent_context from in_span
|
75
|
+
- FIXED: Reduce span allocation in API
|
76
|
+
- FIXED: Refactor Baggage to remove Noop\*
|
77
|
+
- FIXED: Total order constraint on span.status=
|
78
|
+
- FIXED: Return early if carrier is nil
|
79
|
+
- FIXED: Update context to match spec
|
80
|
+
- FIXED: Return the original context if the baggage header value is empty
|
81
|
+
- DOCS: Update docs to rely more on environment variable configuration
|
73
82
|
|
74
83
|
### v1.0.0.rc2 / 2021-06-23
|
75
84
|
|
76
|
-
|
77
|
-
|
85
|
+
- BREAKING CHANGE: Remove optional parent_context from in_span [729](https://github.com/open-telemetry/opentelemetry-ruby/pull/729)
|
86
|
+
- BREAKING CHANGE: Refactor Baggage to remove Noop\* [800](https://github.com/open-telemetry/opentelemetry-ruby/pull/800)
|
78
87
|
- The noop baggage manager has been removed.
|
79
88
|
- The baggage management methods are now available through OpenTelemetry::Baggage#method, previously OpenTelemetry.baggage#method
|
80
|
-
|
89
|
+
- BREAKING CHANGE: Total order constraint on span.status= [805](https://github.com/open-telemetry/opentelemetry-ruby/pull/805)
|
90
|
+
|
81
91
|
- The OpenTelemetry::Trace::Util::HttpToStatus module has been removed as it was incorrectly setting the span status to OK for codes codes in the range 100..399
|
82
92
|
- The HttpToStatus module can be replaced inline as follows `span.status = OpenTelemetry::Trace::Status.error unless (100..399).include?(response_code.to_i)`
|
83
93
|
- The `Status.new(code, description:)` initializer has been hidden in favour of simpler constructors for each status code: `Status.ok`, `Status.error` and `Status.unset`. Each constructor takes an optional description.
|
84
94
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
95
|
+
- ADDED: Add Tracer.non_recording_span to API [799](https://github.com/open-telemetry/opentelemetry-ruby/pull/799)
|
96
|
+
- FIXED: Reduce span allocation in API [795](https://github.com/open-telemetry/opentelemetry-ruby/pull/795)
|
97
|
+
- FIXED: Return early if carrier is nil [835](https://github.com/open-telemetry/opentelemetry-ruby/pull/835)
|
98
|
+
- FIXED: Update context to match spec [807](https://github.com/open-telemetry/opentelemetry-ruby/pull/807)
|
89
99
|
- The `Context.current` setter has been removed and the previously private attach/detach methods are now available as class methods on the context module.
|
90
100
|
|
91
101
|
### v1.0.0.rc1 / 2021-05-21
|
92
102
|
|
93
|
-
|
103
|
+
- BREAKING CHANGE: Remove optional parent_context from in_span
|
94
104
|
|
95
|
-
|
105
|
+
- FIXED: Remove optional parent_context from in_span
|
96
106
|
|
97
107
|
### v0.17.0 / 2021-04-22
|
98
108
|
|
99
|
-
|
109
|
+
- BREAKING CHANGE: Replace TextMapInjector/TextMapExtractor pairs with a TextMapPropagator.
|
100
110
|
|
101
111
|
[Check the propagator documentation](https://open-telemetry.github.io/opentelemetry-ruby/) for the new usage.
|
102
|
-
|
112
|
+
|
113
|
+
- BREAKING CHANGE: Remove metrics API.
|
103
114
|
|
104
115
|
`OpenTelemetry::Metrics` and all of its behavior removed until spec stabilizes.
|
105
|
-
|
116
|
+
|
117
|
+
- BREAKING CHANGE: Extract instrumentation base from api (#698).
|
106
118
|
|
107
119
|
To take advantage of a base instrumentation class to create your own auto-instrumentation, require and use the `opentelemetry-instrumentation-base` gem.
|
108
120
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
121
|
+
- ADDED: Default noop tracer for instrumentation
|
122
|
+
- FIXED: Refactor propagators to add #fields
|
123
|
+
- FIXED: Remove metrics API
|
124
|
+
- FIXED: Dynamically upgrade global tracer provider
|
113
125
|
|
114
126
|
### v0.16.0 / 2021-03-17
|
115
127
|
|
116
|
-
|
117
|
-
|
118
|
-
|
128
|
+
- ADDED: Span#add_attributes
|
129
|
+
- FIXED: Handle rack env getter edge cases
|
130
|
+
- DOCS: Replace Gitter with GitHub Discussions
|
119
131
|
|
120
132
|
### v0.15.0 / 2021-02-18
|
121
133
|
|
122
|
-
|
123
|
-
|
134
|
+
- ADDED: Add instrumentation config validation
|
135
|
+
- DOCS: Clarify nil attribute values not allowed
|
124
136
|
|
125
137
|
### v0.14.0 / 2021-02-03
|
126
138
|
|
127
|
-
|
139
|
+
- BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
|
128
140
|
|
129
|
-
|
141
|
+
- ADDED: Replace getter and setter callables and remove rack specific propagators
|
130
142
|
|
131
143
|
### v0.13.0 / 2021-01-29
|
132
144
|
|
133
|
-
|
134
|
-
|
145
|
+
- ADDED: Add optional attributes to record_exception
|
146
|
+
- FIXED: Small test fixes.
|
135
147
|
|
136
148
|
### v0.12.1 / 2021-01-13
|
137
149
|
|
138
|
-
|
150
|
+
- FIXED: Eliminate warning about Random::DEFAULT on Ruby 3.0
|
139
151
|
|
140
152
|
### v0.12.0 / 2020-12-24
|
141
153
|
|
142
|
-
|
154
|
+
- ADDED: Structured error handling
|
143
155
|
|
144
156
|
### v0.11.0 / 2020-12-11
|
145
157
|
|
146
|
-
|
158
|
+
- BREAKING CHANGE: Implement tracestate
|
147
159
|
|
148
|
-
|
149
|
-
|
150
|
-
|
160
|
+
- ADDED: Implement tracestate
|
161
|
+
- FIXED: Missing white space from install messages
|
162
|
+
- FIXED: Copyright comments to not reference year
|
151
163
|
|
152
164
|
### v0.10.0 / 2020-12-03
|
153
165
|
|
154
|
-
|
166
|
+
- (No significant changes)
|
155
167
|
|
156
168
|
### v0.9.0 / 2020-11-27
|
157
169
|
|
158
|
-
|
170
|
+
- (No significant changes)
|
159
171
|
|
160
172
|
### v0.8.0 / 2020-10-27
|
161
173
|
|
162
|
-
|
163
|
-
|
164
|
-
|
174
|
+
- BREAKING CHANGE: Move context/span methods to Trace module
|
175
|
+
- BREAKING CHANGE: Remove 'canonical' from status codes
|
176
|
+
- BREAKING CHANGE: Assorted SpanContext fixes
|
165
177
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
178
|
+
- ADDED: B3 support
|
179
|
+
- FIXED: Move context/span methods to Trace module
|
180
|
+
- FIXED: Remove 'canonical' from status codes
|
181
|
+
- FIXED: Assorted SpanContext fixes
|
170
182
|
|
171
183
|
### v0.7.0 / 2020-10-07
|
172
184
|
|
173
|
-
|
174
|
-
|
175
|
-
|
185
|
+
- FIXED: Safely navigate span variable during error cases
|
186
|
+
- DOCS: Standardize toplevel docs structure and readme
|
187
|
+
- DOCS: Fix param description in TextMapInjector for Baggage
|
176
188
|
|
177
189
|
### v0.6.0 / 2020-09-10
|
178
190
|
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
191
|
+
- ADDED: Add support for OTEL_LOG_LEVEL env var
|
192
|
+
- Documented array valued attributes [#343](https://github.com/open-telemetry/opentelemetry-ruby/pull/343)
|
193
|
+
- Renamed CorrelationContext to Baggage [#338](https://github.com/open-telemetry/opentelemetry-ruby/pull/338)
|
194
|
+
- Renamed Text* to TextMap* (propagators) [#335](https://github.com/open-telemetry/opentelemetry-ruby/pull/335)
|
195
|
+
- Fixed exception semantic conventions (`span.record_error` -> `span.record_exception`) [#333](https://github.com/open-telemetry/opentelemetry-ruby/pull/333)
|
196
|
+
- Removed support for lazy event creation [#329](https://github.com/open-telemetry/opentelemetry-ruby/pull/329)
|
197
|
+
- `name:` named parameter to `span.add_event` becomes first positional argument
|
198
|
+
- `Event` class removed from API
|
199
|
+
- Added `hex_trace_id` and `hex_span_id` helpers to `SpanContext` [#332](https://github.com/open-telemetry/opentelemetry-ruby/pull/332)
|
200
|
+
- Added `CorrelationContext::Manager.values` method to return correlations as a `Hash` [#323](https://github.com/open-telemetry/opentelemetry-ruby/pull/323)
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ data should depend only on `opentelemetry-api`, deferring the choice of concrete
|
|
21
21
|
|
22
22
|
Install the gem using:
|
23
23
|
|
24
|
-
```
|
24
|
+
```sh
|
25
25
|
gem install opentelemetry-api
|
26
26
|
```
|
27
27
|
|
@@ -58,7 +58,6 @@ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special int
|
|
58
58
|
|
59
59
|
The `opentelemetry-api` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
|
60
60
|
|
61
|
-
|
62
61
|
[opentelemetry-home]: https://opentelemetry.io
|
63
62
|
[bundler-home]: https://bundler.io
|
64
63
|
[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
|
@@ -7,12 +7,13 @@
|
|
7
7
|
require 'opentelemetry/context/key'
|
8
8
|
require 'opentelemetry/context/propagation'
|
9
9
|
|
10
|
-
module OpenTelemetry
|
10
|
+
module OpenTelemetry # rubocop:disable Style/Documentation
|
11
|
+
Fiber.attr_accessor :opentelemetry_context
|
12
|
+
|
11
13
|
# Manages context on a per-fiber basis
|
12
14
|
class Context
|
13
15
|
EMPTY_ENTRIES = {}.freeze
|
14
|
-
|
15
|
-
private_constant :EMPTY_ENTRIES, :STACK_KEY
|
16
|
+
private_constant :EMPTY_ENTRIES
|
16
17
|
|
17
18
|
DetachError = Class.new(OpenTelemetry::Error)
|
18
19
|
|
@@ -113,11 +114,9 @@ module OpenTelemetry
|
|
113
114
|
current.value(key)
|
114
115
|
end
|
115
116
|
|
116
|
-
# Clears the fiber-local Context stack.
|
117
|
-
# stack, which is important in some use-cases to avoid sharing the backing
|
118
|
-
# array between fibers.
|
117
|
+
# Clears the fiber-local Context stack.
|
119
118
|
def clear
|
120
|
-
|
119
|
+
Fiber.current.opentelemetry_context = []
|
121
120
|
end
|
122
121
|
|
123
122
|
def empty
|
@@ -127,7 +126,7 @@ module OpenTelemetry
|
|
127
126
|
private
|
128
127
|
|
129
128
|
def stack
|
130
|
-
|
129
|
+
Fiber.current.opentelemetry_context ||= []
|
131
130
|
end
|
132
131
|
end
|
133
132
|
|
@@ -78,6 +78,18 @@ 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
|
+
|
81
93
|
# Add a link to a {Span}.
|
82
94
|
#
|
83
95
|
# Adding links at span creation using the `links` option is preferred
|
@@ -123,6 +135,18 @@ module OpenTelemetry
|
|
123
135
|
self
|
124
136
|
end
|
125
137
|
|
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
|
+
|
126
150
|
# Record an exception during the execution of this span. Multiple exceptions
|
127
151
|
# can be recorded on a span.
|
128
152
|
#
|
@@ -26,7 +26,7 @@ module OpenTelemetry
|
|
26
26
|
# @param attributes [optional Hash] attributes to attach to the span {String => String,
|
27
27
|
# Numeric, Boolean, Array<String, Numeric, Boolean>}
|
28
28
|
# @param links [optional Array] an array of OpenTelemetry::Trace::Link instances
|
29
|
-
# @param start_timestamp [optional
|
29
|
+
# @param start_timestamp [optional Time] timestamp to use as the start time of the span
|
30
30
|
# @param kind [optional Symbol] One of :internal, :server, :client, :producer, :consumer
|
31
31
|
#
|
32
32
|
# @yield [span, context] yields the newly created span and a context containing the
|
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.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ipsa
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.17'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: concurrent-ruby
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: faraday
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,11 +215,11 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
201
215
|
licenses:
|
202
216
|
- Apache-2.0
|
203
217
|
metadata:
|
204
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.
|
218
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.6.0/file.CHANGELOG.html
|
205
219
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/api
|
206
220
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
207
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.
|
208
|
-
post_install_message:
|
221
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.6.0
|
222
|
+
post_install_message:
|
209
223
|
rdoc_options: []
|
210
224
|
require_paths:
|
211
225
|
- lib
|
@@ -213,15 +227,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
227
|
requirements:
|
214
228
|
- - ">="
|
215
229
|
- !ruby/object:Gem::Version
|
216
|
-
version: '3.
|
230
|
+
version: '3.1'
|
217
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
232
|
requirements:
|
219
233
|
- - ">="
|
220
234
|
- !ruby/object:Gem::Version
|
221
235
|
version: '0'
|
222
236
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
224
|
-
signing_key:
|
237
|
+
rubygems_version: 3.3.27
|
238
|
+
signing_key:
|
225
239
|
specification_version: 4
|
226
240
|
summary: A stats collection and distributed tracing framework
|
227
241
|
test_files: []
|