Skip to content

[feature request] Kestrel connection instrumentation #2672

Open
@petrzjunior

Description

@petrzjunior

Component

OpenTelemetry.Instrumentation.AspNetCore

Is your feature request related to a problem?

Currently, the following diagnostic events are traced:

  • Microsoft.AspNetCore.Hosting.HttpRequestIn
  • Microsoft.AspNetCore.Hosting.HttpRequestIn.Start
  • Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop
  • Microsoft.AspNetCore.Diagnostics.UnhandledException
  • Microsoft.AspNetCore.Hosting.UnhandledException

This means that a web request trace begins with the HTTP request span. When debugging HTTP server internals, I would like to see the exact time the request started processing.

What is the expected behavior?

I propose optionally making a trace for Microsoft-AspNetCore-Server-Kestrel.ConnectionStart and Microsoft-AspNetCore-Server-Kestrel.ConnectionStop. The new event could bring more insight and allow creating traces for middlewares before the HTTP parser kicks in.

I do not feel confident to try to implement this myself nor am I sure that this would work correctly with e.g. context propagation. Feel free to make this a discussion.

Which alternative solutions or features have you considered?

This could be implemented as an external instrumentation, but I am not able to build this myself.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions