You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use opentelemetry-js in some of our projects and have a small implementation of the Span interface to be used in our unit tests. With the release of api v1.9 the Span interface contains additional non-optional fields/functions addLink and addLinks: #4528 . This broke our implementation of the interface.
This only affects the JavaScript OpenTelemetry library
This may affect other libraries, but I would like to get opinions here first
The text was updated successfully, but these errors were encountered:
sgohlke
changed the title
Consider adding optional fields and functions in Interfaces to avoid breaking changes
Consider adding optional fields and functions in Interfaces to avoid breaking changes in minor version updates
Jun 7, 2024
We use opentelemetry-js in some of our projects and have a small implementation of the
Span
interface to be used in our unit tests. With the release of api v1.9 theSpan
interface contains additional non-optional fields/functionsaddLink
andaddLinks
: #4528 . This broke our implementation of the interface.While I can part of understand the reasoning stated in https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122 I would like to point out that it is possible to define optional fields/functions in interfaces. This can e.g. be used to add new logic in minor versions without breaking existing implementations and set the field/function to required in the next major version. This might come with a small drawback of a check like
'addLink' in span
to ensure the function exists before calling it.The text was updated successfully, but these errors were encountered: