Skip to content

Commit e45be20

Browse files
authored
Merge branch 'main' into mspletz/close-ethon-span
2 parents e9d77cf + 5d5ce06 commit e45be20

File tree

62 files changed

+4290
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4290
-710
lines changed

.github/workflows/fossa.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,33 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
1717

18+
- name: Install Ruby 3.4
19+
uses: ruby/[email protected]
20+
with:
21+
ruby-version: 3.4
22+
- name: Generate Gemfile.lock
23+
run: |
24+
echo "Finding all Gemfiles in the project..."
25+
echo "======================================="
26+
ORIGINAL_DIR=$(pwd)
27+
28+
find . -type f -name "Gemfile" -not -path "*/example/*" -not -path "*/releases/*" | sort | while read gemfile; do
29+
gemfile_dir=$(dirname "$gemfile")
30+
31+
# Change to the Gemfile's directory
32+
echo "Changing to directory: $gemfile_dir"
33+
34+
cd "$gemfile_dir" || continue
35+
36+
echo "Current directory: $(pwd)"
37+
echo "Creating lock file for: $gemfile"
38+
39+
# Generate the gemlock files
40+
bundle lock || echo "Warning: Failed to generate lock file for $gemfile, continuing..."
41+
42+
cd "$ORIGINAL_DIR" || exit 1
43+
done
44+
1845
- uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
1946
with:
2047
api-key: ${{secrets.FOSSA_API_KEY}}

.github/workflows/release-request-weekly.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ jobs:
2828
- name: Install Toys
2929
run: "gem install --no-document toys -v 0.15.5"
3030

31-
- name: Create otelbot token
32-
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
33-
id: otelbot-token
31+
- name: Create otelbot app token
32+
uses: actions/[email protected]
33+
id: app-token
3434
with:
35-
app-id: ${{ vars.OTELBOT_APP_ID }}
36-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
35+
app-id: ${{ vars.OTELBOT_RUBY_CONTRIB_APP_ID }}
36+
private-key: ${{ secrets.OTELBOT_RUBY_CONTRIB_PRIVATE_KEY }}
3737

3838
- name: Open release pull request
3939
env:
40-
GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }}
40+
# Using the app token instead of GITHUB_TOKEN to trigger workflows
41+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4142
run: |
4243
toys release request --yes --verbose \
4344
"--release-ref=${{ github.ref }}" \

.github/workflows/release-request.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ jobs:
3232
- name: Install Toys
3333
run: "gem install --no-document toys -v 0.15.5"
3434

35-
- name: Create otelbot token
36-
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
37-
id: otelbot-token
35+
- name: Create otelbot app token
36+
uses: actions/[email protected]
37+
id: app-token
3838
with:
39-
app-id: ${{ vars.OTELBOT_APP_ID }}
40-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
39+
app-id: ${{ vars.OTELBOT_RUBY_CONTRIB_APP_ID }}
40+
private-key: ${{ secrets.OTELBOT_RUBY_CONTRIB_PRIVATE_KEY }}
4141

4242
- name: Open release pull request
4343
env:
44-
GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }}
44+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4545
run: |
4646
toys release request --yes --verbose \
4747
"--gems=${{ github.event.inputs.gems }}" \

.github/workflows/release-retry.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,9 @@ jobs:
3535
- name: Install Toys
3636
run: "gem install --no-document toys -v 0.15.5"
3737

38-
- name: Create otelbot token
39-
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
40-
id: otelbot-token
41-
with:
42-
app-id: ${{ vars.OTELBOT_APP_ID }}
43-
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
44-
4538
- name: Retry release
4639
env:
47-
GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4841
run: |
4942
toys release retry --yes --verbose \
5043
"--enable-releases=${{ secrets.ENABLE_RELEASES }}" \

.instrumentation_generator/templates/Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
source 'https://rubygems.org'
88

9-
# DO NOT ADD DEPENDENCIES HERE!
10-
# Please declare a minimum development dependency in the gemspec,
11-
# then target specific versions in the Appraisals file.
12-
139
gemspec
1410

1511
group :test do

helpers/sql/Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
source 'https://rubygems.org'
88

9-
# DO NOT ADD DEPENDENCIES HERE!
10-
# Please declare a minimum development dependency in the gemspec,
11-
# then target specific versions in the Appraisals file.
12-
139
gemspec
1410

1511
group :test do

instrumentation/action_pack/CHANGELOG.md

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

3+
### v0.13.0 / 2025-08-19
4+
5+
* ADDED: Add `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable compatibility for Rack integration [#1594](https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/1594)
6+
37
### v0.12.3 / 2025-06-16
48

59
* FIXED: Action_pack always assuming sdk spans
@@ -30,7 +34,7 @@
3034

3135
### v0.9.0 / 2024-01-09
3236

33-
* BREAKING CHANGE: Use ActiveSupport instead of patches #703
37+
* BREAKING CHANGE: Use ActiveSupport instead of patches #703
3438

3539
### v0.8.0 / 2023-11-22
3640

@@ -45,32 +49,32 @@
4549
### v0.7.0 / 2023-06-05
4650

4751
* ADDED: Use Rack Middleware Helper
48-
* FIXED: Base config options
52+
* FIXED: Base config options
4953

5054
### v0.6.0 / 2023-04-17
5155

5256
* BREAKING CHANGE: Drop support for EoL Ruby 2.7
5357

54-
* ADDED: Drop support for EoL Ruby 2.7
58+
* ADDED: Drop support for EoL Ruby 2.7
5559

5660
### v0.5.0 / 2023-02-01
5761

58-
* BREAKING CHANGE: Drop Rails 5 Support
62+
* BREAKING CHANGE: Drop Rails 5 Support
5963

60-
* ADDED: Drop Rails 5 Support
61-
* FIXED: Drop Rails dependency for ActiveSupport Instrumentation
64+
* ADDED: Drop Rails 5 Support
65+
* FIXED: Drop Rails dependency for ActiveSupport Instrumentation
6266

6367
### v0.4.1 / 2023-01-14
6468

6569
* FIXED: String-ify code.function Span attribute
66-
* DOCS: Fix gem homepage
67-
* DOCS: More gem documentation fixes
70+
* DOCS: Fix gem homepage
71+
* DOCS: More gem documentation fixes
6872

6973
### v0.4.0 / 2022-12-06
7074

71-
* BREAKING CHANGE: Remove enable_recognize_route and span_naming options
75+
* BREAKING CHANGE: Remove enable_recognize_route and span_naming options
7276

73-
* FIXED: Remove enable_recognize_route and span_naming options
77+
* FIXED: Remove enable_recognize_route and span_naming options
7478

7579
### v0.3.2 / 2022-11-16
7680

@@ -82,29 +86,29 @@
8286

8387
### v0.3.0 / 2022-10-14
8488

85-
* ADDED: Name ActionPack spans with the HTTP method and route
89+
* ADDED: Name ActionPack spans with the HTTP method and route
8690

8791
### v0.2.1 / 2022-10-04
8892

89-
* FIXED: Ensures the correct route is add to http.route span attribute
93+
* FIXED: Ensures the correct route is add to http.route span attribute
9094

9195
### v0.2.0 / 2022-06-09
9296

9397
* Upgrading Base dependency version
94-
* FIXED: Broken test file requirements
98+
* FIXED: Broken test file requirements
9599

96100
### v0.1.4 / 2022-05-02
97101

98-
* FIXED: Use rails request's filtered path as http.target attribute
99-
* FIXED: RubyGems Fallback
102+
* FIXED: Use rails request's filtered path as http.target attribute
103+
* FIXED: RubyGems Fallback
100104

101105
### v0.1.3 / 2021-12-01
102106

103-
* FIXED: Instrumentation of Rails 7
107+
* FIXED: Instrumentation of Rails 7
104108

105109
### v0.1.2 / 2021-10-06
106110

107-
* FIXED: Prevent high cardinality rack span name as a default
111+
* FIXED: Prevent high cardinality rack span name as a default
108112

109113
### v0.1.1 / 2021-09-29
110114

instrumentation/action_pack/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,21 @@ The `opentelemetry-instrumentation-action_pack` gem is distributed under the Apa
8989
[slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY
9090
[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
9191
[rails-home]: https://rubyonrails.org/
92+
93+
## HTTP semantic convention stability
94+
95+
In the OpenTelemetry ecosystem, HTTP semantic conventions have now reached a stable state. However, the initial Rack instrumentation, which Action Pack relies on, was introduced before this stability was achieved, which resulted in HTTP attributes being based on an older version of the semantic conventions.
96+
97+
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.
98+
99+
Sinatra instrumentation installs Rack middleware, but the middleware version it installs depends on which `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable is set.
100+
101+
When setting the value for `OTEL_SEMCONV_STABILITY_OPT_IN`, you can specify which conventions you wish to adopt:
102+
103+
- `http` - Emits the stable HTTP and networking conventions and ceases emitting the old conventions previously emitted by the instrumentation.
104+
- `http/dup` - Emits both the old and stable HTTP and networking conventions, enabling a phased rollout of the stable semantic conventions.
105+
- Default behavior (in the absence of either value) is to continue emitting the old HTTP and networking conventions the instrumentation previously emitted.
106+
107+
During the transition from old to stable conventions, Rack instrumentation code comes in three patch versions: `dup`, `old`, and `stable`. These versions are identical except for the attributes they send. Any changes to Rack instrumentation should consider all three patches.
108+
109+
For additional information on migration, please refer to our [documentation](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/).

instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/railtie.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@ class Railtie < ::Rails::Railtie
1212
config.before_initialize do |app|
1313
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.install({})
1414

15+
stability_opt_in = ENV.fetch('OTEL_SEMCONV_STABILITY_OPT_IN', '')
16+
values = stability_opt_in.split(',').map(&:strip)
17+
18+
rack_middleware_args = if values.include?('http/dup')
19+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_dup
20+
elsif values.include?('http')
21+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args_stable
22+
else
23+
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args
24+
end
25+
1526
app.middleware.insert_before(
1627
0,
17-
*OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.middleware_args
28+
*rack_middleware_args
1829
)
1930
end
2031
end

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.3'
10+
VERSION = '0.13.0'
1111
end
1212
end
1313
end

0 commit comments

Comments
 (0)