-
Notifications
You must be signed in to change notification settings - Fork 773
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
Fix Activity http.route and name #5026
Fix Activity http.route and name #5026
Conversation
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main open-telemetry/opentelemetry-dotnet#5026 +/- ##
==========================================
+ Coverage 83.61% 83.69% +0.08%
==========================================
Files 296 296
Lines 12484 12483 -1
==========================================
+ Hits 10438 10448 +10
+ Misses 2046 2035 -11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
098c528
to
55965ba
Compare
2367168
to
2ce8425
Compare
test/OpenTelemetry.Instrumentation.AspNetCore.Tests/RouteTests/README.net8.0.md
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs
Show resolved
Hide resolved
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.
Proposed changes looks good to me.
There remain scenarios when using conventional routing or Razor pages where | ||
`http.route` is still incorrect. See [#5056](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5056) | ||
and [#5057](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5057) | ||
for more details. |
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.
Opened these issues to highlight the remaining known issues related to http.route
.
@JamesNK I'm interested in your thoughts. I'm hoping we can coordinate to resolve these issues.
Fixes #3485
Fixes #3461
Fixes #2967
Fixes #3771
This PR fixes a number of items with respect to the
Activity.DisplayName
andhttp.route
attribute:Activity.DisplayName
now conforms to the specification{http.method} {http.route}
when there is a low-cardinalityhttp.route
{http.method}
when there is not a low-cardinalityhttp.route
http.route
was missing for some attribute-based routing scenarioshttp.route
was missing when using minimal APIhttp.route
, when present, is now the same for both the Activity and metric emittedThere remain scenarios not fixed by this PR and also changes their behavior. You can review this readme for the scenarios that remain unresolved. In summary:
http.route
is set to the matched route template. This does not accurately reflect the actual route when the controller/action invoked are not the defaults. For example:/ConventionalRoute/ActionWithStringParameter/2?num=3
http.route
is set to{controller=ConventionalRoute}/{action=Default}/{id?}
http.route
would be something likeConventionalRoute/ActionWithStringParameter/{id?}
.http.route
is empty.http.route
attribute is not sethttp.route
would be/Index
because that is the default page.These scenarios are unfortunate because it limits users from meaningfully querying metrics and faceting them by
http.route
. See open-telemetry/opentelemetry-dotnet-contrib#1730 and open-telemetry/opentelemetry-dotnet-contrib#1729.