Fix Activity http.route and name#5026
Merged
utpilla merged 18 commits intoopen-telemetry:mainfrom Nov 17, 2023
Merged
Conversation
JamesNK
reviewed
Nov 6, 2023
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
Member
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
Member
vishweshbankwar
left a comment
There was a problem hiding this comment.
Proposed changes looks good to me.
matt-hensley
approved these changes
Nov 14, 2023
4 tasks
This was referenced May 13, 2024
alanwest
commented
Nov 16, 2023
Comment on lines
+49
to
+52
| 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. |
Member
Author
There was a problem hiding this comment.
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.
vishweshbankwar
approved these changes
Nov 16, 2023
utpilla
approved these changes
Nov 17, 2023
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3485
Fixes #3461
Fixes #2967
Fixes #3771
This PR fixes a number of items with respect to the
Activity.DisplayNameandhttp.routeattribute:Activity.DisplayNamenow conforms to the specification{http.method} {http.route}when there is a low-cardinalityhttp.route{http.method}when there is not a low-cardinalityhttp.routehttp.routewas missing for some attribute-based routing scenarioshttp.routewas 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.routeis 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=3http.routeis set to{controller=ConventionalRoute}/{action=Default}/{id?}http.routewould be something likeConventionalRoute/ActionWithStringParameter/{id?}.http.routeis empty.http.routeattribute is not sethttp.routewould be/Indexbecause 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.