Route name on Traces and Logs #1037
-
I would like to see the version on route instead of For example: The http url does not have the selected version for the endpoint. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
Try this nuget and see if it fits your need. |
Beta Was this translation helpful? Give feedback.
-
Is there no place where the full request URL is shown in the trace? It looks like it is only showing the route template. It's not clear whether that is happening. If the endpoint was hit, then the actual request URL should be the value shown. Unless something else strange is happening in the implementation, I would expect something like |
Beta Was this translation helpful? Give feedback.
I poked around a bit more and I found this line:
https://github.com/open-telemetry/opentelemetry-dotnet/blob/7dff32480d8b2fe8d41e0958257c00e3602e3b3a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs#L292
This clearly shows that it uses the
Endpoint.RoutePattern.RawText
as the value. The route template is defined asv{version:apiVersion}/WeatherForecast
so that is what I would expect to see. What you would probably prefer is to isIEndpointNameMetadata
, which usually maps toOperationId
in OpenAPI. There is alsoIEndpointSummaryMetadata
andIEndpointDescriptionMetadata
, but those probably provide longer descriptions than what you are looking for.I don't see an…