Fix otelhttp span names to match the semantic conventions#8871
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8871 +/- ##
=====================================
Coverage 83.4% 83.5%
=====================================
Files 193 193
Lines 15850 15898 +48
=====================================
+ Hits 13232 13285 +53
+ Misses 2146 2141 -5
Partials 472 472
🚀 New features to boost your workflow:
|
MrAlias
left a comment
There was a problem hiding this comment.
This is close, but I think the new default formatter still misses a couple of cases needed to actually match the HTTP span-name rules.
The main issue is that it uses r.Pattern verbatim, while the rest of otelhttp already treats that value as needing normalization before it becomes http.route. There is also still a gap for nonstandard methods, where the span name should fall back to HTTP instead of the raw method string.
I’d prefer to fix those in this PR so the new default naming is aligned with the existing route/method normalization logic.
|
I have moved the span name computation into the semconv internal package, so we can reuse the |
Closes #726