Skip to content

Duplicated spans using ASP.NET controllers #4093

@matteopey

Description

@matteopey

Describe the bug
I'm not sure if this is a bug or is by design, so I'm opening this issue to have some guidance on how to solve this.
I have an application that is using .NET Core 6. The controllers in this applications are implemented using the ControllerBase class from ASP.NET.
The result on Datadog is that inside the trace two spans are shown, even though the controller path and the request made is only one.
The service entry is of type aspnet_core.request the inner one is of type aspnet_core_mvc.request.
Instead, using the new routing like this app.MapGet("/api/mapget", () => "Hello!"); only one trace is shown.

To Reproduce
I setup Datadog with an agent running on the host machine on Docker with APM enabled and the application is running on the same host, integrating the .NET tracer as explained in the /apm/intro guide on Datadog.

Expected behavior
One span is shown given the single request and the single controller.

Screenshots
Controllers
immagine

MapGet
immagine

Runtime environment (please complete the following information):

  • Automatic instrumentation
  • Tracer version: 2.29.0
  • OS: Windows 10 on WSL2. Happening in production on K8S cluster.
  • CLR: >= .NET Core 3.1

Additional context
Noticed this issue in our production systems, but is easily reproducible with a simple application locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions