Skip to content

Commit d69402b

Browse files
Merge branch 'main' into 1173-2
2 parents 07985df + 7ad08f9 commit d69402b

File tree

93 files changed

+446
-220
lines changed

Some content is hidden

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

93 files changed

+446
-220
lines changed

.github/actions/test_gem/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ runs:
9595
run: |
9696
# 💎 Install dependencies and generate appraisals 💎
9797
bundle install --quiet --jobs=3 --retry=4
98+
bundle exec appraisal clean
9899
bundle exec appraisal generate
99100
working-directory: "${{ steps.setup.outputs.gem_dir }}"
100101

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# Appraisals
1414
instrumentation/**/gemfiles
15+
instrumentation/**/tmp/**/*
1516

1617
# Sqlite file for tests
1718
instrumentation/active_record/db
@@ -26,3 +27,4 @@ instrumentation/active_record/db
2627
.ruby-version
2728

2829
tags
30+
!**/*/.gitkeep

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
source 'https://rubygems.org'
88

99
gem 'rake', '~> 13.0'
10-
gem 'rubocop', '~> 1.67.0'
10+
gem 'rubocop', '~> 1.68.0'
1111
gem 'rubocop-performance', '~> 1.21.0'

helpers/mysql/opentelemetry-helpers-mysql.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
3232
spec.add_development_dependency 'minitest', '~> 5.0'
3333
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
3434
spec.add_development_dependency 'rake', '~> 13.0'
35-
spec.add_development_dependency 'rubocop', '~> 1.67.0'
35+
spec.add_development_dependency 'rubocop', '~> 1.68.0'
3636
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
3737
spec.add_development_dependency 'simplecov', '~> 0.22.0'
3838
spec.add_development_dependency 'yard', '~> 0.9'

helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
3131
spec.add_development_dependency 'minitest', '~> 5.0'
3232
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
3333
spec.add_development_dependency 'rake', '~> 13.0'
34-
spec.add_development_dependency 'rubocop', '~> 1.67.0'
34+
spec.add_development_dependency 'rubocop', '~> 1.68.0'
3535
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
3636
spec.add_development_dependency 'yard', '~> 0.9'
3737
spec.add_development_dependency 'yard-doctest', '~> 0.1.6'

instrumentation/action_mailer/Appraisals

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

7-
appraise 'rails-6.1' do
8-
gem 'rails', '~> 6.1.0'
9-
end
10-
11-
appraise 'rails-7.0' do
12-
gem 'rails', '~> 7.0.0'
13-
end
14-
15-
appraise 'rails-7.1' do
16-
gem 'rails', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "action_mailer-#{version}" do
9+
gem 'rails', "~> #{version}"
10+
end
1711
end
1812

1913
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'rails-7.2' do
21-
gem 'rails', '~> 7.2.0'
14+
%w[7.2.0].each do |version|
15+
appraise "action_mailer-#{version}" do
16+
gem 'rails', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'action_mailer-latest' do
21+
gem 'rails'
2222
end
2323
end

instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
3535
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
3636
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
3737
spec.add_development_dependency 'rake', '~> 13.0'
38-
spec.add_development_dependency 'rubocop', '~> 1.67.0'
38+
spec.add_development_dependency 'rubocop', '~> 1.68.0'
3939
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
4040
spec.add_development_dependency 'simplecov', '~> 0.17.1'
4141
spec.add_development_dependency 'webmock', '~> 3.24.0'

instrumentation/action_pack/Appraisals

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

7-
appraise 'rails-6.1' do
8-
gem 'rails', '~> 6.1.0'
9-
end
10-
11-
appraise 'rails-7.0' do
12-
gem 'rails', '~> 7.0.0'
13-
end
14-
15-
appraise 'rails-7.1' do
16-
gem 'rails', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "rails-#{version}" do
9+
gem 'rails', "~> #{version}"
10+
end
1711
end
1812

1913
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'rails-7.2' do
21-
gem 'rails', '~> 7.2.0'
14+
%w[7.2.0].each do |version|
15+
appraise "rails-#{version}" do
16+
gem 'rails', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'rails-latest' do
21+
gem 'rails'
2222
end
2323
end

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.10.0 / 2024-11-19
4+
5+
* ADDED: Use Semconv Naming For ActionPack
6+
37
### v0.9.0 / 2024-01-09
48

59
* BREAKING CHANGE: Use ActiveSupport instead of patches #703

instrumentation/action_pack/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@ See the table below for details of what [Rails Framework Hook Events](https://gu
4242
| - | - | - | - |
4343
| `process_action.action_controller` | :white_check_mark: | :x: | It modifies the existing Rack span |
4444

45+
## Semantic Conventions
46+
47+
This instrumentation generally uses [HTTP server semantic conventions](https://opentelemetry.io/docs/specs/semconv/http/http-spans/) to update the existing Rack span.
48+
49+
For Rails 7.1+, the span name is updated to match the HTTP method and route that was matched for the request using [`ActionDispatch::Request#route_uri_pattern`](https://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-route_uri_pattern), e.g.: `GET /users/:id`
50+
51+
For older versions of Rails the span name is updated to match the HTTP method, controller, and action name that was the target of the request, e.g.: `GET /example/index`
52+
53+
> ![NOTE]: Users may override the `span_naming` option to default to Legacy Span Naming Behavior that uses the controller's class name and action in Ruby documentation syntax, e.g. `ExampleController#index`.
54+
55+
This instrumentation does not emit any custom attributes.
56+
57+
| Attribute Name | Type | Notes |
58+
| - | - | - |
59+
| `code.namespace` | String | `ActionController` class name |
60+
| `code.function` | String | `ActionController` action name e.g. `index`, `show`, `edit`, etc... |
61+
| `http.route` | String | (Rails 7.1+) the route that was matched for the request |
62+
| `http.target` | String | The `request.filtered_path` |
63+
4564
### Error Handling for Action Controller
4665

4766
If an error is triggered by Action Controller (such as a 500 internal server error), Action Pack will typically employ the default `ActionDispatch::PublicExceptions.new(Rails.public_path)` as the `exceptions_app`, as detailed in the [documentation](https://guides.rubyonrails.org/configuring.html#config-exceptions-app).

0 commit comments

Comments
 (0)