Skip to content

[Database] Enable trace context propagation between application and database via instrumentation librariesΒ #2162

@sincejune

Description

@sincejune

Area(s)

area:db

What's missing?

At work, I've noticed a lack of service correlation between our application and SQL Server, such as passing the current service name, trace ID, and span ID to the database. Implementing this feature would greatly enhance our ability to trace application behaviors.

Describe the solution you'd like

Introducing an option to enable instrumentation libraries to propagate context information to databases.

Using SQL Server as an example, we can implement a ContextPropagationLevel flag with three possible values:

  • disabled: Disable context propagation, default value.
  • service: Passing the current service.name to the database when executing queries.
  • trace: Passing the current service.name, trace ID and span ID to the database when executing queries.

For an example of the trace level implementation in SQL Server, see the following PR: open-telemetry/opentelemetry-dotnet-contrib#2709

If you agree with this proposal, I'm willing to create an initial specification for SQL Server. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Need triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions