Skip to content

Commit 201d59c

Browse files
Merge branch 'main' into dependabot/github_actions/ruby/setup-ruby-1.245.0
2 parents 5df4bd5 + 62e4b1c commit 201d59c

File tree

25 files changed

+1038
-139
lines changed

25 files changed

+1038
-139
lines changed

instrumentation/action_pack/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History: opentelemetry-instrumentation-action_pack
22

3+
### v0.12.3 / 2025-06-16
4+
5+
* FIXED: Action_pack always assuming sdk spans
6+
37
### v0.12.2 / 2025-06-04
48

59
* FIXED: Rack span class naming

instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module OpenTelemetry
88
module Instrumentation
99
module ActionPack
10-
VERSION = '0.12.2'
10+
VERSION = '0.12.3'
1111
end
1212
end
1313
end

instrumentation/all/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History: opentelemetry-instrumentation-all
22

3+
### v0.78.0 / 2025-06-17
4+
5+
* ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable to HTTP.rb instrumentation [#1547](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1547)
6+
37
### v0.77.0 / 2025-06-03
48

59
* ADDED: Suppress internal spans with Faraday instrumentation

instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
module OpenTelemetry
88
module Instrumentation
99
module All
10-
VERSION = '0.77.0'
10+
VERSION = '0.78.0'
1111
end
1212
end
1313
end

instrumentation/all/opentelemetry-instrumentation-all.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
4040
spec.add_dependency 'opentelemetry-instrumentation-graphql', '~> 0.29.0'
4141
spec.add_dependency 'opentelemetry-instrumentation-grpc', '~> 0.2.0'
4242
spec.add_dependency 'opentelemetry-instrumentation-gruf', '~> 0.3.0'
43-
spec.add_dependency 'opentelemetry-instrumentation-http', '~> 0.24.0'
43+
spec.add_dependency 'opentelemetry-instrumentation-http', '~> 0.25.0'
4444
spec.add_dependency 'opentelemetry-instrumentation-http_client', '~> 0.23.0'
4545
spec.add_dependency 'opentelemetry-instrumentation-koala', '~> 0.21.0'
4646
spec.add_dependency 'opentelemetry-instrumentation-lmdb', '~> 0.23.0'

instrumentation/http/Appraisals

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
appraise 'http-4.4' do
8-
gem 'http', '~> 4.4.0'
9-
end
7+
# To faclitate HTTP semantic convention stability migration, we are using
8+
# appraisal to test the different semantic convention modes along with different
9+
# HTTP gem versions. For more information on the semantic convention modes, see:
10+
# https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/
11+
12+
semconv_stability = %w[dup stable old]
13+
14+
semconv_stability.each do |mode|
15+
appraise "http-4.4.0-#{mode}" do
16+
gem 'http', '~> 4.4.0'
17+
end
1018

11-
appraise 'http-3.3.0' do
12-
gem 'http', '~> 3.3.0'
19+
appraise "http-3.3.0-#{mode}" do
20+
gem 'http', '~> 3.3.0'
21+
end
1322
end

instrumentation/http/CHANGELOG.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History: opentelemetry-instrumentation-http
22

3+
### v0.25.0 / 2025-06-17
4+
5+
* ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable [#1547](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1547)
6+
37
### v0.24.0 / 2025-01-16
48

59
* BREAKING CHANGE: Set minimum supported version to Ruby 3.1
@@ -24,44 +28,44 @@
2428

2529
### v0.23.1 / 2023-06-05
2630

27-
* FIXED: Base config options
31+
* FIXED: Base config options
2832

2933
### v0.23.0 / 2023-05-15
3034

31-
* ADDED: Add span_preprocessor hook
35+
* ADDED: Add span_preprocessor hook
3236

3337
### v0.22.0 / 2023-04-17
3438

35-
* BREAKING CHANGE: Drop support for EoL Ruby 2.7
39+
* BREAKING CHANGE: Drop support for EoL Ruby 2.7
3640

37-
* ADDED: Drop support for EoL Ruby 2.7
41+
* ADDED: Drop support for EoL Ruby 2.7
3842

3943
### v0.21.0 / 2023-01-14
4044

41-
* ADDED: Add request/response hooks to more http clients
42-
* DOCS: Fix gem homepage
43-
* DOCS: More gem documentation fixes
45+
* ADDED: Add request/response hooks to more http clients
46+
* DOCS: Fix gem homepage
47+
* DOCS: More gem documentation fixes
4448

4549
### v0.20.0 / 2022-06-09
4650

4751
* Upgrading Base dependency version
48-
* FIXED: Broken test file requirements
52+
* FIXED: Broken test file requirements
4953

5054
### v0.19.6 / 2022-05-05
5155

5256
* (No significant changes)
5357

5458
### v0.19.5 / 2022-05-02
5559

56-
* FIXED: RubyGems Fallback
60+
* FIXED: RubyGems Fallback
5761

5862
### v0.19.4 / 2022-02-02
5963

60-
* FIXED: Excessive hash creation on context attr merging
64+
* FIXED: Excessive hash creation on context attr merging
6165

6266
### v0.19.3 / 2021-12-01
6367

64-
* FIXED: Change net attribute names to match the semantic conventions spec for http
68+
* FIXED: Change net attribute names to match the semantic conventions spec for http
6569

6670
### v0.19.2 / 2021-09-29
6771

@@ -73,9 +77,9 @@
7377

7478
### v0.19.0 / 2021-06-23
7579

76-
* BREAKING CHANGE: Total order constraint on span.status=
80+
* BREAKING CHANGE: Total order constraint on span.status=
7781

78-
* FIXED: Total order constraint on span.status=
82+
* FIXED: Total order constraint on span.status=
7983

8084
### v0.18.0 / 2021-05-21
8185

instrumentation/http/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,19 @@ The `opentelemetry-instrumentation-http` gem is distributed under the Apache 2.0
6464
[community-meetings]: https://github.com/open-telemetry/community#community-meetings
6565
[slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY
6666
[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
67+
68+
## HTTP semantic convention stability
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.
73+
74+
When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
75+
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.
81+
82+
For additional information on migration, please refer to our [documentation](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/).

instrumentation/http/lib/opentelemetry/instrumentation/http/instrumentation.rb

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ module HTTP
1010
# The Instrumentation class contains logic to detect and install the Http instrumentation
1111
class Instrumentation < OpenTelemetry::Instrumentation::Base
1212
install do |_config|
13-
require_dependencies
14-
patch
13+
patch_type = determine_semconv
14+
send(:"require_dependencies_#{patch_type}")
15+
send(:"patch_#{patch_type}")
1516
end
1617

1718
present do
@@ -20,14 +21,47 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
2021

2122
option :span_name_formatter, default: nil, validate: :callable
2223

23-
def patch
24-
::HTTP::Client.prepend(Patches::Client)
25-
::HTTP::Connection.prepend(Patches::Connection)
24+
def determine_semconv
25+
stability_opt_in = ENV.fetch('OTEL_SEMCONV_STABILITY_OPT_IN', '')
26+
values = stability_opt_in.split(',').map(&:strip)
27+
28+
if values.include?('http/dup')
29+
'dup'
30+
elsif values.include?('http')
31+
'stable'
32+
else
33+
'old'
34+
end
35+
end
36+
37+
def patch_old
38+
::HTTP::Client.prepend(Patches::Old::Client)
39+
::HTTP::Connection.prepend(Patches::Old::Connection)
40+
end
41+
42+
def patch_dup
43+
::HTTP::Client.prepend(Patches::Dup::Client)
44+
::HTTP::Connection.prepend(Patches::Dup::Connection)
45+
end
46+
47+
def patch_stable
48+
::HTTP::Client.prepend(Patches::Stable::Client)
49+
::HTTP::Connection.prepend(Patches::Stable::Connection)
50+
end
51+
52+
def require_dependencies_dup
53+
require_relative 'patches/dup/client'
54+
require_relative 'patches/dup/connection'
55+
end
56+
57+
def require_dependencies_old
58+
require_relative 'patches/old/client'
59+
require_relative 'patches/old/connection'
2660
end
2761

28-
def require_dependencies
29-
require_relative 'patches/client'
30-
require_relative 'patches/connection'
62+
def require_dependencies_stable
63+
require_relative 'patches/stable/client'
64+
require_relative 'patches/stable/connection'
3165
end
3266
end
3367
end

instrumentation/http/lib/opentelemetry/instrumentation/http/patches/client.rb

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)