-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Strip Rails (.:format)
suffix from http.route
#1375
feat: Strip Rails (.:format)
suffix from http.route
#1375
Conversation
http.route
(.:format)
suffix from http.route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left a request to use chomp
as opposed to gsub
to achieve this.
Please also make sure to review the contributing guide that requests you use conventional commit format for the PR title and individual commits.
I am also surprised that tests passed for this!
If you are able to help us track down why there were no test failures or updates accompanied with this change that would be grately appreciated.
...tion/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb
Outdated
Show resolved
Hide resolved
Thanks for the review, @arielvalentin! Happy to make that change, and make sure there is test coverage for attributes. I tried to run the tests according to the instructions in the README but got the error below. Is there a particular version of Ruby I need to be running? Any help would be appreciated.
|
Time to update the README! 😿 The gems are executed using
That will end up running several versions of Rails that we aim to support. If you want to focus on a specific version check out the appraisal docs for more info. Thanks again for your help. |
After running
I tried adding |
(.:format)
suffix from http.route
(.:format)
suffix from http.route
ee144f7
to
7b796a6
Compare
@akahn I have to admit, I am a little perplexed. What version of Ruby and Bundler are you running? |
Edit: I've downgraded to Ruby 3.3.4, and now have this working. |
This is because there are no tests for the I've tried adding them but it seems that |
I took a look at what the GitHub actions were doing and did the same by manually setting |
91472bc
to
e89fe75
Compare
@akahn - I'm surprised that All I ran from inside
I think it might be an issue on your machine, but I'm curious if others are running into the same problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arielvalentin @akahn, since this PR changes the value of an attribute, I'm leaning toward the conventional commit prefix being a feat
instead of a chore
. What do you think? Should this initiate a release?
I agree. |
The error is happening in Ruby 3.4 but our test matrix isn't up to date yet. I have a separate PR to add test coverage here: #1347 For now I recommend running the tests with Ruby 3.3 if possible to get them running in your development environment. |
e89fe75
to
ed04a56
Compare
(.:format)
suffix from http.route
(.:format)
suffix from http.route
ed04a56
to
4fffe3a
Compare
Thanks for all the guidance. I've renamed the commit and PR to be |
@@ -58,6 +58,14 @@ | |||
_(span.attributes['code.function']).must_equal 'ok' | |||
end | |||
|
|||
it 'strips (:format) from http.route' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test can probably be consolidated with another one but I see why being explicit here is helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I noticed the tests were a bit disjointed, but I thought I would leave that to the maintainers or someone more familiar with the project, and to a future PR.
There's an existing describe
block for span naming, broken down by Rails version. Maybe there could be another one for span attributes, broken down by Rails version, that this could go in. Alternatively, there could be separate top-level blocks for Rails versions, each with naming and span sections within.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @akahn!
My pleasure @kaylareopelle. What is the release schedule for this gem? My team would love to get this running in our production app. |
Hi @akahn! We generally release on Tuesdays near the time of our SIG meeting. Unless someone can fit it in sooner, expect a new release then. |
Hi @akahn - This code has been released! You can access it through:
|
In our OpenTelemetry spans, all
http.route
values end in(.:format)
. This is unsightly and does not help when diagnosing an issue using traces. It also stands out as different from thehttp.route
produced by other language's OTel SDKs, which only include parts of the URL path itself.With this change, we strip this suffix from
http.route
, just like we are already doing for the span name.