opentelemetry-instrumentation-httpx 0.6.1 → 0.7.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: 7f74f31524d99c5a0565edf84892292d068322376584c58b7dc4aabbdea724fd
4
- data.tar.gz: 74cdecfb4c9c7a7e3fe0164ce3977d53e33d4fa96c140265629b401f1e0dce77
3
+ metadata.gz: dee6788e01f6bee9648300b13883d1a96079b563b383996970a335c09c4921d7
4
+ data.tar.gz: 2803c112624eb85b0f1d745a83e846534fb84d0a6bd6e42aefaac8ac2f792b26
5
5
  SHA512:
6
- metadata.gz: 7f78e75c32d2fd6df5635ffac615ff7fdf7ff987b9ad93970d32d171887184ca2652f081569d843705dd45f715c6a08a592ef461186f02b1c610045a5ffabe11
7
- data.tar.gz: efa536643cab0d4d878acb262d62ab2936bb0ce82e70368d2bd7c6367a2781afe327eedfaafb08fa6df1e5f4cb91eb63763008f416698b1130d8b834902e57df
6
+ metadata.gz: a95b9f5ae8c7daf8c2dbb029bf0bf84d28bf5c97c0e50b44f876805b592b4845699be314c442155a0694d353eaf148b64c432b8eae1daa00cf9a462f8dffa70e
7
+ data.tar.gz: 586164857d24afddfdd914c0e9d9533c27fbad8fc91978756578854cef275b87cad46c935b6ab98b4c3b8bd282214f79e817f9dbf6b18917342355746658b6d0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History: opentelemetry-instrumentation-httpx
2
2
 
3
+ ### v0.7.0 / 2026-03-17
4
+
5
+ * BREAKING CHANGE: Default to stable HTTP semantic conventions (#2051)
6
+ * ADDED: Default to stable HTTP semantic conventions (#2051)
7
+
3
8
  ### v0.6.1 / 2026-02-27
4
9
 
5
10
  * FIXED: Httpx support to ~> 1.6 adapt to request init_time (#2030)
data/README.md CHANGED
@@ -51,16 +51,12 @@ The `opentelemetry-instrumentation-httpx` gem is distributed under the Apache 2.
51
51
 
52
52
  ## HTTP semantic convention stability
53
53
 
54
- In the OpenTelemetry ecosystem, HTTP semantic conventions have now reached a stable state. However, the initial HTTPX instrumentation was introduced before this stability was achieved, which resulted in HTTP attributes being based on an older version of the semantic conventions.
55
-
56
- 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.
54
+ 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.
57
55
 
58
56
  When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
59
57
 
60
- - `http` - Emits the stable HTTP and networking conventions and ceases emitting the old conventions previously emitted by the instrumentation.
61
- - `http/dup` - Emits both the old and stable HTTP and networking conventions, enabling a phased rollout of the stable semantic conventions.
62
- - Default behavior (in the absence of either value) is to continue emitting the old HTTP and networking conventions the instrumentation previously emitted.
63
-
64
- During the transition from old to stable conventions, HTTPX instrumentation code comes in three patch versions: `dup`, `old`, and `stable`. These versions are identical except for the attributes they send. Any changes to HTTPX instrumentation should consider all three patches.
58
+ - `http` - Emits the stable HTTP and networking conventions.
59
+ - `http/dup` - **DEPRECATED: Will be removed on April 15, 2026.** Emits both the old and stable HTTP and networking conventions.
60
+ - `old` - **DEPRECATED: Will be removed on April 15, 2026.** Emits the old HTTP and networking conventions.
65
61
 
66
62
  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, :attributes, 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 = {
@@ -46,8 +46,8 @@ module OpenTelemetry
46
46
 
47
47
  private_constant :METHOD_CACHE
48
48
 
49
- OLD_SPAN_NAMES_BY_METHOD = METHOD_CACHE.values.uniq.each_with_object({}) do |method, hash|
50
- hash[method] = "HTTP #{method}"
49
+ OLD_SPAN_NAMES_BY_METHOD = METHOD_CACHE.values.uniq.to_h do |method|
50
+ [method, "HTTP #{method}"]
51
51
  end.freeze
52
52
 
53
53
  private_constant :OLD_SPAN_NAMES_BY_METHOD
@@ -30,14 +30,20 @@ module OpenTelemetry
30
30
  values = stability_opt_in.split(',').map(&:strip)
31
31
 
32
32
  if values.include?('http/dup')
33
+ emit_old_semconv_deprecation_warning('http/dup')
33
34
  'dup'
34
- elsif values.include?('http')
35
- 'stable'
36
- else
35
+ elsif values.include?('old')
36
+ emit_old_semconv_deprecation_warning('old')
37
37
  'old'
38
+ else
39
+ 'stable'
38
40
  end
39
41
  end
40
42
 
43
+ def emit_old_semconv_deprecation_warning(option)
44
+ 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.")
45
+ end
46
+
41
47
  def patch_old
42
48
  otel_session = ::HTTPX.plugin(Old::Plugin)
43
49
 
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module HTTPX
10
- VERSION = '0.6.1'
10
+ VERSION = '0.7.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
@@ -48,10 +48,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
48
48
  licenses:
49
49
  - Apache-2.0
50
50
  metadata:
51
- changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-httpx/0.6.1/file/CHANGELOG.md
51
+ changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-httpx/0.7.0/file/CHANGELOG.md
52
52
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/http
53
53
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
54
- documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-httpx/0.6.1
54
+ documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-httpx/0.7.0
55
55
  rdoc_options: []
56
56
  require_paths:
57
57
  - lib