opentelemetry-instrumentation-ethon 0.26.0 → 0.29.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87daf04ee19dc0418bd8a3299ca44a7d2f3f84f9487fadce2a1e8c46b1f6dce5
4
- data.tar.gz: 34895ac3926d8c6f6d5aac9782987d9cd3ce1efde6e9b68eadf96df3c8753901
3
+ metadata.gz: 4fb5ce65aa3e65913e1a7b2db2465e3ea00acd4fb126600a5943837e9097b61a
4
+ data.tar.gz: 6a453a431e16fad6f54dc53b61b28d249c50b30f4442cb710dc688ec03b044a6
5
5
  SHA512:
6
- metadata.gz: 8b74299d09a7ad578d7ac3a3d67f4364b670e10ac674545da107386eb713461b411b8594a8f4875cd36f98e8d906293bd10ce4b34dfeb7b7abccc74b8be33240
7
- data.tar.gz: 58263b2e3e93e5d9f441d7c5f36e1ed560f3308d82cf0c8db90ae502e224fcc4aba7b2871c1938ae44394d1323400612bab308121fa755a71a012420c9ff0a61
6
+ metadata.gz: 3af279395465991f72c7ab16a9c4bd375c070d91b77b4426042e0445fca0de3365e79d38953cb5b65b1a8a28cde2721c81730a4ca8210ff0be6a5d519e1c4aa4
7
+ data.tar.gz: e5fe1b7e99416c21156e64cc80c0b8433281086e32ca7298052fda1f57363757c08c77f1af345f61a62edd865f106aa8d9d82a674fe0c6263b88b8995813d4f3
data/CHANGELOG.md CHANGED
@@ -1,185 +1,192 @@
1
1
  # Release History: opentelemetry-instrumentation-ethon
2
2
 
3
- ### v0.26.0 / 2025-11-26
3
+ ## v0.29.0 / 2026-04-14
4
4
 
5
- * BREAKING CHANGE: Update Ethon span name when unknown method
5
+ - BREAKING CHANGE: Min Ruby Version 3.3 (#2125)
6
+ - ADDED: Min Ruby Version 3.3 (#2125)
7
+ - ADDED: Add release tag into source code url of gem metadata (#1984)
6
8
 
7
- * ADDED: Update Ethon span name when unknown method
9
+ ## v0.28.0 / 2026-03-17
8
10
 
9
- ### v0.25.1 / 2025-11-25
11
+ - BREAKING CHANGE: Default to stable HTTP semantic conventions (#2051)
12
+ - ADDED: Default to stable HTTP semantic conventions (#2051)
10
13
 
11
- * FIXED: Update support for unknown HTTP methods to match semantic conventions
14
+ ## v0.27.0 / 2026-01-13
12
15
 
13
- ### v0.25.0 / 2025-10-22
16
+ - ADDED: HTTP Client Semconv v1.17 Span Naming
14
17
 
15
- * BREAKING CHANGE: Min Ruby Version 3.2
18
+ ## v0.26.0 / 2025-11-26
16
19
 
17
- * ADDED: Min Ruby Version 3.2
20
+ - BREAKING CHANGE: Update Ethon span name when unknown method
21
+ - ADDED: Update Ethon span name when unknown method
18
22
 
19
- ### v0.24.2 / 2025-10-14
23
+ ## v0.25.1 / 2025-11-25
20
24
 
21
- * FIXED: Raise original Ethon error after span updates
25
+ - FIXED: Update support for unknown HTTP methods to match semantic conventions
22
26
 
23
- ### v0.24.1 / 2025-09-30
27
+ ## v0.25.0 / 2025-10-22
24
28
 
25
- * FIXED: Min OTel Ruby API 1.7
29
+ - BREAKING CHANGE: Min Ruby Version 3.2
30
+ - ADDED: Min Ruby Version 3.2
26
31
 
27
- ### v0.24.0 / 2025-09-30
32
+ ## v0.24.2 / 2025-10-14
28
33
 
29
- * ADDED: Bump minimum API Version to 1.7
34
+ - FIXED: Raise original Ethon error after span updates
30
35
 
31
- ### v0.23.1 / 2025-09-02
36
+ ## v0.24.1 / 2025-09-30
32
37
 
33
- * FIXED: Improve Ethon exception handling
38
+ - FIXED: Min OTel Ruby API 1.7
34
39
 
35
- ### v0.23.0 / 2025-08-13
40
+ ## v0.24.0 / 2025-09-30
36
41
 
37
- * ADDED: Add Ethon `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable [#1561](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1561)
42
+ - ADDED: Bump minimum API Version to 1.7
38
43
 
39
- ### v0.22.0 / 2025-01-16
44
+ ## v0.23.1 / 2025-09-02
40
45
 
41
- * BREAKING CHANGE: Set minimum supported version to Ruby 3.1
46
+ - FIXED: Improve Ethon exception handling
42
47
 
43
- * ADDED: Set minimum supported version to Ruby 3.1
48
+ ## v0.23.0 / 2025-08-13
44
49
 
45
- ### v0.21.9 / 2024-11-26
50
+ - ADDED: Add Ethon `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable [#1561](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1561)
46
51
 
47
- * CHANGED: Performance Freeze all range objects #1222
52
+ ## v0.22.0 / 2025-01-16
48
53
 
49
- ### v0.21.8 / 2024-07-23
54
+ - BREAKING CHANGE: Set minimum supported version to Ruby 3.1
55
+ - ADDED: Set minimum supported version to Ruby 3.1
50
56
 
51
- * DOCS: Add cspell to CI
57
+ ## v0.21.9 / 2024-11-26
52
58
 
53
- ### v0.21.7 / 2024-06-18
59
+ - CHANGED: Performance Freeze all range objects #1222
54
60
 
55
- * FIXED: Relax otel common gem constraints
61
+ ## v0.21.8 / 2024-07-23
56
62
 
57
- ### v0.21.6 / 2024-06-12
63
+ - DOCS: Add cspell to CI
58
64
 
59
- * FIXED: Add net.peer.name to ethon
65
+ ## v0.21.7 / 2024-06-18
60
66
 
61
- ### v0.21.5 / 2024-05-09
67
+ - FIXED: Relax otel common gem constraints
62
68
 
63
- * FIXED: Untrace entire request
69
+ ## v0.21.6 / 2024-06-12
64
70
 
65
- ### v0.21.4 / 2024-04-30
71
+ - FIXED: Add net.peer.name to ethon
66
72
 
67
- * FIXED: Bundler conflict warnings
73
+ ## v0.21.5 / 2024-05-09
68
74
 
69
- ### v0.21.3 / 2023-11-23
75
+ - FIXED: Untrace entire request
70
76
 
71
- * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
77
+ ## v0.21.4 / 2024-04-30
72
78
 
73
- ### v0.21.2 / 2023-07-21
79
+ - FIXED: Bundler conflict warnings
74
80
 
75
- * ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537)
81
+ ## v0.21.3 / 2023-11-23
76
82
 
77
- ### v0.21.1 / 2023-06-05
83
+ - CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
78
84
 
79
- * FIXED: Base config options
85
+ ## v0.21.2 / 2023-07-21
80
86
 
81
- ### v0.21.0 / 2023-04-17
87
+ - ADDED: Update `opentelemetry-common` from [0.19.3 to 0.20.0](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/537)
82
88
 
83
- * BREAKING CHANGE: Drop support for EoL Ruby 2.7
89
+ ## v0.21.1 / 2023-06-05
84
90
 
85
- * ADDED: Drop support for EoL Ruby 2.7
91
+ - FIXED: Base config options
86
92
 
87
- ### v0.20.1 / 2023-01-14
93
+ ## v0.21.0 / 2023-04-17
88
94
 
89
- * DOCS: Fix gem homepage
90
- * DOCS: More gem documentation fixes
95
+ - BREAKING CHANGE: Drop support for EoL Ruby 2.7
96
+ - ADDED: Drop support for EoL Ruby 2.7
91
97
 
92
- ### v0.20.0 / 2022-06-09
98
+ ## v0.20.1 / 2023-01-14
93
99
 
94
- * Upgrading Base dependency version
95
- * FIXED: Broken test file requirements
100
+ - DOCS: Fix gem homepage
101
+ - DOCS: More gem documentation fixes
96
102
 
97
- ### v0.19.5 / 2022-05-05
103
+ ## v0.20.0 / 2022-06-09
98
104
 
99
- * (No significant changes)
105
+ - Upgrading Base dependency version
106
+ - FIXED: Broken test file requirements
100
107
 
101
- ### v0.19.4 / 2022-02-02
108
+ ## v0.19.5 / 2022-05-05
102
109
 
103
- * FIXED: Excessive hash creation on context attr merging
110
+ - (No significant changes)
104
111
 
105
- ### v0.19.3 / 2021-12-02
112
+ ## v0.19.4 / 2022-02-02
106
113
 
107
- * (No significant changes)
114
+ - FIXED: Excessive hash creation on context attr merging
108
115
 
109
- ### v0.19.2 / 2021-09-29
116
+ ## v0.19.3 / 2021-12-02
110
117
 
111
- * (No significant changes)
118
+ - (No significant changes)
112
119
 
113
- ### v0.19.1 / 2021-08-12
120
+ ## v0.19.2 / 2021-09-29
114
121
 
115
- * DOCS: Update docs to rely more on environment variable configuration
122
+ - (No significant changes)
116
123
 
117
- ### v0.19.0 / 2021-06-23
124
+ ## v0.19.1 / 2021-08-12
118
125
 
119
- * BREAKING CHANGE: Total order constraint on span.status=
126
+ - DOCS: Update docs to rely more on environment variable configuration
120
127
 
121
- * FIXED: Total order constraint on span.status=
128
+ ## v0.19.0 / 2021-06-23
122
129
 
123
- ### v0.18.0 / 2021-05-21
130
+ - BREAKING CHANGE: Total order constraint on span.status=
131
+ - FIXED: Total order constraint on span.status=
124
132
 
125
- * ADDED: Updated API dependency for 1.0.0.rc1
133
+ ## v0.18.0 / 2021-05-21
126
134
 
127
- ### v0.17.0 / 2021-04-22
135
+ - ADDED: Updated API dependency for 1.0.0.rc1
128
136
 
129
- * ADDED: Ethon instrumentation accepts peer service config attribute.
130
- * FIXED: Refactor propagators to add #fields
137
+ ## v0.17.0 / 2021-04-22
131
138
 
132
- ### v0.16.0 / 2021-03-17
139
+ - ADDED: Ethon instrumentation accepts peer service config attribute.
140
+ - FIXED: Refactor propagators to add #fields
133
141
 
134
- * FIXED: Remove passwords from http.url
135
- * FIXED: Example scripts now reference local common lib
136
- * DOCS: Replace Gitter with GitHub Discussions
142
+ ## v0.16.0 / 2021-03-17
137
143
 
138
- ### v0.15.0 / 2021-02-18
144
+ - FIXED: Remove passwords from http.url
145
+ - FIXED: Example scripts now reference local common lib
146
+ - DOCS: Replace Gitter with GitHub Discussions
139
147
 
140
- * (No significant changes)
148
+ ## v0.15.0 / 2021-02-18
141
149
 
142
- ### v0.14.0 / 2021-02-03
150
+ - (No significant changes)
143
151
 
144
- * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
152
+ ## v0.14.0 / 2021-02-03
145
153
 
146
- * ADDED: Replace getter and setter callables and remove rack specific propagators
154
+ - BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
155
+ - ADDED: Replace getter and setter callables and remove rack specific propagators
147
156
 
148
- ### v0.13.0 / 2021-01-29
157
+ ## v0.13.0 / 2021-01-29
149
158
 
150
- * (No significant changes)
159
+ - (No significant changes)
151
160
 
152
- ### v0.12.0 / 2020-12-24
161
+ ## v0.12.0 / 2020-12-24
153
162
 
154
- * (No significant changes)
163
+ - (No significant changes)
155
164
 
156
- ### v0.11.0 / 2020-12-11
165
+ ## v0.11.0 / 2020-12-11
157
166
 
158
- * FIXED: Copyright comments to not reference year
167
+ - FIXED: Copyright comments to not reference year
159
168
 
160
- ### v0.10.0 / 2020-12-03
169
+ ## v0.10.0 / 2020-12-03
161
170
 
162
- * (No significant changes)
171
+ - (No significant changes)
163
172
 
164
- ### v0.9.0 / 2020-11-27
173
+ ## v0.9.0 / 2020-11-27
165
174
 
166
- * BREAKING CHANGE: Add timeout for force_flush and shutdown
175
+ - BREAKING CHANGE: Add timeout for force_flush and shutdown
176
+ - ADDED: Add timeout for force_flush and shutdown
167
177
 
168
- * ADDED: Add timeout for force_flush and shutdown
178
+ ## v0.8.0 / 2020-10-27
169
179
 
170
- ### v0.8.0 / 2020-10-27
180
+ - BREAKING CHANGE: Move context/span methods to Trace module
181
+ - BREAKING CHANGE: Remove 'canonical' from status codes
182
+ - FIXED: Move context/span methods to Trace module
183
+ - FIXED: Remove 'canonical' from status codes
171
184
 
172
- * BREAKING CHANGE: Move context/span methods to Trace module
173
- * BREAKING CHANGE: Remove 'canonical' from status codes
185
+ ## v0.7.0 / 2020-10-07
174
186
 
175
- * FIXED: Move context/span methods to Trace module
176
- * FIXED: Remove 'canonical' from status codes
187
+ - DOCS: Add README for Ethon
188
+ - DOCS: Standardize top-level docs structure and readme
177
189
 
178
- ### v0.7.0 / 2020-10-07
190
+ ## v0.6.0 / 2020-09-10
179
191
 
180
- * DOCS: Add README for Ethon
181
- * DOCS: Standardize top-level docs structure and readme
182
-
183
- ### v0.6.0 / 2020-09-10
184
-
185
- * (No significant changes)
192
+ - (No significant changes)
data/README.md CHANGED
@@ -44,7 +44,7 @@ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special int
44
44
 
45
45
  The `opentelemetry-instrumentation-all` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
46
46
 
47
- [ethon-home]:https://github.com/typhoeus/ethon
47
+ [ethon-home]: https://github.com/typhoeus/ethon
48
48
  [bundler-home]: https://bundler.io
49
49
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
50
50
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE
@@ -55,16 +55,12 @@ The `opentelemetry-instrumentation-all` gem is distributed under the Apache 2.0
55
55
 
56
56
  ## HTTP semantic convention stability
57
57
 
58
- In the OpenTelemetry ecosystem, HTTP semantic conventions have now reached a stable state. However, the initial Ethon instrumentation was introduced before this stability was achieved, which resulted in HTTP attributes being based on an older version of the semantic conventions.
59
-
60
- To facilitate the migration to stable semantic conventions, you can use the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable. This variable allows you to opt-in to the new stable conventions, ensuring compatibility and future-proofing your instrumentation.
58
+ This instrumentation by default emits the stable HTTP semantic conventions. The `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable can be used to opt-in to the old or duplicate (both old and stable) semantic conventions.
61
59
 
62
60
  When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
63
61
 
64
- - `http` - Emits the stable HTTP and networking conventions and ceases emitting the old conventions previously emitted by the instrumentation.
65
- - `http/dup` - Emits both the old and stable HTTP and networking conventions, enabling a phased rollout of the stable semantic conventions.
66
- - Default behavior (in the absence of either value) is to continue emitting the old HTTP and networking conventions the instrumentation previously emitted.
67
-
68
- During the transition from old to stable conventions, Ethon instrumentation code comes in three patch versions: `dup`, `old`, and `stable`. These versions are identical except for the attributes they send. Any changes to Ethon instrumentation should consider all three patches.
62
+ - `http` - Emits the stable HTTP and networking conventions.
63
+ - `http/dup` - **DEPRECATED: Will be removed on April 15, 2026.** Emits both the old and stable HTTP and networking conventions.
64
+ - `old` - **DEPRECATED: Will be removed on April 15, 2026.** Emits the old HTTP and networking conventions.
69
65
 
70
- For additional information on migration, please refer to our [documentation](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/).
66
+ For additional information on migration, please refer to our [documentation](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/).
@@ -11,7 +11,7 @@ module OpenTelemetry
11
11
  # @api private
12
12
  module HttpHelper
13
13
  # Lightweight struct to hold span creation attributes
14
- SpanCreationAttributes = Struct.new(:span_name, :normalized_method, :original_method, keyword_init: true)
14
+ SpanCreationAttributes = Struct.new(:span_name, :attributes)
15
15
 
16
16
  # Pre-computed mapping to avoid string allocations during normalization
17
17
  METHOD_CACHE = {
@@ -44,41 +44,89 @@ module OpenTelemetry
44
44
  :trace => 'TRACE'
45
45
  }.freeze
46
46
 
47
- # Pre-computed span names for old semantic conventions to avoid allocations
48
- OLD_SPAN_NAMES = {
49
- 'CONNECT' => 'HTTP CONNECT',
50
- 'DELETE' => 'HTTP DELETE',
51
- 'GET' => 'HTTP GET',
52
- 'HEAD' => 'HTTP HEAD',
53
- 'OPTIONS' => 'HTTP OPTIONS',
54
- 'PATCH' => 'HTTP PATCH',
55
- 'POST' => 'HTTP POST',
56
- 'PUT' => 'HTTP PUT',
57
- 'TRACE' => 'HTTP TRACE'
58
- }.freeze
47
+ private_constant :METHOD_CACHE
48
+
49
+ OLD_SPAN_NAMES_BY_METHOD = METHOD_CACHE.values.uniq.to_h do |method|
50
+ [method, "HTTP #{method}"]
51
+ end.freeze
59
52
 
60
- private_constant :METHOD_CACHE, :OLD_SPAN_NAMES
53
+ private_constant :OLD_SPAN_NAMES_BY_METHOD
61
54
 
62
- # Prepares all span data for the specified semantic convention in a single call
55
+ # Prepares span data using old semantic conventions
63
56
  # @param method [String, Symbol] The HTTP method
64
- # @param semconv [Symbol] The semantic convention to use (:stable or :old)
65
- # @return [SpanCreationAttributes] struct containing span_name, normalized_method, and original_method
66
- def self.span_attrs_for(method, semconv: :stable)
57
+ # @return [SpanCreationAttributes] struct containing span_name and attributes hash
58
+ def self.span_attrs_for_old(method)
59
+ client_context_attrs = OpenTelemetry::Common::HTTP::ClientContext.attributes
67
60
  normalized = METHOD_CACHE[method]
61
+ attributes = client_context_attrs.dup
62
+
63
+ # Determine base span name and method value
64
+ if normalized
65
+ span_name = OLD_SPAN_NAMES_BY_METHOD[normalized]
66
+ method_value = normalized
67
+ else
68
+ span_name = 'HTTP'
69
+ method_value = '_OTHER'
70
+ end
71
+
72
+ attributes['http.method'] ||= method_value
73
+
74
+ SpanCreationAttributes.new(span_name: span_name, attributes: attributes)
75
+ end
76
+
77
+ # Prepares span data using stable semantic conventions
78
+ # @param method [String, Symbol] The HTTP method
79
+ # @return [SpanCreationAttributes] struct containing span_name and attributes hash
80
+ def self.span_attrs_for_stable(method)
81
+ client_context_attrs = OpenTelemetry::Common::HTTP::ClientContext.attributes
82
+ url_template = client_context_attrs['url.template']
83
+ normalized = METHOD_CACHE[method]
84
+ attributes = client_context_attrs.dup
85
+
86
+ # Determine base span name and method value
68
87
  if normalized
69
- span_name = semconv == :old ? OLD_SPAN_NAMES[normalized] : normalized
70
- SpanCreationAttributes.new(
71
- span_name: span_name,
72
- normalized_method: normalized,
73
- original_method: nil
74
- )
88
+ base_name = normalized
89
+ method_value = normalized
90
+ original = nil
75
91
  else
76
- SpanCreationAttributes.new(
77
- span_name: 'HTTP',
78
- normalized_method: '_OTHER',
79
- original_method: method.to_s
80
- )
92
+ base_name = 'HTTP'
93
+ method_value = '_OTHER'
94
+ original = method.to_s
81
95
  end
96
+
97
+ span_name = url_template ? "#{base_name} #{url_template}" : base_name
98
+ attributes['http.request.method'] ||= method_value
99
+ attributes['http.request.method_original'] ||= original if original
100
+
101
+ SpanCreationAttributes.new(span_name: span_name, attributes: attributes)
102
+ end
103
+
104
+ # Prepares span data using both old and stable semantic conventions
105
+ # @param method [String, Symbol] The HTTP method
106
+ # @return [SpanCreationAttributes] struct containing span_name and attributes hash
107
+ def self.span_attrs_for_dup(method)
108
+ client_context_attrs = OpenTelemetry::Common::HTTP::ClientContext.attributes
109
+ url_template = client_context_attrs['url.template']
110
+ normalized = METHOD_CACHE[method]
111
+ attributes = client_context_attrs.dup
112
+
113
+ # Determine base span name and method value
114
+ if normalized
115
+ base_name = normalized
116
+ method_value = normalized
117
+ original = nil
118
+ else
119
+ base_name = 'HTTP'
120
+ method_value = '_OTHER'
121
+ original = method.to_s
122
+ end
123
+
124
+ span_name = url_template ? "#{base_name} #{url_template}" : base_name
125
+ attributes['http.method'] ||= method_value
126
+ attributes['http.request.method'] ||= method_value
127
+ attributes['http.request.method_original'] ||= original if original
128
+
129
+ SpanCreationAttributes.new(span_name: span_name, attributes: attributes)
82
130
  end
83
131
  end
84
132
  end
@@ -29,14 +29,20 @@ module OpenTelemetry
29
29
  values = stability_opt_in.split(',').map(&:strip)
30
30
 
31
31
  if values.include?('http/dup')
32
+ emit_old_semconv_deprecation_warning('http/dup')
32
33
  'dup'
33
- elsif values.include?('http')
34
- 'stable'
35
- else
34
+ elsif values.include?('old')
35
+ emit_old_semconv_deprecation_warning('old')
36
36
  'old'
37
+ else
38
+ 'stable'
37
39
  end
38
40
  end
39
41
 
42
+ def emit_old_semconv_deprecation_warning(option)
43
+ OpenTelemetry.logger.warn("The `#{option}` option for OTEL_SEMCONV_STABILITY_OPT_IN is deprecated and will be removed on April 15, 2026. Please migrate to the stable HTTP semantic conventions.")
44
+ end
45
+
40
46
  def require_dependencies_dup
41
47
  require_relative 'patches/dup/easy'
42
48
  require_relative 'patches/multi'
@@ -68,7 +68,7 @@ module OpenTelemetry
68
68
  end
69
69
 
70
70
  def otel_before_request
71
- span_data = HttpHelper.span_attrs_for(@otel_method)
71
+ span_data = HttpHelper.span_attrs_for_dup(@otel_method)
72
72
 
73
73
  @otel_span = tracer.start_span(
74
74
  span_data.span_name,
@@ -90,11 +90,7 @@ module OpenTelemetry
90
90
  private
91
91
 
92
92
  def span_creation_attributes(span_data)
93
- instrumentation_attrs = {
94
- 'http.method' => span_data.normalized_method,
95
- 'http.request.method' => span_data.normalized_method
96
- }
97
- instrumentation_attrs['http.request.method_original'] = span_data.original_method if span_data.original_method
93
+ instrumentation_attrs = {}
98
94
 
99
95
  uri = _otel_cleanse_uri(url)
100
96
  if uri
@@ -106,9 +102,7 @@ module OpenTelemetry
106
102
 
107
103
  config = Ethon::Instrumentation.instance.config
108
104
  instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
109
- instrumentation_attrs.merge!(
110
- OpenTelemetry::Common::HTTP::ClientContext.attributes
111
- )
105
+ instrumentation_attrs.merge!(span_data.attributes)
112
106
  end
113
107
 
114
108
  # Returns a URL string with userinfo removed.
@@ -67,7 +67,7 @@ module OpenTelemetry
67
67
  end
68
68
 
69
69
  def otel_before_request
70
- span_data = HttpHelper.span_attrs_for(@otel_method, semconv: :old)
70
+ span_data = HttpHelper.span_attrs_for_old(@otel_method)
71
71
 
72
72
  @otel_span = tracer.start_span(
73
73
  span_data.span_name,
@@ -89,9 +89,7 @@ module OpenTelemetry
89
89
  private
90
90
 
91
91
  def span_creation_attributes(span_data)
92
- instrumentation_attrs = {
93
- 'http.method' => span_data.normalized_method
94
- }
92
+ instrumentation_attrs = {}
95
93
 
96
94
  uri = _otel_cleanse_uri(url)
97
95
  if uri
@@ -101,9 +99,7 @@ module OpenTelemetry
101
99
 
102
100
  config = Ethon::Instrumentation.instance.config
103
101
  instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
104
- instrumentation_attrs.merge!(
105
- OpenTelemetry::Common::HTTP::ClientContext.attributes
106
- )
102
+ instrumentation_attrs.merge!(span_data.attributes)
107
103
  end
108
104
 
109
105
  # Returns a URL string with userinfo removed.
@@ -67,7 +67,7 @@ module OpenTelemetry
67
67
  end
68
68
 
69
69
  def otel_before_request
70
- span_data = HttpHelper.span_attrs_for(@otel_method)
70
+ span_data = HttpHelper.span_attrs_for_stable(@otel_method)
71
71
 
72
72
  @otel_span = tracer.start_span(
73
73
  span_data.span_name,
@@ -89,10 +89,7 @@ module OpenTelemetry
89
89
  private
90
90
 
91
91
  def span_creation_attributes(span_data)
92
- instrumentation_attrs = {
93
- 'http.request.method' => span_data.normalized_method
94
- }
95
- instrumentation_attrs['http.request.method_original'] = span_data.original_method if span_data.original_method
92
+ instrumentation_attrs = {}
96
93
 
97
94
  uri = _otel_cleanse_uri(url)
98
95
  if uri
@@ -102,9 +99,7 @@ module OpenTelemetry
102
99
 
103
100
  config = Ethon::Instrumentation.instance.config
104
101
  instrumentation_attrs['peer.service'] = config[:peer_service] if config[:peer_service]
105
- instrumentation_attrs.merge!(
106
- OpenTelemetry::Common::HTTP::ClientContext.attributes
107
- )
102
+ instrumentation_attrs.merge!(span_data.attributes)
108
103
  end
109
104
 
110
105
  # Returns a URL string with userinfo removed.
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module Ethon
10
- VERSION = '0.26.0'
10
+ VERSION = '0.29.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-ethon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-11-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: opentelemetry-instrumentation-base
@@ -49,11 +48,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
49
48
  licenses:
50
49
  - Apache-2.0
51
50
  metadata:
52
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ethon/0.26.0/file/CHANGELOG.md
53
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/ethon
51
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ethon/0.29.0/file/CHANGELOG.md
52
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-ethon/v0.29.0/instrumentation/ethon
54
53
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
55
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ethon/0.26.0
56
- post_install_message:
54
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ethon/0.29.0
57
55
  rdoc_options: []
58
56
  require_paths:
59
57
  - lib
@@ -61,15 +59,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
59
  requirements:
62
60
  - - ">="
63
61
  - !ruby/object:Gem::Version
64
- version: '3.2'
62
+ version: '3.3'
65
63
  required_rubygems_version: !ruby/object:Gem::Requirement
66
64
  requirements:
67
65
  - - ">="
68
66
  - !ruby/object:Gem::Version
69
67
  version: '0'
70
68
  requirements: []
71
- rubygems_version: 3.4.19
72
- signing_key:
69
+ rubygems_version: 4.0.6
73
70
  specification_version: 4
74
71
  summary: Ethon instrumentation for the OpenTelemetry framework
75
72
  test_files: []