[feature request] AspNetCore - Support for IRoutingFeature in ASP.NET Core Instrumentation to Set http.route Tag #2565
Labels
comp:instrumentation.aspnetcore
Things related to OpenTelemetry.Instrumentation.AspNetCore
enhancement
New feature or request
Component
OpenTelemetry.Instrumentation.AspNetCore
Is your feature request related to a problem?
In our ASP.NET Core middleware in Azure Functions, we currently rely on IRoutingFeature to access routing information. However, we have encountered an issue with ASP.NET Core Instrumentation where the http.route tag is not being set as expected. This happens because the instrumentation framework depends on RouteEndpoint to retrieve the route pattern.
As a result, the display name for the telemetry only includes the HTTP verb (e.g., GET, POST) instead of the full route template. This leads to incomplete and less useful telemetry data.
What is the expected behavior?
The http.route tag should be populated correctly, even when IRoutingFeature is used.
Which alternative solutions or features have you considered?
Retrieve the routing information from IRoutingFeature and update the route and display name after the activity has been created.
Additional context
We recognize that RouteEndpoint is the preferred approach, but providing backward compatibility with IRoutingFeature would help maintain compatibility for applications that have not yet migrated.
The text was updated successfully, but these errors were encountered: