Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rajkumar-rangaraj opened this issue Jul 18, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@rajkumar-rangaraj
Copy link
Contributor

rajkumar-rangaraj commented Jul 18, 2022

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

open-telemetry/opentelemetry-dotnet-instrumentation#633

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

@rajkumar-rangaraj
Copy link
Contributor Author

This is no more a requirement as we plan to rely on out of process auto-instrumentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant