opentelemetry-sdk 1.5.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 +4 -0
- data/README.md +9 -4
- data/lib/opentelemetry/sdk/configurator.rb +12 -2
- data/lib/opentelemetry/sdk/trace/span.rb +3 -0
- data/lib/opentelemetry/sdk/trace/span_limits.rb +0 -1
- data/lib/opentelemetry/sdk/trace/span_processor.rb +18 -0
- data/lib/opentelemetry/sdk/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3ba5bcaae681a8f24969dd8aa7d886e0d1b57b3c26d46ef71bc2724bf5e7fe4
|
|
4
|
+
data.tar.gz: 1d41a63a92487100a7f6a0e5fd74a18c92a7d9adf744ee561cc43e8def5c288b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6e3c2646902e1adb9efa33ab7d20b6d0a572c03e077a03b6cc13c1b94d95c2f41bcd1235b60f251384f9cd303fc49c4e3b88c2a6d6654e1de8b2356b3be6212
|
|
7
|
+
data.tar.gz: 6729117a513daecc2d6f2e09de4601ca77777c51d0b110e3d4eea7a4365bcb1dffef201f529acb3479b20299e840154276fa2e50fd87871c575d7c859d36d848
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -12,13 +12,19 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se
|
|
|
12
12
|
|
|
13
13
|
The `opentelemetry-sdk` gem provides the reference implementation of the OpenTelemetry Ruby interfaces defined in the `opentelemetry-api` gem. That is, it includes the *functionality* needed to collect, analyze, and export telemetry data produced using the API.
|
|
14
14
|
|
|
15
|
-
Generally, Ruby *applications* should install `opentelemetry-sdk` (or
|
|
15
|
+
Generally, Ruby *applications* should install `opentelemetry-sdk` (or
|
|
16
|
+
other concrete implementation of the OpenTelemetry API). Using the SDK,
|
|
17
|
+
an application can configure how it wants telemetry data to be handled,
|
|
18
|
+
including which data should be persisted, how it should be formatted,
|
|
19
|
+
and where it should be recorded or exported. However, *libraries* that
|
|
20
|
+
produce telemetry data should generally depend only on
|
|
21
|
+
`opentelemetry-api`, deferring the choice of concrete implementation to the application developer.
|
|
16
22
|
|
|
17
23
|
## How do I get started?
|
|
18
24
|
|
|
19
25
|
Install the gem using:
|
|
20
26
|
|
|
21
|
-
```
|
|
27
|
+
```sh
|
|
22
28
|
gem install opentelemetry-sdk
|
|
23
29
|
```
|
|
24
30
|
|
|
@@ -53,7 +59,7 @@ OpenTelemetry::SDK.configure
|
|
|
53
59
|
# c.use 'OpenTelemetry::Instrumentation::Net::HTTP'
|
|
54
60
|
# end
|
|
55
61
|
#
|
|
56
|
-
# Note that the
|
|
62
|
+
# Note that the SimpleSpanProcessor is not recommended for use in production.
|
|
57
63
|
|
|
58
64
|
|
|
59
65
|
# To start a trace you need to get a Tracer from the TracerProvider
|
|
@@ -85,7 +91,6 @@ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special int
|
|
|
85
91
|
|
|
86
92
|
The `opentelemetry-sdk` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
|
|
87
93
|
|
|
88
|
-
|
|
89
94
|
[opentelemetry-home]: https://opentelemetry.io
|
|
90
95
|
[bundler-home]: https://bundler.io
|
|
91
96
|
[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
|
|
@@ -90,7 +90,7 @@ module OpenTelemetry
|
|
|
90
90
|
)
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
# Install an instrumentation with
|
|
93
|
+
# Install an instrumentation with specified optional +config+.
|
|
94
94
|
# Use can be called multiple times to install multiple instrumentation.
|
|
95
95
|
# Only +use+ or +use_all+, but not both when installing
|
|
96
96
|
# instrumentation. A call to +use_all+ after +use+ will result in an
|
|
@@ -126,13 +126,20 @@ module OpenTelemetry
|
|
|
126
126
|
@span_processors << span_processor
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
+
# Add a log record processor to the export pipeline
|
|
130
|
+
#
|
|
131
|
+
# @param [#emit, #shutdown, #force_flush] log_record_processor A log_record_processor
|
|
132
|
+
# that satisfies the duck type #emit, #shutdown, #force_flush. See
|
|
133
|
+
# {SimpleLogRecordProcessor} for an example.
|
|
134
|
+
def add_log_record_processor(log_record_processor); end
|
|
135
|
+
|
|
129
136
|
# @api private
|
|
130
137
|
# The configure method is where we define the setup process. This allows
|
|
131
138
|
# us to make certain guarantees about which systems and globals are setup
|
|
132
139
|
# at each stage. The setup process is:
|
|
133
140
|
# - setup logging
|
|
134
141
|
# - setup propagation
|
|
135
|
-
# - setup tracer_provider and
|
|
142
|
+
# - setup tracer_provider, meter_provider, and logger_provider
|
|
136
143
|
# - install instrumentation
|
|
137
144
|
def configure
|
|
138
145
|
OpenTelemetry.logger = logger
|
|
@@ -142,6 +149,7 @@ module OpenTelemetry
|
|
|
142
149
|
tracer_provider.id_generator = @id_generator
|
|
143
150
|
OpenTelemetry.tracer_provider = tracer_provider
|
|
144
151
|
metrics_configuration_hook
|
|
152
|
+
logs_configuration_hook
|
|
145
153
|
install_instrumentation
|
|
146
154
|
end
|
|
147
155
|
|
|
@@ -149,6 +157,8 @@ module OpenTelemetry
|
|
|
149
157
|
|
|
150
158
|
def metrics_configuration_hook; end
|
|
151
159
|
|
|
160
|
+
def logs_configuration_hook; end
|
|
161
|
+
|
|
152
162
|
def tracer_provider
|
|
153
163
|
@tracer_provider ||= Trace::TracerProvider.new(resource: @resource)
|
|
154
164
|
end
|
|
@@ -271,6 +271,9 @@ module OpenTelemetry
|
|
|
271
271
|
return self
|
|
272
272
|
end
|
|
273
273
|
@end_timestamp = relative_timestamp(end_timestamp)
|
|
274
|
+
@span_processors.each do |processor|
|
|
275
|
+
processor.on_finishing(self) if processor.respond_to?(:on_finishing)
|
|
276
|
+
end
|
|
274
277
|
@attributes = validated_attributes(@attributes).freeze
|
|
275
278
|
@events.freeze
|
|
276
279
|
@links.freeze
|
|
@@ -41,7 +41,6 @@ module OpenTelemetry
|
|
|
41
41
|
event_attribute_count_limit: Integer(OpenTelemetry::Common::Utilities.config_opt('OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT', default: 128)),
|
|
42
42
|
event_attribute_length_limit: OpenTelemetry::Common::Utilities.config_opt('OTEL_EVENT_ATTRIBUTE_VALUE_LENGTH_LIMIT', 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT'),
|
|
43
43
|
link_attribute_count_limit: Integer(OpenTelemetry::Common::Utilities.config_opt('OTEL_LINK_ATTRIBUTE_COUNT_LIMIT', default: 128)))
|
|
44
|
-
|
|
45
44
|
raise ArgumentError, 'attribute_count_limit must be positive' unless attribute_count_limit.positive?
|
|
46
45
|
raise ArgumentError, 'attribute_length_limit must not be less than 32' unless attribute_length_limit.nil? || Integer(attribute_length_limit) >= 32
|
|
47
46
|
raise ArgumentError, 'event_count_limit must be positive' unless event_count_limit.positive?
|
|
@@ -23,6 +23,24 @@ module OpenTelemetry
|
|
|
23
23
|
# started span.
|
|
24
24
|
def on_start(span, parent_context); end
|
|
25
25
|
|
|
26
|
+
# The on_finishing method is an experimental feature and may have breaking changes.
|
|
27
|
+
# The OpenTelemetry specification defines it as "On Ending". As `end` is a reserved
|
|
28
|
+
# keyword in Ruby, we are using `on_finishing` instead.
|
|
29
|
+
#
|
|
30
|
+
# Called when a {Span} is ending, after the end timestamp has been set
|
|
31
|
+
# but before span becomes immutable. This allows for updating the span
|
|
32
|
+
# by setting attributes or adding links and events.
|
|
33
|
+
#
|
|
34
|
+
# This method is called synchronously and should not block the current
|
|
35
|
+
# thread nor throw exceptions.
|
|
36
|
+
#
|
|
37
|
+
# This method is optional on the Span Processor interface. It will only
|
|
38
|
+
# get called if it exists within the processor.
|
|
39
|
+
#
|
|
40
|
+
# @param [Span] span the {Span} that just is ending (still mutable).
|
|
41
|
+
# @return [void]
|
|
42
|
+
def on_finishing(span); end
|
|
43
|
+
|
|
26
44
|
# Called when a {Span} is ended, if the {Span#recording?}
|
|
27
45
|
# returns true.
|
|
28
46
|
#
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentelemetry-sdk
|
|
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
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-12-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: opentelemetry-api
|
|
@@ -184,14 +184,14 @@ dependencies:
|
|
|
184
184
|
requirements:
|
|
185
185
|
- - "~>"
|
|
186
186
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 1.
|
|
187
|
+
version: '1.65'
|
|
188
188
|
type: :development
|
|
189
189
|
prerelease: false
|
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
191
|
requirements:
|
|
192
192
|
- - "~>"
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: 1.
|
|
194
|
+
version: '1.65'
|
|
195
195
|
- !ruby/object:Gem::Dependency
|
|
196
196
|
name: simplecov
|
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -294,10 +294,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
|
294
294
|
licenses:
|
|
295
295
|
- Apache-2.0
|
|
296
296
|
metadata:
|
|
297
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.
|
|
297
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.6.0/file.CHANGELOG.html
|
|
298
298
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/sdk
|
|
299
299
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
|
300
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.
|
|
300
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.6.0
|
|
301
301
|
post_install_message:
|
|
302
302
|
rdoc_options: []
|
|
303
303
|
require_paths:
|