feat(net/http/otelhttp): Add http.route attribute#8632
feat(net/http/otelhttp): Add http.route attribute#8632dmathieu merged 18 commits intoopen-telemetry:mainfrom
http.route attribute#8632Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8632 +/- ##
=======================================
- Coverage 82.2% 82.2% -0.1%
=======================================
Files 183 183
Lines 13907 13919 +12
=======================================
+ Hits 11443 11444 +1
- Misses 2056 2067 +11
Partials 408 408
🚀 New features to boost your workflow:
|
pellared
left a comment
There was a problem hiding this comment.
Can you please create an issue first?
It's recommended that you signal your intention to contribute in the issue tracker, either by filing a new issue or by claiming an existing one.
|
Could this be done with a Labeler? |
|
I created an issue where I tried to explain my motivation: #8633 |
|
I changed the logic so that the attribute is recorded by default, with an option to disable it. There is also still the question of moving the |
http.route attribute
Sure it could, but @pellared pointed out in the issue that this attribute should always (when it is available) be recorded by default. |
|
Sure, though this is not what that PR was doing when I left my comment. |
So it turns out the option is not needed at all. What about moving the |
|
I think this PR is ready to merge. |
|
I'm waiting for @pellared's review, since he requested changes. |
Issue has been created and I added it to the PR description.
pellared
left a comment
There was a problem hiding this comment.
It looks that the description in #8633 is not updated
I also do not follow the following part of the current PR description
The
routeFromRequestfunction code is duplicated, and it might be better to move it to semconv.HTTPServer.
Can you please update the issue and PR description?
@pellared thanks for the review, I will update the issue description and this PR. |
Fixes #8633
In this pull request, I add recording of the
http.routemetric attribute fornet/http/otelhttp.This PR does not affect any instrumentation other than
otelhttp, because the checkif route == "" && req.Pattern != ""is triggered only inotelhttp.