opentelemetry-sdk 1.13.0 → 1.13.1

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: d263c7e1224cad3b9e7a9ac1fc958dae76c9bc9788df4dde53b56d5603cfd22e
4
- data.tar.gz: e2a8d6e023dfbc277b37bd0df76a4903adab343e3b3be2173a6943806141904d
3
+ metadata.gz: 96d1d6f8f41f39408208c7fa58c1ba8617bb9249106bf8391eeb266c2d38362e
4
+ data.tar.gz: 03b8f1119d65b37cbe3098407b46d0753adbbe52e634a328bfbd5565ab341a22
5
5
  SHA512:
6
- metadata.gz: '088ced3e6d379e35df9790f999287ecca88c2f79ac7b4c8bdf162c89e8e19bca49bebd1d084ff4dfe872e2d70aaad1b0c8dd1c11e0e1686fd297b05d42f3435f'
7
- data.tar.gz: 7b1c670d348ba097b8721c3b30843ceb693d62985e8e798d9589e87792d85388c7d32cd2c618c90317f53a780f2199a6916b07fc817456fec3c0c431f90e442e
6
+ metadata.gz: b2feacbff16ce07fcbbbda0e040d08c1eb8db2fec25804d8d9a849ed4597c2e4f7f64c5c3700cad5d6fbdfcd30ca3f397e5d3341d5e318b2f6c9a74aef8dd94a
7
+ data.tar.gz: 007725376c74f995289bc476a34905fb0a37334ebb86b370ad5631621a8558ae25dde2e8e693b3d04bf64b45c8cce170215fb55b4381b8f56f698ff7b511867f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-sdk
2
2
 
3
+ ### v1.13.1 / 2026-09-15
4
+
5
+ * DOCS: Document custom error handlers (#2264)
6
+
3
7
  ### v1.13.0 / 2026-07-21
4
8
 
5
9
  * ADDED: Add attributes support to instrumentation scope for tracers (#2094)
data/README.md CHANGED
@@ -97,5 +97,5 @@ The `opentelemetry-sdk` gem is distributed under the Apache 2.0 license. See [LI
97
97
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
98
98
  [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/examples
99
99
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
100
- [community-meetings]: https://github.com/open-telemetry/community#community-meetings
100
+ [community-meetings]: https://github.com/open-telemetry/community/blob/main/README.md#calendar
101
101
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -14,12 +14,15 @@ module OpenTelemetry
14
14
  EMPTY_LIST = [].freeze
15
15
  private_constant(:EMPTY_LIST)
16
16
 
17
+ # No-op because this propagator does not inject any values.
17
18
  def inject(carrier, context: Context.current, setter: Context::Propagation.text_map_setter); end
18
19
 
20
+ # Returns the passed context unchanged because there is nothing to extract.
19
21
  def extract(carrier, context: Context.current, getter: Context::Propagation.text_map_getter)
20
22
  context
21
23
  end
22
24
 
25
+ # Returns an empty list because this propagator does not use carrier fields.
23
26
  def fields
24
27
  EMPTY_LIST
25
28
  end
@@ -31,7 +34,7 @@ module OpenTelemetry
31
34
 
32
35
  private_constant :USE_MODE_UNSPECIFIED, :USE_MODE_ONE, :USE_MODE_ALL
33
36
 
34
- attr_writer :propagators, :error_handler, :id_generator
37
+ attr_writer :propagators, :id_generator
35
38
 
36
39
  def initialize
37
40
  @instrumentation_names = []
@@ -43,6 +46,7 @@ module OpenTelemetry
43
46
  @id_generator = OpenTelemetry::Trace
44
47
  end
45
48
 
49
+ # Returns the configured logger or the global OpenTelemetry logger.
46
50
  def logger
47
51
  @logger ||= OpenTelemetry.logger
48
52
  end
@@ -56,6 +60,26 @@ module OpenTelemetry
56
60
  @logger = ForwardingLogger.new(new_logger, level: ENV['OTEL_LOG_LEVEL'] || Logger::INFO)
57
61
  end
58
62
 
63
+ # Configures the error handler that will be installed on
64
+ # OpenTelemetry during SDK configuration.
65
+ #
66
+ # Assigned object must respond to +#call+ and accept the keyword
67
+ # arguments +exception:+ and +message:+.
68
+ #
69
+ # @param [#call] error_handler The error handler to install
70
+ #
71
+ # @example Configure a custom error handler during SDK setup
72
+ # OpenTelemetry::SDK.configure do |c|
73
+ # c.error_handler = lambda do |exception: nil, message: nil|
74
+ # OpenTelemetry.logger.warn("otel: #{[message, exception&.message].compact.join(' - ')}")
75
+ # end
76
+ # end
77
+ # rubocop:disable-next Style/TrivialAccessors
78
+ def error_handler=(error_handler)
79
+ @error_handler = error_handler
80
+ end
81
+
82
+ # Returns the configured error handler or the global OpenTelemetry error handler.
59
83
  def error_handler
60
84
  @error_handler ||= OpenTelemetry.error_handler
61
85
  end
@@ -13,9 +13,9 @@ module OpenTelemetry
13
13
  class << self
14
14
  private :new
15
15
 
16
- # Returns a newly created {Resource} with the specified attributes
16
+ # Returns a newly created Resource with the specified attributes
17
17
  #
18
- # @param [Hash{String => String, Numeric, Boolean} attributes Hash of key-value pairs to be used
18
+ # @param [Hash{String => String, Numeric, Boolean}] attributes Hash of key-value pairs to be used
19
19
  # as attributes for this resource
20
20
  # @raise [ArgumentError] If attribute keys and values are not strings
21
21
  # @return [Resource]
@@ -30,10 +30,16 @@ module OpenTelemetry
30
30
  new(frozen_attributes)
31
31
  end
32
32
 
33
+ # Returns the default Resource for the current process and SDK.
34
+ #
35
+ # @return [Resource]
33
36
  def default
34
37
  @default ||= create(SemanticConventions::Resource::SERVICE_NAME => 'unknown_service').merge(process).merge(telemetry_sdk).merge(service_name_from_env)
35
38
  end
36
39
 
40
+ # Returns a Resource describing this telemetry SDK.
41
+ #
42
+ # @return [Resource]
37
43
  def telemetry_sdk
38
44
  resource_attributes = {
39
45
  SemanticConventions::Resource::TELEMETRY_SDK_NAME => 'opentelemetry',
@@ -53,6 +59,9 @@ module OpenTelemetry
53
59
  create(resource_attributes)
54
60
  end
55
61
 
62
+ # Returns a Resource describing the current process.
63
+ #
64
+ # @return [Resource]
56
65
  def process
57
66
  resource_attributes = {
58
67
  SemanticConventions::Resource::PROCESS_PID => Process.pid,
@@ -75,7 +84,7 @@ module OpenTelemetry
75
84
 
76
85
  # @api private
77
86
  # The constructor is private and only for use internally by the class.
78
- # Users should use the {create} factory method to obtain a {Resource}
87
+ # Users should use the {create} factory method to obtain a Resource
79
88
  # instance.
80
89
  #
81
90
  # @param [Hash<String, String>] frozen_attributes Frozen-hash of frozen-string
@@ -85,15 +94,15 @@ module OpenTelemetry
85
94
  @attributes = frozen_attributes
86
95
  end
87
96
 
88
- # Returns an enumerator for attributes of this {Resource}
97
+ # Returns an enumerator for attributes of this Resource
89
98
  #
90
99
  # @return [Enumerator]
91
100
  def attribute_enumerator
92
101
  @attribute_enumerator ||= attributes.to_enum
93
102
  end
94
103
 
95
- # Returns a new, merged {Resource} by merging the current {Resource} with
96
- # the other {Resource}. In case of a collision, the other {Resource}
104
+ # Returns a new, merged Resource by merging the current Resource with
105
+ # the other Resource. In case of a collision, the other Resource
97
106
  # takes precedence
98
107
  #
99
108
  # @param [Resource] other The other resource to merge
@@ -210,11 +210,10 @@ module OpenTelemetry
210
210
  end
211
211
 
212
212
  def lock
213
- # rubocop:disable Style/ExplicitBlockArgument
213
+ # rubocop:disable-next Style/ExplicitBlockArgument
214
214
  @mutex.synchronize do
215
215
  yield
216
216
  end
217
- # rubocop:enable Style/ExplicitBlockArgument
218
217
  end
219
218
  end
220
219
  end
@@ -39,9 +39,8 @@ module OpenTelemetry
39
39
  private
40
40
 
41
41
  def sample?(trace_id)
42
- # rubocop:disable Lint/FloatComparison
42
+ # rubocop:disable-next Lint/FloatComparison
43
43
  @probability == 1.0 || trace_id[8, 8].unpack1('Q>') < @id_upper_bound
44
- # rubocop:enable Lint/FloatComparison
45
44
  end
46
45
  end
47
46
  end
@@ -14,7 +14,7 @@ module OpenTelemetry
14
14
  # Instrumentation should use the API provided by {OpenTelemetry::Trace::Span}
15
15
  # and should consider {Span} to be write-only.
16
16
  #
17
- # rubocop:disable Metrics/ClassLength
17
+ # rubocop:disable-next Metrics/ClassLength
18
18
  class Span < OpenTelemetry::Trace::Span
19
19
  DEFAULT_STATUS = OpenTelemetry::Trace::Status.unset
20
20
  EMPTY_ATTRIBUTES = {}.freeze
@@ -133,7 +133,7 @@ module OpenTelemetry
133
133
  # documents} certain "standard attributes" that have prescribed semantic
134
134
  # meanings.
135
135
  #
136
- # @param [OpenTelemetry::Trace::Link] the link object to add on the {Span}.
136
+ # @param [OpenTelemetry::Trace::Link] link The link object to add on the {Span}.
137
137
  #
138
138
  # @return [self] returns itself
139
139
  def add_link(link)
@@ -475,7 +475,6 @@ module OpenTelemetry
475
475
  Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
476
476
  end
477
477
  end
478
- # rubocop:enable Metrics/ClassLength
479
478
  end
480
479
  end
481
480
  end
@@ -7,6 +7,6 @@
7
7
  module OpenTelemetry
8
8
  module SDK
9
9
  ## Current OpenTelemetry version
10
- VERSION = '1.13.0'
10
+ VERSION = '1.13.1'
11
11
  end
12
12
  end
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.13.0
4
+ version: 1.13.1
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.13.0/file/CHANGELOG.md
129
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-sdk/v1.13.0/sdk
128
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.13.1/file/CHANGELOG.md
129
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-sdk/v1.13.1/sdk
130
130
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
131
- documentation_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.13.0
131
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-sdk/1.13.1
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib