-
Notifications
You must be signed in to change notification settings - Fork 652
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
Metrics instances can be created by direct instantiation #2550
Comments
/s/meter/tracer/g - Same applies, we don't do anything to prevent this from happening. |
We can do something similar as we did for spans? Also if we add this behavior for the tracer, would that be considered breaking? |
Yes, but I do not expect anyone to be directly instantiating it. IMO any changes that do not really fix any buggy behaviour but just move things around for the the sake of spec compliance is breaking. This is also why we can't address this issue #2463 without breaking user systems. |
Are you in favor of closing this issue, then, @srikanthccv? |
I was thinking may be we can ensure instruments are not created directly at least. What do you think? |
Ok, I can work on that 👍 |
Sorry, I just noticed that you have assigned this to yourself. If you want/need I can take it, just let me know. |
From the spec:
In our SDK,
Meter
(and other classes) can be instantiated directly, by importing the SDKMeter
class and instantiating it, bypassing theMeterProvider
. This is relevant to error handling, if we allowMeter
to be instantiated directly, it may raise errors if the user passes bad parameters. If such thing happened usingMeterProvider
, theget_meter
method could catch this errors and return aNoOpMeter
.The text was updated successfully, but these errors were encountered: