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
All the metrics components SHOULD allow new methods to be added to existing components without introducing breaking changes.
Adding new methods to struct in Go is not a breaking change. Most of the Go components are structs. However some methods also accept interfaces.
Adding a new method to a interface is a breaking change.
NewManualReader and NewPeriodicReader are components returned as interfaces. It is would not possible to add a new methods (e.g. Pause and Continue) to periodic reader API without creating a new method like NewPeriodicReaderBis that would return a struct (or other interface). I think it would be more flexible if both methods return structs instead of Reader interface.
From https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/sdk.md#compatibility-requirements:
Adding new methods to
struct
in Go is not a breaking change. Most of the Go components are structs. However some methods also accept interfaces.Adding a new method to a
interface
is a breaking change.NewManualReader
andNewPeriodicReader
are components returned as interfaces. It is would not possible to add a new methods (e.g.Pause
andContinue
) to periodic reader API without creating a new method likeNewPeriodicReaderBis
that would return a struct (or other interface). I think it would be more flexible if both methods return structs instead ofReader
interface.Originally posted by @pellared in #3671 (comment)
The text was updated successfully, but these errors were encountered: