Skip to content
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 has inconsistent error reporting mechanisms #2662

Closed
aabmass opened this issue May 5, 2022 · 3 comments
Closed

Metrics has inconsistent error reporting mechanisms #2662

aabmass opened this issue May 5, 2022 · 3 comments
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics

Comments

@aabmass
Copy link
Member

aabmass commented May 5, 2022

Some places we raise exceptions (MeterProvider.shutdown()), some places we return a bool (MeterProvider.force_flush()). These may be the only ones, but we need to dig in and determine if this is intentional.

I know trace just uses bool and exporters have a return result. I am personally not a fan, when you can just return meaningful exceptions :)

@aabmass aabmass added metrics 1.10.0rc1 release candidate 1 for metrics GA labels May 5, 2022
@srikanthccv
Copy link
Member

shutdown in tracing also doesn't return anything. I think we discussed it here #2406 and agreed to raise an exception. I believe the reason force_flush returns bool is that we tried to be consistent what exists already for tracing/logs. Since force_flush could be called multiple times during the application lifetime, just logging exception seemed fine at the time.

@ocelotl
Copy link
Contributor

ocelotl commented May 6, 2022

I think for consistency with tracing we should keep the bool in force flush.

@aabmass
Copy link
Member Author

aabmass commented May 6, 2022

Thanks @srikanthccv. Discussed with @ocelotl offline as well and agreed. We'll continue to return bool but allow exceptions to bubble up since they are far more descriptive than true or false

@aabmass aabmass closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics
Projects
None yet
Development

No branches or pull requests

3 participants