opentelemetry-go icon indicating copy to clipboard operation
opentelemetry-go copied to clipboard

Support OTEL_SDK_DISABLED environment variable.

Open jojotong opened this issue 2 years ago • 4 comments

Problem Statement

https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#environment-variables says go library not support OTEL_SDK_DISABLED environment. Do we have a plan to support it ?

jojotong avatar Dec 27 '22 09:12 jojotong

We will indeed need to implement it, as it's specified. Feel free to let us know if you want to start working on it, or just to open a PR.

dmathieu avatar Jan 03 '23 13:01 dmathieu

I don't think this is worth added to the Go implementation. It was added to the specification for languages that may come with auto-instrumented code. The Go implementation requires a user to explicitly setup a tracer provider and then register or directly use it. I don't see much value to adding this, at least not at this stage in the project.

MrAlias avatar Jan 03 '23 16:01 MrAlias

I don't think this is worth added to the Go implementation. It was added to the specification for languages that may come with auto-instrumented code. The Go implementation requires a user to explicitly setup a tracer provider and then register or directly use it. I don't see much value to adding this, at least not at this stage in the project.

  1. It may be still useful for the users so that it could be used as a "feature-toggle" to disable OTel code
  2. How would we want to support it in https://github.com/open-telemetry/opentelemetry-go-instrumentation?

pellared avatar Jan 03 '23 19:01 pellared

We will indeed need to implement it, as it's specified.

All configuration via environment variables is optional. There is no requirement that we support it.

I think I'm with @MrAlias on this, for now. It's not required and can be implemented in a relatively straightforward manner by an application author that finds it necessary by wrapping their SDK initialization in a check of the environment variable. Adding it to the configuration surface area of the SDK is a one-way door that I don't think we need to walk through right now, but we should keep it open to evaluate at a later time.

Aneurysm9 avatar Jan 03 '23 19:01 Aneurysm9