Skip to content

Route name on Traces and Logs #1037

Closed Answered by commonsensesoftware
alefcarlos asked this question in Q&A
Discussion options

You must be logged in to vote

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 as v{version:apiVersion}/WeatherForecast so that is what I would expect to see. What you would probably prefer is to is IEndpointNameMetadata, which usually maps to OperationId in OpenAPI. There is also IEndpointSummaryMetadata and IEndpointDescriptionMetadata, but those probably provide longer descriptions than what you are looking for.

I don't see an…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
5 replies
@alefcarlos
Comment options

@xavierjohn
Comment options

@alefcarlos
Comment options

@xavierjohn
Comment options

@xavierjohn
Comment options

Comment options

You must be logged in to vote
7 replies
@commonsensesoftware
Comment options

@alefcarlos
Comment options

@alefcarlos
Comment options

@commonsensesoftware
Comment options

Answer selected by alefcarlos
@alefcarlos
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants