-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Metrics SDK implementation types into metric/sdkapi
sub-package
#2090
Comments
I'm weary of this change. If the types being moved to the |
If we moved the types into an internal package, all the internal SDK code would work just fine, but it would be impossible to implement an alternate SDK in an external repository. These types could move into a subdirectory of |
Gotcha. I know we added these types to help deal with geometric scaling of places we needed to update when we originally were implementing this will a large parameter space, but I'm wondering if we should take this refactor as a chance to rethink these. Having other SDKs not only implement the API directly, but implement this |
I see it as simplifying. There are two packages already acting as SDK alternatives here, the metric |
Another way to think about this |
Hmm, I might not be following. With both of those examples being local packages could we not then just put this into an internal directory? |
I see. To summarize, I think you're calling into question the entire relationship between the API and the default SDK. The existing API uses I do not support the I prefer the |
Description
There are a number of types that exist in the
metric
package that are needed only for the SDK to support the API, that are not directly used by the user. These types are part of the SDK API, so to speak, so I propose moving them to thesdkapi
sub-package. Most of the types in themetric_sdkapi.go
file can move there. This has been verified by the experiment in #2044, which replaces the API but continues to use at least thesemetric
types:MeterImpl
Measurement
InstrumentImpl
SyncImpl
AsyncImpl
InstrumentKind
Descriptor
Expected behavior
In order to create a sub-package for the SDK API types means having no cycles between them. The
Measurement
type is the one among these that belongs in the public API, but since it is part of theMeterImpl
it will live in thesdkapi
package. There will be an alias forMeasurement
from the top-level package so that it can be referred to in public APIs.The text was updated successfully, but these errors were encountered: