open-telemetry / opentelemetry-specification

Specifications for OpenTelemetry
https://opentelemetry.io
Apache License 2.0
3.71k stars 887 forks source link

Require separation of API and SDK artifacts #4084

Closed yurishkuro closed 2 months ago

yurishkuro commented 3 months ago

What are you trying to achieve?

The spec states today:

  1. The OpenTelemetry API must be well-defined and clearly decoupled from the implementation. This allows end users to consume API only without also consuming the implementation (see points 2 and 3 for why it is important).

  2. Third party libraries and frameworks that add instrumentation to their code will have a dependency only on the API of OpenTelemetry client. The developers of third party libraries and frameworks do not care (and cannot know) what specific implementation of OpenTelemetry is used in the final application.

The spirit of the 2nd clause has always been to not require any additional dependencies when taking a dependency on the API library. However, some implementations (e.g. https://github.com/open-telemetry/opentelemetry-swift/issues/486) release both API and SDK as a single artifact that makes it impossible for the user to not pull all the SDK dependencies as well.

I would like to propose the clarification to the spec which makes zero-dependency requirement explicit, by adding this text to the 2nd point:

To enable this clean separation the API and SDK libraries MUST be provided as independent artifacts.

Open questions

Are there other SDKs besides Swift that bundle API and SDK into a single artifact?

lmolkova commented 3 months ago

I support the spirit, but we can't have zero-dependency policy:

trask commented 3 months ago

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md makes several mentions of the API and SDK being separate components from a packaging / versioning / support guarantee perspective

yurishkuro commented 3 months ago

@lmolkova

MrAlias commented 3 months ago

Are there other SDKs besides Swift that bundle API and SDK into a single artifact?

For the negative case, Go does not bundle these into the same artifact.