Skip to content

OpenTelemetry .NET Auto-Instrumentation/SDK Side-by-Side Support #3455

@rajkumar-rangaraj

Description

@rajkumar-rangaraj

Feature Request

Is your feature request related to a problem?

OpenTelemetry .NET Auto-Instrumentation dynamically loads OpenTelemetry .NET SDK and its instrumentation to user process and helps collect telemetry from an application without modifying the code. Issue happens when the application has a reference to OpenTelemetry SDK and user want to enable Auto-Instrumentation. In this case both user application and Auto-Instrumentation will have its own instance of TracerProvider or MeterProvider and could collect duplicate telemetries.

Describe the solution you'd like:

Auto-Instrumentation uses .NET startup hook to load the OpenTelemetry SDK and initialize TracerProvider/MeterProvider before the main application's entry point. SDK providing an option to disable the creation of the TracerProvider/MeterProvider for user-initiated providers should solve this issue. This could be implemented by adding a static bool flag in TracerProvider/ MeterProvider to stop creation of these providers. This flag can be private or public, auto-instrumentation has ability to set this through reflection. If customer use auto-instrumentation, this flag could be set by auto-instrumentation in startup and it will avoid creation of TracerProvider from user application.

Additional Context

https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/633

cc: @open-telemetry/dotnet-instrumentation-approvers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions