Open Oberon00 opened 3 years ago
IMO the policy should clearly differentiate:
- API interfaces which are callable by the end user but are not intended to be implemented by the end user.
Which would be all API interfaces defined in the spec, I think?
- SDK interfaces which are callable by the end user but are not intended to be implemented by the end user.
I think that is what the spec calls "Constructors" at https://github.com/open-telemetry/opentelemetry-specification/blob/v1.0.1/specification/versioning-and-stability.md#sdk-stability
- Interfaces which define the contract between API and SDK packages and are intended to be called by API and implemented by SDK, not intended to be called or implemented by the end user.
I'm not sure there is such a thing. Can you give an example?
- Interfaces called by SDK which are intended to be implemented by the end user.
These have the name "Plugin Interface" in the versioning spec.
- API interfaces which are callable by the end user but are not intended to be implemented by the end user.
Which would be all API interfaces defined in the spec, I think?
Yes, I think so.
- Interfaces which define the contract between API and SDK packages and are intended to be called by API and implemented by SDK, not intended to be called or implemented by the end user.
I'm not sure there is such a thing. Can you give an example?
I think you are right. I thought we had something like TracerProviderSdk
in the spec, but we don't.
--
The names "Contrsuctors" and "Plugin interface" are not self-explanatory, so I think it is best to clearly articulate the distinction in the PR that addresses this issue.
I think you are right. I thought we had something like TracerProviderSdk in the spec, but we don't.
We don't have the name "TracerProviderSdk", but we do have specification on the SDK's TracerProvider implementation. But this falls under
- SDK interfaces which are callable by the end user but are not intended to be implemented by the end user.
as it has methods like Shutdown and ForceFlush.
We need to define our policy for adding new methods to existing interfaces in the specification, especially considering APIs that are intended to be implemented by users, namely "plugin interfaces" (Exporter, Sampler) and API implementation interfaces (Span, TracerProvider, ...). It is clear and already specified that at least for plugin interfaces we must stay ABI-compabible. However, there are several ways to achieve this (other than just never specifying new methods) in different languages (Java default interface implementations, C++ non-pure virtual methods, deriving a new interface in most languages come to mind).
Recently there were some discussions on adding
ForceFlush
to the SdkTracerProvider class (#1451, #1452) and the Exporter interface (#1454). While it was agreed that the former is unproblematic (SdkTracerProvider being a class), the Exporter is what our versioning spec calls a plugin interface:(I think this is more or less what @tigrannajaryan stated in https://github.com/open-telemetry/opentelemetry-specification/pull/1452#issuecomment-783730643)
In #1454 I remarked about adding
ForceFlush
to the existingExporter
interface:and @bogdandrutu remarked in response:
There however the question if old APIs need to be supported by (API-compatible with) newer SDKs. I think the only thing the spec says about this is the following: