Skip to content
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

[BUG] AzureMonitorExporter shows unexpected operation name #41650

Open
TimothyMothra opened this issue Jan 29, 2024 · 1 comment
Open

[BUG] AzureMonitorExporter shows unexpected operation name #41650

TimothyMothra opened this issue Jan 29, 2024 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. Monitor - Exporter Monitor OpenTelemetry Exporter

Comments

@TimothyMothra
Copy link
Contributor

Library name and version

Azure.Monitor.OpenTelemetry.Exporter

Describe the bug

The Name and Operation 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 of http.route. This is a known issue in that library: open-telemetry/opentelemetry-dotnet-contrib#1730

Expected 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:

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");

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.

Screenshot 2024-01-25 115910

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.

  • https://localhost:44311/Home/Index

    Activity.ActivitySourceName: Microsoft.AspNetCore
    Activity.DisplayName:        GET {controller=Home}/{action=Index}/{id?}
    Activity.Kind:               Server
    Activity.Tags:
        server.address: localhost
        server.port: 44311
        http.request.method: GET
        url.scheme: https
        url.path: /
        network.protocol.version: 2
        http.route: {controller=Home}/{action=Index}/{id?}
        http.response.status_code: 200
    
  • https://localhost:44311/Customer/Index

    Activity.ActivitySourceName: Microsoft.AspNetCore
    Activity.DisplayName:        GET {controller=Home}/{action=Index}/{id?}
    Activity.Kind:               Server
    Activity.Tags:
        server.address: localhost
        server.port: 44311
        http.request.method: GET
        url.scheme: https
        url.path: /Customer/Index
        network.protocol.version: 2
        http.route: {controller=Home}/{action=Index}/{id?}
        http.response.status_code: 200
    

Environment

No response

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jan 29, 2024
@TimothyMothra TimothyMothra self-assigned this Jan 29, 2024
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Monitor - Exporter Monitor OpenTelemetry Exporter and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jan 30, 2024
@TimothyMothra TimothyMothra removed their assignment Feb 13, 2024
@TimothyMothra
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Monitor - Exporter Monitor OpenTelemetry Exporter
Projects
None yet
Development

No branches or pull requests

2 participants