Skip to content

Inconsistent Activity DisplayName for AddAspNetCoreInstrumentation spans #1744

Open
@xinyi-joffre

Description

@xinyi-joffre

Bug Report

"OpenTelemetry.Audit.Geneva" Version="2.0.0"
"OpenTelemetry.Exporter.Geneva" Version="1.4.1"
"OpenTelemetry.Extensions.Hosting" Version="1.4.0"
"OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.14"
"OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.14"
"OpenTelemetry.Instrumentation.Runtime" Version="1.1.0-rc.2"

Runtime version: net6.0

Symptom

With auto-instrumentation, the name of spans (Activities) generated from the library seems to be inconsistent between Options / Failed authentication requests, and successful requests.

For OPTIONS or 401/403 requests, the name has a slash in front of it:
(e.g. /api/chat/completions)

For successful requests, it borrows from the http.route name, which doesn't have a slash in front of it:
(e.g. api/chat/completions)

What is the expected behavior?
The name is consistent between all http calls.

What did you expect to see?
Either all spans/activities with slashes in front or all without slashes in front.

What is the actual behavior?
Some spans have a slash and some don't have a slash in front. This makes querying slightly more difficult and seems to not be intentional difference.

Reproduce

A standard dotnet 6 core WebAPI application with AddAspNetCoreInstrumentation and any kind of authentication or options calls from a browser.

Additional Context

This small difference in name means we cannot use exact matches to query the database later for specific names/paths, and need to consider both with front-slash and without front-slash. We tried adding a front-slash to all of our [Route] attributes, but it did not make a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomp:instrumentation.aspnetcoreThings related to OpenTelemetry.Instrumentation.AspNetCore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions