This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.47k
stars
4.8k
forks
source link
[BUG] AzureMonitorExporter shows unexpected operation name #41650
The operation name should be reported as GET /{Controller}/{Action}/{id}
Actual behavior
Instead the operation name will contain the pattern with the default route GET {controller=Home}/{action=Index}/{id?}
Or will display the actual URL GET /Customer/Get/001
Reproduction Steps
This can be reproduced in an MVC app configured like this:
When using Asp.Net Core Routing rules, our Exporter is currently recording the full pattern as the Operation Name.
This means that requests to different Controllers or Actions will show identical Operation Names, as shown in this screenshot.
My test app has a HomeController and CustomerController. Regardless which controller is invoked, The url.path shows the correct Controller/Action. The http.route shows the configured pattern.
We determined that the fix needs to come from .NET & the OpenTelemetry Instrumentation library.
Our team is tracking this item and we'll work with the other teams to get this resolved.
Library name and version
Azure.Monitor.OpenTelemetry.Exporter
Describe the bug
The
Name
andOperation Name
are inconsistent depending on type of routing, configuration, and net framework.This is in part due to the data provided by the
OpenTelemetry.Instrumentation.AspNetCore
library, where the configured pattern is used as the value ofhttp.route
. This is a known issue in that library: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/1730Expected behavior
The operation name should be reported as
GET /{Controller}/{Action}/{id}
Actual behavior
Instead the operation name will contain the pattern with the default route
GET {controller=Home}/{action=Index}/{id?}
Or will display the actual URLGET /Customer/Get/001
Reproduction Steps
This can be reproduced in an MVC app configured like this:
When using Asp.Net Core Routing rules, our Exporter is currently recording the full pattern as the Operation Name. This means that requests to different Controllers or Actions will show identical Operation Names, as shown in this screenshot.
My test app has a
HomeController
andCustomerController
. Regardless which controller is invoked, Theurl.path
shows the correct Controller/Action. Thehttp.route
shows the configured pattern.https://localhost:44311/Home/Index
https://localhost:44311/Customer/Index
Environment
No response