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
The Counter and Histogram constructors return interfaces instead of pointers to structs. Now the constructor for Counter returns a Counter interface whose underlying type implements both Counter and ExemplarAdder and the constructor for Histogram returns a Histogram interface whose underlying type implements both Histogram and ExemplarObserver. The users of these clients now need to do type casting just to get the type they want, which I would argue is not ideal. Generally, I believe it makes sense for constructors to return pointers to types instead of interfaces since interfaces are satisfied implicitly and this approach gives the caller more options out of the box.
Would there be any consideration for having these constructors return pointers to exported structs? Alternatively, we could create a new set of constructors that do this so the API can remain stable for existing users.