-
Notifications
You must be signed in to change notification settings - Fork 667
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
Shutdown result is reported using boolean values #2406
Comments
What do we do in tracing? |
Shutdown doesn't return anything in tracing. |
What do you all think of raising exceptions for this? Having it not return anything and just raising an appropriate exception seems the most idiomatic to me. |
I am ok with this, keep in mind that these exceptions need to be handled by some error handling mechanism. |
@aabmass |
I think raising exception makes most sense here for Python. I don't think we can log an exception since we need to let the caller know which would be the calling scope code, not the human who wrote it. Handling the exception ourselves will also defeat the purpose of having on in the first place as an exception here is meant to be used as a control flow mechanism. I think we should look at these exceptions as more of control flow mechanism, document them and make them part of the public API for the packages. This way users and auto-instrumentation would be expected to always handle these two exceptions. If we don't want exceptions then I guess the only way is to return an object which has fields to denote the result of the operation (or multiple values) but that doesn't feel very "pythonic". |
* Use exceptions to report shutdown result Fixes #2406 * Fix mypy * Make exceptions private * Fix exceptions module path * Remove exceptions and show failed metric readers
The spec says for both
MeterProvider
andMetricReader
shutdown
methods: Shutdown SHOULD provide a way to let the caller know whether it succeeded, failed or timed out.Since there are 3 possible outcomes, the 2 possible boolean results are not enought and we need something else.
Originally posted by @ocelotl in #2405 (comment)
The text was updated successfully, but these errors were encountered: