opentelemetry-common 0.25.1 → 0.25.2

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: d2dfe09995086657f244ed13bf7f2f428728adafe7d66acd52deb3d810d52802
4
- data.tar.gz: 61ab7d675662c0a8080e6a399e6300708a1d78f19024948714dac5c1fdb8ba6b
3
+ metadata.gz: '097eba92f7929c8f874b97f8c618bb8be5585afef3c3103ae31d66dddca4d3d4'
4
+ data.tar.gz: 1d8fb2e9996a96f53a5c3a5fbc0abfb35b1e4077e7a857995ce2d08d1455cc11
5
5
  SHA512:
6
- metadata.gz: 9b9c1682fd00e8e4291c12b1349f2a25f9a1330b05eb2289b0f737f9420ac8a0eaf0ede96e1c7977f344b0e6361ba0b2ac2f61e2baa15da0dfdbfe9ce2773ab3
7
- data.tar.gz: a82c3b346c1c416f52cdcdceb4f6945efe54e916367cb5721281493a15a21d55111a9c9d8f99e4071f2c96c97c19b1af36b275868cd1962dc8cf11b87c4e8602
6
+ metadata.gz: 123478756121ea8d2e96f74052137e8ac911fe03dc969ac2c7b8412e31dc300603de386dc71b578677f28caf9b6608181840a3d48c185e082f40b5b2894316b0
7
+ data.tar.gz: 88c47545222c8de12a0448c552af86f2a4716681abf4f873a51208e203ece3b01eb7dd4a43569d40009faefacc28916c76f093100c47fc478f190f5a4e97b800
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-common
2
2
 
3
+ ### v0.25.2 / 2026-09-29
4
+
5
+ * FIXED: Normalize UTF-8 attribute strings (#2259)
6
+
3
7
  ### v0.25.1 / 2026-07-08
4
8
 
5
9
  * DOCS: Update source for gemspec links to RubyDoc (#2123)
@@ -54,9 +54,9 @@ module OpenTelemetry
54
54
  #
55
55
  # @param [String] string The string to be utf8 encoded
56
56
  # @param [optional boolean] binary This option is for displaying binary data
57
- # @param [optional String] placeholder The fallback string to be used if encoding fails
57
+ # @param [String, nil] placeholder The fallback value to be used if encoding fails
58
58
  #
59
- # @return [String]
59
+ # @return [String, nil]
60
60
  def utf8_encode(string, binary: false, placeholder: STRING_PLACEHOLDER)
61
61
  string = string.to_s
62
62
 
@@ -66,6 +66,11 @@ module OpenTelemetry
66
66
  string.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
67
67
  elsif string.encoding == ::Encoding::UTF_8
68
68
  string
69
+ elsif string.encoding == ::Encoding::ASCII_8BIT
70
+ utf8_string = string.dup.force_encoding(::Encoding::UTF_8)
71
+ raise Encoding::InvalidByteSequenceError, 'binary string is not valid UTF-8' unless utf8_string.valid_encoding?
72
+
73
+ utf8_string
69
74
  else
70
75
  string.encode(::Encoding::UTF_8)
71
76
  end
@@ -104,7 +109,7 @@ module OpenTelemetry
104
109
  def untraced(context = Context.current)
105
110
  context = context.set_value(UNTRACED_KEY, true)
106
111
  if block_given?
107
- Context.with_current(context) { |ctx| yield ctx }
112
+ Context.with_current(context) { |ctx| yield ctx } # rubocop:disable Style/ExplicitBlockArgument
108
113
  else
109
114
  context
110
115
  end
@@ -6,6 +6,6 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  module Common
9
- VERSION = '0.25.1'
9
+ VERSION = '0.25.2'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.1
4
+ version: 0.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
@@ -47,10 +47,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
47
47
  licenses:
48
48
  - Apache-2.0
49
49
  metadata:
50
- changelog_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.1/file/CHANGELOG.md
51
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-common/v0.25.1/common
50
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.2/file/CHANGELOG.md
51
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/opentelemetry-common/v0.25.2/common
52
52
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
53
- documentation_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.1
53
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-common/0.25.2
54
54
  rdoc_options: []
55
55
  require_paths:
56
56
  - lib
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 4.0.10
68
+ rubygems_version: 4.0.20
69
69
  specification_version: 4
70
70
  summary: Common helpers for OpenTelemetry
71
71
  test_files: []