opentelemetry-common 0.19.6 → 0.19.7

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: 286a98f703c4c88fa99e50dc57c30aa2d49ca4eef437a7ea3151ff904ea16dfc
4
- data.tar.gz: b6cbfd1808ff51e47600dc27e6093d903b42c7c04ca5333114ad8447a269563c
3
+ metadata.gz: 364c424a8ede5f9b84ec679db86990267da86de77a3abadd541cddacb1d7c21a
4
+ data.tar.gz: 199bde04749d124c034d58a38436da28404fe160335be7b835abf14fdc658f6e
5
5
  SHA512:
6
- metadata.gz: 694e7ed9f4a0c0ea9463c9bce044d16ea2ebdb6805d6d6cdb4c66dac1f5e1c2066951b4b30afd5455afd1bc49c2f7bd9804a50ac90ba873a133fedea5627a282
7
- data.tar.gz: a3c5598137f319384f48196f529b2c627b4ed302d646dab2849c29db8171ed9f0c1f866b82751508da9a259b0fe73f85a8baf6c02bcfa171292a9152afe80920
6
+ metadata.gz: 5520ca11a8ff2489bc5ea9039525030321e15d1e3fc6f7bfb36b4832032bded29d506f8d154b24f51cf331174872bbeedb1b8cc2ebe2968bc12ee3fc26aad812
7
+ data.tar.gz: f10eef00e990e37720a3186d8b29b90c21b0c8623c171320c6bc9de6c716e3327dc5bcb84a71aa53bc550043cb83c4169d27e1db30f35573aeca68f7cba3f277
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-common
2
2
 
3
+ ### v0.19.7 / 2023-05-30
4
+
5
+ * FIXED: Untraced only works with parent-based sampler
6
+
3
7
  ### v0.19.6 / 2022-05-18
4
8
 
5
9
  * (No significant changes)
@@ -29,7 +29,7 @@ module OpenTelemetry
29
29
  private
30
30
 
31
31
  def to_rack_key(key)
32
- ret = 'HTTP_' + key
32
+ ret = "HTTP_#{key}"
33
33
  ret.tr!('-', '_')
34
34
  ret.upcase!
35
35
  ret
@@ -37,7 +37,7 @@ module OpenTelemetry
37
37
 
38
38
  def from_rack_key(key)
39
39
  start = key.start_with?('HTTP_') ? 5 : 0
40
- ret = key[start..-1]
40
+ ret = key[start..]
41
41
  ret.tr!('_', '-')
42
42
  ret.downcase!
43
43
  ret
@@ -10,6 +10,9 @@ module OpenTelemetry
10
10
  module Utilities
11
11
  extend self
12
12
 
13
+ UNTRACED_KEY = Context.create_key('untraced')
14
+ private_constant :UNTRACED_KEY
15
+
13
16
  STRING_PLACEHOLDER = ''.encode(::Encoding::UTF_8).freeze
14
17
 
15
18
  # Returns nil if timeout is nil, 0 if timeout has expired,
@@ -83,8 +86,17 @@ module OpenTelemetry
83
86
  end
84
87
  end
85
88
 
89
+ # Disables tracing within the provided block.
86
90
  def untraced
87
- OpenTelemetry::Trace.with_span(OpenTelemetry::Trace.non_recording_span(OpenTelemetry::Trace::SpanContext.new)) { yield }
91
+ Context.with_value(UNTRACED_KEY, true) do |ctx, _|
92
+ yield ctx
93
+ end
94
+ end
95
+
96
+ # Detects whether the current context has been set to disable tracing.
97
+ def untraced?(context = nil)
98
+ context ||= Context.current
99
+ !!context.value(UNTRACED_KEY)
88
100
  end
89
101
 
90
102
  # Returns a URL string with userinfo removed.
@@ -6,6 +6,6 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  module Common
9
- VERSION = '0.19.6'
9
+ VERSION = '0.19.7'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.6
4
+ version: 0.19.7
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-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.73.0
89
+ version: '1.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.73.0
96
+ version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -160,10 +160,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
160
160
  licenses:
161
161
  - Apache-2.0
162
162
  metadata:
163
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.6/file.CHANGELOG.html
163
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.7/file.CHANGELOG.html
164
164
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/common
165
165
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
166
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.6
166
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.7
167
167
  post_install_message:
168
168
  rdoc_options: []
169
169
  require_paths: