opentelemetry-sdk 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fae25f56974c1b746cc24c2bd537c829b9bc0b510a0993c0d85f144ddacade73
4
- data.tar.gz: e4e8c19fa73acaf36eac999e4d8f4eccd1769ec8b93e4ec712afcf69c2989975
3
+ metadata.gz: 7cb2a536d6bf68847feac7a09754a427cf7b17ef3e84bbffa46048f90cd6577e
4
+ data.tar.gz: 7b48fd5ecadc6f229b0a32672b280ed6ea924a5e3bf0cd20631694c0bf8ebef0
5
5
  SHA512:
6
- metadata.gz: e62fcd38916931803cb8321a6bc8a4790943799156597d9b4c9c838075afeeb7fccbd7e5f05c63aaa52aa630dfcea0d04298ea37d52ff887650d4f802a1d7e75
7
- data.tar.gz: c33752a751d7db605813ce1aa062650f3d2fd8db5f561e1a157e1a8a52af24b0f9d1ab54367486092524e86c9fff59eec9777152f03c646bdd1a6182923e8c88
6
+ metadata.gz: 7fe7fe35fbe00ea7e0370b2b9684800eeae0d13d71c10a28040b3a10f82c63422b4986dbf33164e83b97ed90723cf9d8eff1c75b693c854fab3a9a1f05f59846
7
+ data.tar.gz: 68795672a61c8a9118507ad0a6cd9b5fa52be71eb06021e2f53e9fc3a490330e1a8c844fd51868b5e413db356f668a8cb32e9a311f36fd51b0e3cb6211111a83
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History: opentelemetry-sdk
2
2
 
3
+ ### v1.3.0 / 2023-06-08
4
+
5
+ * BREAKING CHANGE: Remove support for EoL Ruby 2.7
6
+
7
+ * ADDED: Remove support for EoL Ruby 2.7
8
+ * FIXED: SDK requires opentelemetry-common 0.19.7
9
+
10
+ ### v1.2.1 / 2023-05-30
11
+
12
+ * FIXED: Untraced only works with parent-based sampler
13
+ * DOCS: Improve formatting of usage examples in OpenTelemetry SDK rubydocs
14
+
3
15
  ### v1.2.0 / 2022-09-14
4
16
 
5
17
  * ADDED: Support OTEL_PROPAGATORS=none
@@ -10,7 +10,7 @@ module OpenTelemetry
10
10
  # with an ERROR log level, only OpenTelemetry logs at the ERROR level or higher
11
11
  # will be emitted.
12
12
  class ForwardingLogger
13
- def initialize(logger, level:) # rubocop:disable Metrics/CyclomaticComplexity
13
+ def initialize(logger, level:)
14
14
  @logger = logger
15
15
 
16
16
  if level.is_a?(Integer)
@@ -11,7 +11,7 @@ module OpenTelemetry
11
11
  # for which telemetry (metrics or traces) is reported.
12
12
  class Resource
13
13
  class << self
14
- private :new # rubocop:disable Style/AccessModifierDeclarations
14
+ private :new
15
15
 
16
16
  # Returns a newly created {Resource} with the specified attributes
17
17
  #
@@ -4,8 +4,6 @@
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
- require 'pp'
8
-
9
7
  module OpenTelemetry
10
8
  module SDK
11
9
  module Trace
@@ -10,26 +10,26 @@ module OpenTelemetry
10
10
  module Export
11
11
  # A SpanExporter implementation that can be used to test OpenTelemetry integration.
12
12
  #
13
- # Example usage in a test suite:
13
+ # @example Usage in a test suite:
14
+ # class MyClassTest
15
+ # def setup
16
+ # @tracer_provider = TracerProvider.new
17
+ # # The default is `recording: true`, which is appropriate in non-test environments.
18
+ # @exporter = InMemorySpanExporter.new(recording: false)
19
+ # @tracer_provider.add_span_processor(SimpleSampledSpansProcessor.new(@exporter))
20
+ # end
14
21
  #
15
- # class MyClassTest
16
- # def setup
17
- # @tracer_provider = TracerProvider.new
18
- # # The default is `recording: true`, which is appropriate in non-test environments.
19
- # @exporter = InMemorySpanExporter.new(recording: false)
20
- # @tracer_provider.add_span_processor(SimpleSampledSpansProcessor.new(@exporter))
21
- # end
22
- #
23
- # def test_finished_spans
24
- # @exporter.recording = true
25
- # @tracer_provider.tracer.in_span("span") {}
22
+ # def test_finished_spans
23
+ # @exporter.recording = true
24
+ # @tracer_provider.tracer.in_span("span") {}
26
25
  #
27
- # spans = @exporter.finished_spans
28
- # spans.wont_be_nil
29
- # spans.size.must_equal(1)
30
- # spans[0].name.must_equal("span")
26
+ # spans = @exporter.finished_spans
27
+ # spans.wont_be_nil
28
+ # spans.size.must_equal(1)
29
+ # spans[0].name.must_equal("span")
31
30
  #
32
- # @exporter.recording = false
31
+ # @exporter.recording = false
32
+ # end
33
33
  # end
34
34
  class InMemorySpanExporter
35
35
  # Controls whether or not the exporter will record spans, or discard them.
@@ -15,6 +15,7 @@ module OpenTelemetry
15
15
  # the unstable OpenTelemetry Metrics API. An example implementation in
16
16
  # terms of StatsD is:
17
17
  #
18
+ # @example
18
19
  # module MetricsReporter
19
20
  # def add_to_counter(metric, increment: 1, labels: {})
20
21
  # StatsD.increment(metric, increment, labels, no_prefix: true)
@@ -40,7 +40,7 @@ module OpenTelemetry
40
40
  # an empty Tracestate here, the Tracestate will be cleared, so
41
41
  # samplers SHOULD normally return the passed-in Tracestate if they
42
42
  # do not intend to change it.
43
- def initialize(decision:, attributes: nil, tracestate:)
43
+ def initialize(decision:, tracestate:, attributes: nil)
44
44
  @decision = decision
45
45
  @attributes = attributes.freeze || EMPTY_HASH
46
46
  @tracestate = tracestate
@@ -28,9 +28,11 @@ module OpenTelemetry
28
28
  end
29
29
 
30
30
  def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
31
+ with_parent ||= Context.current
32
+ return super(name, with_parent: with_parent, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind) if Common::Utilities.untraced?(with_parent)
33
+
31
34
  name ||= 'empty'
32
35
  kind ||= :internal
33
- with_parent ||= Context.current
34
36
 
35
37
  @tracer_provider.internal_start_span(name, kind, attributes, links, start_timestamp, with_parent, @instrumentation_scope)
36
38
  end
@@ -164,7 +164,7 @@ module OpenTelemetry
164
164
 
165
165
  private
166
166
 
167
- def sampler_from_environment(default_sampler) # rubocop:disable Metrics/CyclomaticComplexity
167
+ def sampler_from_environment(default_sampler)
168
168
  case ENV['OTEL_TRACES_SAMPLER']
169
169
  when 'always_on' then Samplers::ALWAYS_ON
170
170
  when 'always_off' then Samplers::ALWAYS_OFF
@@ -7,6 +7,6 @@
7
7
  module OpenTelemetry
8
8
  module SDK
9
9
  ## Current OpenTelemetry version
10
- VERSION = '1.2.0'
10
+ VERSION = '1.3.0'
11
11
  end
12
12
  end
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.2.0
4
+ version: 1.3.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: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2023-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.19.3
33
+ version: '0.20'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.19.3
40
+ version: '0.20'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: opentelemetry-registry
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.73.0
187
+ version: 1.51.0
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: 0.73.0
194
+ version: 1.51.0
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.2.0/file.CHANGELOG.html
297
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.3.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.2.0
300
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/v1.3.0
301
301
  post_install_message:
302
302
  rdoc_options: []
303
303
  require_paths:
@@ -306,14 +306,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
306
306
  requirements:
307
307
  - - ">="
308
308
  - !ruby/object:Gem::Version
309
- version: 2.6.0
309
+ version: '3.0'
310
310
  required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  requirements:
312
312
  - - ">="
313
313
  - !ruby/object:Gem::Version
314
314
  version: '0'
315
315
  requirements: []
316
- rubygems_version: 3.1.6
316
+ rubygems_version: 3.2.33
317
317
  signing_key:
318
318
  specification_version: 4
319
319
  summary: A stats collection and distributed tracing framework