[BUG] AzureMonitorExporter shows unexpected operation name #41650
Labels
Client
This issue points to a problem in the data-plane of the library.
Monitor - Exporter
Monitor OpenTelemetry Exporter
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: open-telemetry/opentelemetry-dotnet-contrib#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 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
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
The text was updated successfully, but these errors were encountered: