open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.35k stars 1.09k forks source link

Add experimental Instrument.Enabled SDK method #6002

Open mx-psi opened 4 days ago

mx-psi commented 4 days ago

Problem Statement

The Collector SIG is blocked on having Instrument.Enabled available on the OpenTelemetry Go libraries for stabilizing the component package (see open-telemetry/opentelemetry-collector/issues/11061).

Adding this to the API is blocked by open-telemetry/opentelemetry-specification/issues/4215, which is moving slowly. We would like to have it available at the SDK level instead.

Proposed Solution

We can use https://github.com/open-telemetry/opentelemetry-go/pull/5768 as a start and add this as an SDK-only, 'hidden' method:

Alternatives

Just wait.

Prior Art

We have both https://github.com/open-telemetry/opentelemetry-go/tree/main/sdk/metric/internal/x and https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/log/internal/x/README.md as prior examples of experimental methods/stuff.

Additional Context

Spoke about this with @pellared