opentelemetry-sdk 1.12.1 → 1.13.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/lib/opentelemetry/sdk/configurator.rb +3 -3
- data/lib/opentelemetry/sdk/instrumentation_scope.rb +2 -1
- data/lib/opentelemetry/sdk/internal.rb +1 -1
- data/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb +2 -0
- data/lib/opentelemetry/sdk/trace/span.rb +2 -2
- data/lib/opentelemetry/sdk/trace/tracer.rb +6 -4
- data/lib/opentelemetry/sdk/trace/tracer_provider.rb +23 -8
- data/lib/opentelemetry/sdk/version.rb +1 -1
- data/lib/opentelemetry/sdk.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d263c7e1224cad3b9e7a9ac1fc958dae76c9bc9788df4dde53b56d5603cfd22e
|
|
4
|
+
data.tar.gz: e2a8d6e023dfbc277b37bd0df76a4903adab343e3b3be2173a6943806141904d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '088ced3e6d379e35df9790f999287ecca88c2f79ac7b4c8bdf162c89e8e19bca49bebd1d084ff4dfe872e2d70aaad1b0c8dd1c11e0e1686fd297b05d42f3435f'
|
|
7
|
+
data.tar.gz: 7b1c670d348ba097b8721c3b30843ceb693d62985e8e798d9589e87792d85388c7d32cd2c618c90317f53a780f2199a6916b07fc817456fec3c0c431f90e442e
|
data/CHANGELOG.md
CHANGED
|
@@ -190,11 +190,11 @@ module OpenTelemetry
|
|
|
190
190
|
when 'otlp'
|
|
191
191
|
otlp_protocol = ENV['OTEL_EXPORTER_OTLP_TRACES_PROTOCOL'] || ENV['OTEL_EXPORTER_OTLP_PROTOCOL'] || 'http/protobuf'
|
|
192
192
|
|
|
193
|
-
if otlp_protocol
|
|
193
|
+
if otlp_protocol == 'http/protobuf'
|
|
194
|
+
fetch_exporter(exporter, 'OpenTelemetry::Exporter::OTLP::Exporter')
|
|
195
|
+
else
|
|
194
196
|
OpenTelemetry.logger.warn "The #{otlp_protocol} transport protocol is not supported by the OTLP exporter, spans will not be exported."
|
|
195
197
|
nil
|
|
196
|
-
else
|
|
197
|
-
fetch_exporter(exporter, 'OpenTelemetry::Exporter::OTLP::Exporter')
|
|
198
198
|
end
|
|
199
199
|
when 'jaeger' then fetch_exporter(exporter, 'OpenTelemetry::Exporter::Jaeger::CollectorExporter')
|
|
200
200
|
when 'zipkin' then fetch_exporter(exporter, 'OpenTelemetry::Exporter::Zipkin::Exporter')
|
|
@@ -418,7 +418,7 @@ module OpenTelemetry
|
|
|
418
418
|
excess_link_count = valid_links.size - link_count_limit
|
|
419
419
|
valid_links.pop(excess_link_count) if excess_link_count.positive?
|
|
420
420
|
valid_links.map! do |link|
|
|
421
|
-
attrs =
|
|
421
|
+
attrs = link.attributes.to_h.dup # link.attributes is frozen, so we need an unfrozen copy to adjust.
|
|
422
422
|
attrs.keep_if { |key, value| Internal.valid_key?(key) && Internal.valid_value?(value) }
|
|
423
423
|
excess = attrs.size - link_attribute_count_limit
|
|
424
424
|
excess.times { attrs.shift } if excess.positive?
|
|
@@ -444,7 +444,7 @@ module OpenTelemetry
|
|
|
444
444
|
|
|
445
445
|
excess = event.attributes.size - event_attribute_count_limit
|
|
446
446
|
if excess.positive? || !valid_attributes
|
|
447
|
-
attrs =
|
|
447
|
+
attrs = event.attributes.to_h.dup # event.attributes is frozen, so we need an unfrozen copy to adjust.
|
|
448
448
|
attrs.keep_if { |key, value| Internal.valid_key?(key) && Internal.valid_value?(value) }
|
|
449
449
|
excess = attrs.size - event_attribute_count_limit
|
|
450
450
|
excess.times { attrs.shift } if excess.positive?
|
|
@@ -13,13 +13,15 @@ module OpenTelemetry
|
|
|
13
13
|
#
|
|
14
14
|
# Returns a new {Tracer} instance.
|
|
15
15
|
#
|
|
16
|
-
# @param [String] name Instrumentation
|
|
17
|
-
# @param [String] version Instrumentation
|
|
16
|
+
# @param [String] name Instrumentation scope name
|
|
17
|
+
# @param [String] version Instrumentation scope version
|
|
18
18
|
# @param [TracerProvider] tracer_provider TracerProvider that initialized the tracer
|
|
19
|
+
# @param [Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}] attributes
|
|
20
|
+
# Instrumentation scope attributes
|
|
19
21
|
#
|
|
20
22
|
# @return [Tracer]
|
|
21
|
-
def initialize(name, version, tracer_provider)
|
|
22
|
-
@instrumentation_scope = InstrumentationScope.new(name, version)
|
|
23
|
+
def initialize(name, version, tracer_provider, attributes: nil)
|
|
24
|
+
@instrumentation_scope = InstrumentationScope.new(name, version, attributes || {}.freeze)
|
|
23
25
|
@tracer_provider = tracer_provider
|
|
24
26
|
end
|
|
25
27
|
|
|
@@ -9,8 +9,10 @@ module OpenTelemetry
|
|
|
9
9
|
module Trace
|
|
10
10
|
# {TracerProvider} is the SDK implementation of {OpenTelemetry::Trace::TracerProvider}.
|
|
11
11
|
class TracerProvider < OpenTelemetry::Trace::TracerProvider # rubocop:disable Metrics/ClassLength
|
|
12
|
-
Key = Struct.new(:name, :version)
|
|
13
|
-
|
|
12
|
+
Key = Struct.new(:name, :version, :attributes)
|
|
13
|
+
EMPTY_ATTRIBUTES = {}.freeze
|
|
14
|
+
|
|
15
|
+
private_constant(:Key, :EMPTY_ATTRIBUTES)
|
|
14
16
|
|
|
15
17
|
attr_accessor :span_limits, :id_generator, :sampler
|
|
16
18
|
attr_reader :resource
|
|
@@ -44,15 +46,28 @@ module OpenTelemetry
|
|
|
44
46
|
|
|
45
47
|
# Returns a {Tracer} instance.
|
|
46
48
|
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
+
# Supports both positional arguments (legacy) and keyword arguments:
|
|
50
|
+
# tracer('name', '1.0') # legacy positional
|
|
51
|
+
# tracer(name: 'name', version: '1.0', attributes: {...}) # keyword
|
|
52
|
+
#
|
|
53
|
+
# When both positional and keyword arguments are provided for the same
|
|
54
|
+
# parameter, the keyword argument takes precedence.
|
|
55
|
+
#
|
|
56
|
+
# @param [String] name Instrumentation scope name
|
|
57
|
+
# @param [String] version Instrumentation scope version
|
|
58
|
+
# @param [Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}] attributes
|
|
59
|
+
# Instrumentation scope attributes
|
|
49
60
|
#
|
|
50
61
|
# @return [Tracer]
|
|
51
|
-
def tracer(
|
|
52
|
-
name ||= ''
|
|
53
|
-
version ||= ''
|
|
62
|
+
def tracer(deprecated_name = nil, deprecated_version = nil, name: nil, version: nil, attributes: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
63
|
+
name ||= deprecated_name || ''
|
|
64
|
+
version ||= deprecated_version || ''
|
|
65
|
+
attributes = attributes&.dup&.freeze || EMPTY_ATTRIBUTES
|
|
54
66
|
OpenTelemetry.logger.warn 'calling TracerProvider#tracer without providing a tracer name.' if name.empty?
|
|
55
|
-
@registry_mutex.synchronize
|
|
67
|
+
@registry_mutex.synchronize do
|
|
68
|
+
@registry[Key.new(name, version, attributes)] ||=
|
|
69
|
+
Tracer.new(name, version, self, attributes: attributes)
|
|
70
|
+
end
|
|
56
71
|
end
|
|
57
72
|
|
|
58
73
|
# Attempts to stop all the activity for this {TracerProvider}. Calls
|
data/lib/opentelemetry/sdk.rb
CHANGED
|
@@ -23,7 +23,7 @@ module OpenTelemetry
|
|
|
23
23
|
# ConfigurationError is an exception type used to wrap configuration errors
|
|
24
24
|
# passed to OpenTelemetry.error_handler. This can be used to distinguish
|
|
25
25
|
# errors reported during SDK configuration.
|
|
26
|
-
ConfigurationError = Class.new(OpenTelemetry::Error)
|
|
26
|
+
ConfigurationError = Class.new(OpenTelemetry::Error) # rubocop:disable Style/EmptyClassDefinition
|
|
27
27
|
|
|
28
28
|
# Configures SDK and instrumentation
|
|
29
29
|
#
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentelemetry-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenTelemetry Authors
|
|
@@ -125,10 +125,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
|
125
125
|
licenses:
|
|
126
126
|
- Apache-2.0
|
|
127
127
|
metadata:
|
|
128
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.
|
|
129
|
-
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-sdk/v1.
|
|
128
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.13.0/file/CHANGELOG.md
|
|
129
|
+
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-sdk/v1.13.0/sdk
|
|
130
130
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
|
131
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.
|
|
131
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.13.0
|
|
132
132
|
rdoc_options: []
|
|
133
133
|
require_paths:
|
|
134
134
|
- lib
|
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
144
|
version: '0'
|
|
145
145
|
requirements: []
|
|
146
|
-
rubygems_version: 4.0.
|
|
146
|
+
rubygems_version: 4.0.16
|
|
147
147
|
specification_version: 4
|
|
148
148
|
summary: A stats collection and distributed tracing framework
|
|
149
149
|
test_files: []
|