opentelemetry-instrumentation-http 0.27.1 → 0.30.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: 850cb2d0a9d8d18cf00cade03d86e379a2338f626a0f1468e32b37c186de0869
4
- data.tar.gz: d89c15de55426a730fdaef82e1b8212fa20981b645b9985f66712ceff7cab2b3
3
+ metadata.gz: 4543fe83a9f11f078468ed896e6c97b902600b8ca1e6f2851cb5fc074b87f992
4
+ data.tar.gz: f9cfa712de1fcb7dbdf013dcc396087ec4c1d7368a5aee1885aee28a3d79bad1
5
5
  SHA512:
6
- metadata.gz: 676dd8c1071ed0c9f0927c6def794f71637919a3303be4df314ebfe2cdb8037f04e64c5ccbdc649326f51c920437714cd504699a59e26dbfeb33569aed5172e0
7
- data.tar.gz: a681dc2912300b21a16e1d7d069cf8e35eb3f9899917e87f89522f15e7b949de8f963bb894eb5efd887cc0a2cd8120077b25b3c29dc125dd0beffd7a150e3bb8
6
+ metadata.gz: 308dad930e78f6c0d4a6c1054a87155f7da8262bf8ca8385d5a2b518ec78a2120e5b5497c71907f82bbf794a41e4a21c30fd2569ce9a164f6a80cbaa6f8bd7f8
7
+ data.tar.gz: ed2bbff794c2c357a4cf468a045be0f1f678ef5722e751e6dbe9ea642b926e760ff6917879546f0c6204e37c7e3384276fc1bbc2636a213997de87dd7f9d1197
data/CHANGELOG.md CHANGED
@@ -1,124 +1,135 @@
1
1
  # Release History: opentelemetry-instrumentation-http
2
2
 
3
- ### v0.27.1 / 2025-11-25
3
+ ## v0.30.0 / 2026-04-14
4
4
 
5
- * FIXED: Update support for unknown HTTP methods to match semantic conventions
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
- ### v0.27.0 / 2025-10-22
9
+ ## v0.29.0 / 2026-03-17
8
10
 
9
- * BREAKING CHANGE: Min Ruby Version 3.2
11
+ - BREAKING CHANGE: Default to stable HTTP semantic conventions (#2051)
12
+ - ADDED: Default to stable HTTP semantic conventions (#2051)
10
13
 
11
- * ADDED: Min Ruby Version 3.2
14
+ ## v0.28.0 / 2026-01-13
12
15
 
13
- ### v0.26.1 / 2025-09-30
16
+ - ADDED: HTTP Client Semconv v1.17 Span Naming
14
17
 
15
- * FIXED: Min OTel Ruby API 1.7
18
+ ## v0.27.1 / 2025-11-25
16
19
 
17
- ### v0.26.0 / 2025-09-30
20
+ - FIXED: Update support for unknown HTTP methods to match semantic conventions
18
21
 
19
- * ADDED: Bump minimum API Version to 1.7
22
+ ## v0.27.0 / 2025-10-22
20
23
 
21
- ### v0.25.1 / 2025-07-01
24
+ - BREAKING CHANGE: Min Ruby Version 3.2
25
+ - ADDED: Min Ruby Version 3.2
22
26
 
23
- * FIXED: Update span name when semconv stability is enabled
27
+ ## v0.26.1 / 2025-09-30
24
28
 
25
- ### v0.25.0 / 2025-06-17
29
+ - FIXED: Min OTel Ruby API 1.7
26
30
 
27
- * ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable [#1547](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1547)
31
+ ## v0.26.0 / 2025-09-30
28
32
 
29
- ### v0.24.0 / 2025-01-16
33
+ - ADDED: Bump minimum API Version to 1.7
30
34
 
31
- * BREAKING CHANGE: Set minimum supported version to Ruby 3.1
35
+ ## v0.25.1 / 2025-07-01
32
36
 
33
- * ADDED: Set minimum supported version to Ruby 3.1
37
+ - FIXED: Update span name when semconv stability is enabled
34
38
 
35
- ### v0.23.5 / 2024-11-26
39
+ ## v0.25.0 / 2025-06-17
36
40
 
37
- * CHANGED: Performance Freeze all range objects #1222
41
+ - ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable [#1547](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1547)
38
42
 
39
- ### v0.23.4 / 2024-07-23
43
+ ## v0.24.0 / 2025-01-16
40
44
 
41
- * DOCS: Add cspell to CI
45
+ - BREAKING CHANGE: Set minimum supported version to Ruby 3.1
46
+ - ADDED: Set minimum supported version to Ruby 3.1
42
47
 
43
- ### v0.23.3 / 2024-04-30
48
+ ## v0.23.5 / 2024-11-26
44
49
 
45
- * FIXED: Bundler conflict warnings
50
+ - CHANGED: Performance Freeze all range objects #1222
46
51
 
47
- ### v0.23.2 / 2023-11-23
52
+ ## v0.23.4 / 2024-07-23
48
53
 
49
- * CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
54
+ - DOCS: Add cspell to CI
50
55
 
51
- ### v0.23.1 / 2023-06-05
56
+ ## v0.23.3 / 2024-04-30
52
57
 
53
- * FIXED: Base config options
58
+ - FIXED: Bundler conflict warnings
54
59
 
55
- ### v0.23.0 / 2023-05-15
60
+ ## v0.23.2 / 2023-11-23
56
61
 
57
- * ADDED: Add span_preprocessor hook
62
+ - CHANGED: Applied Rubocop Performance Recommendations [#727](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/727)
58
63
 
59
- ### v0.22.0 / 2023-04-17
64
+ ## v0.23.1 / 2023-06-05
60
65
 
61
- * BREAKING CHANGE: Drop support for EoL Ruby 2.7
66
+ - FIXED: Base config options
62
67
 
63
- * ADDED: Drop support for EoL Ruby 2.7
68
+ ## v0.23.0 / 2023-05-15
64
69
 
65
- ### v0.21.0 / 2023-01-14
70
+ - ADDED: Add span_preprocessor hook
66
71
 
67
- * ADDED: Add request/response hooks to more http clients
68
- * DOCS: Fix gem homepage
69
- * DOCS: More gem documentation fixes
72
+ ## v0.22.0 / 2023-04-17
70
73
 
71
- ### v0.20.0 / 2022-06-09
74
+ - BREAKING CHANGE: Drop support for EoL Ruby 2.7
75
+ - ADDED: Drop support for EoL Ruby 2.7
72
76
 
73
- * Upgrading Base dependency version
74
- * FIXED: Broken test file requirements
77
+ ## v0.21.0 / 2023-01-14
75
78
 
76
- ### v0.19.6 / 2022-05-05
79
+ - ADDED: Add request/response hooks to more http clients
80
+ - DOCS: Fix gem homepage
81
+ - DOCS: More gem documentation fixes
77
82
 
78
- * (No significant changes)
83
+ ## v0.20.0 / 2022-06-09
79
84
 
80
- ### v0.19.5 / 2022-05-02
85
+ - Upgrading Base dependency version
86
+ - FIXED: Broken test file requirements
81
87
 
82
- * FIXED: RubyGems Fallback
88
+ ## v0.19.6 / 2022-05-05
83
89
 
84
- ### v0.19.4 / 2022-02-02
90
+ - (No significant changes)
85
91
 
86
- * FIXED: Excessive hash creation on context attr merging
92
+ ## v0.19.5 / 2022-05-02
87
93
 
88
- ### v0.19.3 / 2021-12-01
94
+ - FIXED: RubyGems Fallback
89
95
 
90
- * FIXED: Change net attribute names to match the semantic conventions spec for http
96
+ ## v0.19.4 / 2022-02-02
91
97
 
92
- ### v0.19.2 / 2021-09-29
98
+ - FIXED: Excessive hash creation on context attr merging
93
99
 
94
- * (No significant changes)
100
+ ## v0.19.3 / 2021-12-01
95
101
 
96
- ### v0.19.1 / 2021-08-12
102
+ - FIXED: Change net attribute names to match the semantic conventions spec for http
97
103
 
98
- * (No significant changes)
104
+ ## v0.19.2 / 2021-09-29
99
105
 
100
- ### v0.19.0 / 2021-06-23
106
+ - (No significant changes)
101
107
 
102
- * BREAKING CHANGE: Total order constraint on span.status=
108
+ ## v0.19.1 / 2021-08-12
103
109
 
104
- * FIXED: Total order constraint on span.status=
110
+ - (No significant changes)
105
111
 
106
- ### v0.18.0 / 2021-05-21
112
+ ## v0.19.0 / 2021-06-23
107
113
 
108
- * ADDED: Updated API dependency for 1.0.0.rc1
114
+ - BREAKING CHANGE: Total order constraint on span.status=
115
+ - FIXED: Total order constraint on span.status=
109
116
 
110
- ### v0.17.0 / 2021-04-22
117
+ ## v0.18.0 / 2021-05-21
111
118
 
112
- * FIXED: Refactor propagators to add #fields
119
+ - ADDED: Updated API dependency for 1.0.0.rc1
113
120
 
114
- ### v0.16.2 / 2021-03-29
121
+ ## v0.17.0 / 2021-04-22
115
122
 
116
- * FIXED: HTTP instrumenter should check for gem presence
123
+ - FIXED: Refactor propagators to add #fields
117
124
 
118
- ### v0.16.1 / 2021-03-25
125
+ ## v0.16.2 / 2021-03-29
119
126
 
120
- * FIXED: HTTP instrumentation missing require
127
+ - FIXED: HTTP Instrumentation should check for gem presence
121
128
 
122
- ### v0.16.0 / 2021-03-17
129
+ ## v0.16.1 / 2021-03-25
123
130
 
124
- * Initial release.
131
+ - FIXED: HTTP instrumentation missing require
132
+
133
+ ## v0.16.0 / 2021-03-17
134
+
135
+ - Initial release.
data/README.md CHANGED
@@ -67,16 +67,12 @@ The `opentelemetry-instrumentation-http` gem is distributed under the Apache 2.0
67
67
 
68
68
  ## HTTP semantic convention stability
69
69
 
70
- In the OpenTelemetry ecosystem, HTTP semantic conventions have now reached a stable state. However, the initial HTTP instrumentation was introduced before this stability was achieved, which resulted in HTTP attributes being based on an older version of the semantic conventions.
71
-
72
- 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.
70
+ 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.
73
71
 
74
72
  When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
75
73
 
76
- - `http` - Emits the stable HTTP and networking conventions and ceases emitting the old conventions previously emitted by the instrumentation.
77
- - `http/dup` - Emits both the old and stable HTTP and networking conventions, enabling a phased rollout of the stable semantic conventions.
78
- - Default behavior (in the absence of either value) is to continue emitting the old HTTP and networking conventions the instrumentation previously emitted.
79
-
80
- During the transition from old to stable conventions, HTTP instrumentation code comes in three patch versions: `dup`, `old`, and `stable`. These versions are identical except for the attributes they send. Any changes to HTTP instrumentation should consider all three patches.
74
+ - `http` - Emits the stable HTTP and networking conventions.
75
+ - `http/dup` - **DEPRECATED: Will be removed on April 15, 2026.** Emits both the old and stable HTTP and networking conventions.
76
+ - `old` - **DEPRECATED: Will be removed on April 15, 2026.** Emits the old HTTP and networking conventions.
81
77
 
82
78
  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
@@ -26,14 +26,20 @@ module OpenTelemetry
26
26
  values = stability_opt_in.split(',').map(&:strip)
27
27
 
28
28
  if values.include?('http/dup')
29
+ emit_old_semconv_deprecation_warning('http/dup')
29
30
  'dup'
30
- elsif values.include?('http')
31
- 'stable'
32
- else
31
+ elsif values.include?('old')
32
+ emit_old_semconv_deprecation_warning('old')
33
33
  'old'
34
+ else
35
+ 'stable'
34
36
  end
35
37
  end
36
38
 
39
+ def emit_old_semconv_deprecation_warning(option)
40
+ 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.")
41
+ end
42
+
37
43
  def patch_old
38
44
  ::HTTP::Client.prepend(Patches::Old::Client)
39
45
  ::HTTP::Connection.prepend(Patches::Old::Connection)
@@ -16,30 +16,27 @@ module OpenTelemetry
16
16
  HTTP_STATUS_SUCCESS_RANGE = (100..399)
17
17
 
18
18
  def perform(req, options)
19
- span_data = HttpHelper.span_attrs_for(req.verb)
19
+ span_data = HttpHelper.span_attrs_for_dup(req.verb)
20
20
 
21
21
  uri = req.uri
22
22
  span_name = create_span_name(span_data, uri.path)
23
23
 
24
24
  attributes = {
25
25
  # old semconv
26
- 'http.method' => span_data.normalized_method,
27
26
  'http.scheme' => uri.scheme,
28
27
  'http.target' => uri.path,
29
28
  'http.url' => "#{uri.scheme}://#{uri.host}",
30
29
  'net.peer.name' => uri.host,
31
30
  'net.peer.port' => uri.port,
32
31
  # stable semconv
33
- 'http.request.method' => span_data.normalized_method,
34
32
  'url.scheme' => uri.scheme,
35
33
  'url.path' => uri.path,
36
34
  'url.full' => "#{uri.scheme}://#{uri.host}",
37
35
  'server.address' => uri.host,
38
36
  'server.port' => uri.port
39
37
  }
40
- attributes['http.request.method_original'] = span_data.original_method if span_data.original_method
41
38
  attributes['url.query'] = uri.query unless uri.query.nil?
42
- attributes.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
39
+ attributes.merge!(span_data.attributes)
43
40
 
44
41
  tracer.in_span(span_name, attributes: attributes, kind: :client) do |span|
45
42
  OpenTelemetry.propagation.inject(req.headers)
@@ -68,7 +65,9 @@ module OpenTelemetry
68
65
  default_span_name = span_data.span_name
69
66
 
70
67
  if (implementation = config[:span_name_formatter])
71
- updated_span_name = implementation.call(span_data.normalized_method, request_path)
68
+ # Extract the HTTP method from attributes (old semconv key)
69
+ http_method = span_data.attributes['http.method'] || span_data.attributes['http.request.method']
70
+ updated_span_name = implementation.call(http_method, request_path)
72
71
  updated_span_name.is_a?(String) ? updated_span_name : default_span_name
73
72
  else
74
73
  default_span_name
@@ -16,19 +16,18 @@ module OpenTelemetry
16
16
  HTTP_STATUS_SUCCESS_RANGE = (100..399)
17
17
 
18
18
  def perform(req, options)
19
- span_data = HttpHelper.span_attrs_for(req.verb, semconv: :old)
19
+ span_data = HttpHelper.span_attrs_for_old(req.verb)
20
20
 
21
21
  uri = req.uri
22
22
  span_name = create_span_name(span_data, uri.path)
23
23
 
24
24
  attributes = {
25
- 'http.method' => span_data.normalized_method,
26
25
  'http.scheme' => uri.scheme,
27
26
  'http.target' => uri.path,
28
27
  'http.url' => "#{uri.scheme}://#{uri.host}",
29
28
  'net.peer.name' => uri.host,
30
29
  'net.peer.port' => uri.port
31
- }.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
30
+ }.merge!(span_data.attributes)
32
31
 
33
32
  tracer.in_span(span_name, attributes: attributes, kind: :client) do |span|
34
33
  OpenTelemetry.propagation.inject(req.headers)
@@ -56,7 +55,9 @@ module OpenTelemetry
56
55
  default_span_name = span_data.span_name
57
56
 
58
57
  if (implementation = config[:span_name_formatter])
59
- updated_span_name = implementation.call(span_data.normalized_method, request_path)
58
+ # Extract the HTTP method from attributes
59
+ http_method = span_data.attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD]
60
+ updated_span_name = implementation.call(http_method, request_path)
60
61
  updated_span_name.is_a?(String) ? updated_span_name : default_span_name
61
62
  else
62
63
  default_span_name
@@ -16,22 +16,18 @@ module OpenTelemetry
16
16
  HTTP_STATUS_SUCCESS_RANGE = (100..399)
17
17
 
18
18
  def perform(req, options)
19
- span_data = HttpHelper.span_attrs_for(req.verb)
19
+ span_data = HttpHelper.span_attrs_for_stable(req.verb)
20
20
 
21
21
  uri = req.uri
22
22
  span_name = create_span_name(span_data, uri.path)
23
23
 
24
- attributes = {
25
- 'http.request.method' => span_data.normalized_method,
26
- 'url.scheme' => uri.scheme,
27
- 'url.path' => uri.path,
28
- 'url.full' => "#{uri.scheme}://#{uri.host}",
29
- 'server.address' => uri.host,
30
- 'server.port' => uri.port
31
- }
32
- attributes['http.request.method_original'] = span_data.original_method if span_data.original_method
24
+ attributes = { 'url.scheme' => uri.scheme,
25
+ 'url.path' => uri.path,
26
+ 'url.full' => "#{uri.scheme}://#{uri.host}",
27
+ 'server.address' => uri.host,
28
+ 'server.port' => uri.port }
33
29
  attributes['url.query'] = uri.query unless uri.query.nil?
34
- attributes.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)
30
+ attributes.merge!(span_data.attributes)
35
31
 
36
32
  tracer.in_span(span_name, attributes: attributes, kind: :client) do |span|
37
33
  OpenTelemetry.propagation.inject(req.headers)
@@ -59,7 +55,9 @@ module OpenTelemetry
59
55
  default_span_name = span_data.span_name
60
56
 
61
57
  if (implementation = config[:span_name_formatter])
62
- updated_span_name = implementation.call(span_data.normalized_method, request_path)
58
+ # Extract the HTTP method from attributes
59
+ http_method = span_data.attributes['http.request.method']
60
+ updated_span_name = implementation.call(http_method, request_path)
63
61
  updated_span_name.is_a?(String) ? updated_span_name : default_span_name
64
62
  else
65
63
  default_span_name
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module HTTP
10
- VERSION = '0.27.1'
10
+ VERSION = '0.30.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-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.1
4
+ version: 0.30.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-25 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
@@ -51,11 +50,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
51
50
  licenses:
52
51
  - Apache-2.0
53
52
  metadata:
54
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-http/0.27.1/file/CHANGELOG.md
55
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/http
53
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-http/0.30.0/file/CHANGELOG.md
54
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/opentelemetry-instrumentation-http/v0.30.0/instrumentation/http
56
55
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
57
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-http/0.27.1
58
- post_install_message:
56
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-http/0.30.0
59
57
  rdoc_options: []
60
58
  require_paths:
61
59
  - lib
@@ -63,15 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
61
  requirements:
64
62
  - - ">="
65
63
  - !ruby/object:Gem::Version
66
- version: '3.2'
64
+ version: '3.3'
67
65
  required_rubygems_version: !ruby/object:Gem::Requirement
68
66
  requirements:
69
67
  - - ">="
70
68
  - !ruby/object:Gem::Version
71
69
  version: '0'
72
70
  requirements: []
73
- rubygems_version: 3.4.19
74
- signing_key:
71
+ rubygems_version: 4.0.6
75
72
  specification_version: 4
76
73
  summary: HTTP instrumentation for the OpenTelemetry framework
77
74
  test_files: []