-
Notifications
You must be signed in to change notification settings - Fork 828
Description
From this comment, the constructors of metric instruments in the SDK need to pass in the explicit type. This will make it so that the implementation of the resulting metric instrument created is dependent on the type that is passed in, not based off of what MeterProvider implementation is used (and in turn, Meter).
For example, if I want to construct a ValueRecorder, and I expect the SDK behaviour, but I do not want to break the user if they are using the api implementation (or any other implementation), I am not actually able to do this. To utilize the SDK ValueRecorder, I MUST pass in this class type to create metric in the SDK. This is bad because then the code will HAVE to take a dependency on the SDK.
The solution is to have explicit create methods for each instrument type. The original reason why we had a generic create_metric was so we did not have to duplicate this code. See java or go.