-
Notifications
You must be signed in to change notification settings - Fork 864
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
Telemetry - use the request path for name of trace #2667
Comments
@samsp-msft does this look like the intended experience here? |
cc @JamesNK |
A trace shows the matched route so it's working as intended. But that doesn't create a good experience in this situation. YARP could improve this by getting the request activity and change the name to the request path. You can use the |
But presumably we wouldn't want to do so in YARP for all the same reasons we aren't doing it in ASP.NET to begin with? |
I don't think changing the default to the full path would be the right answer, there's potentially an infinite amount of different paths that could match a route. Presumably it should be as simple as this (untested) app.Use((context, next) =>
{
if (context.Features.Get<IHttpActivityFeature>()?.Activity is { } activity)
{
activity.DisplayName = $"{context.Request.Method} {context.GetReverseProxyFeature().Route.Config.RouteId} {context.Request.Path}";
}
return next();
}); |
I've given the suggestion above a try. I added the app.Use directly before the app.Run call. However setting the DisplayName seems to have no effect on the dashboard activity name. To prove whether it was having any effect - I added a tag alongside the setting of the DisplayName - which does seem to come through. So this code
|
What should we add or change to make your life better?
When using Yarp and OpenTelemetry with the Aspire dashboard, all requests show in the dashboard with the route match path as the display name. This means that you have to drill into each one to find the request you are looking for. It would be better if they showed the original request path.
Example
Why is this important to you?
A change will enable a more useful experience when viewing telemetry.
The text was updated successfully, but these errors were encountered: