-
Notifications
You must be signed in to change notification settings - Fork 579
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
otelgin: Using c.FullPath()
to set http.route
attribute
#5732
Conversation
Could you add a test, as well as a changelog entry? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5732 +/- ##
=====================================
Coverage 63.8% 63.8%
=====================================
Files 194 194
Lines 12238 12236 -2
=====================================
- Hits 7818 7817 -1
Misses 4197 4197
+ Partials 223 222 -1
|
@dmathieu Done. |
// SpanNameFormatter is used to set span name by http.request. | ||
type SpanNameFormatter func(r *http.Request) string | ||
// SpanNameFormatter is used to set span name by http.Request. | ||
type SpanNameFormatter func(routeName string, r *http.Request) string |
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 changes the public API, and isn't what the PR describes. It should be its own PR.
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.
OK, I will create two PR for those changes.
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.
As
spanName
can be custumized withSpanNameFormatter
, so thespanName
may not be the same withhttp.route
, e.g. thespanName
can beGET /users/:id
, but thehttp.route
is/users/:id
, so, usingc.FullPath()
to sethttp.route
attribute inotelgin