open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.07k stars 734 forks source link

Support for OTEL_SDK_DISABLED #4155

Open Kielek opened 1 year ago

Kielek commented 1 year ago

Feature Request

Support for OTEL_SDK_DISABLED based on https://github.com/open-telemetry/opentelemetry-specification/blob/dd47c009da1de335c540decc5d5930e46ea61916/specification/sdk-environment-variables.md?plain=1#L71

Previous PR: https://github.com/open-telemetry/opentelemetry-dotnet/pull/3639

Additional Context

Found while working on https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/2009

oppegard commented 1 year ago

See also https://github.com/open-telemetry/opentelemetry-dotnet/issues/1453, which I found by checking if the .NET SDK supported OTEL_TRACES_EXPORTER.

julealgon commented 1 month ago

We need this setting... we encountered a heavy load situation where we need to conditionally instrument a given process due to resource constraints on a machine.

I almost went ahead and tried to use it but decided to check in the repo first and found out it was not being honored.

We'll probably have to create a custom version of the AddOpenTelemetry method that respects this flag now on our side. And hopefully later we can just replace the implementation/update the package without having to reconfigure it.