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-exporters: uncontrolable unhandled rejection when failing to export #1498

Closed
vmarchaud opened this issue Sep 4, 2020 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@vmarchaud
Copy link
Member

Currently in the Metric's Controller if the data fails to export we reject the promise here: https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-metrics/src/export/Controller.ts#L56 which isn't at all handled (should be here: https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-metrics/src/export/Controller.ts#L36), so the current behavior is to throw an unhandledRejection, which for some users (that want to crash when it happens)

PS: The trace exporter is just ignoring the error for both BatchSpanProcessor here and the SimpleSpanProcessor here.

I'm not sure what should the good behavior here, but either crashing or ignoring error seems too extreme, could we just log a warning or errors in those cases ?

@vmarchaud vmarchaud added the bug Something isn't working label Sep 4, 2020
@dyladan
Copy link
Member

dyladan commented Sep 4, 2020

The spec wants us to implement a global error handler which @mwear is working on in #1415

For now, we should at least catch and log the error, and maybe add a // @todo comment to call the global error handler.

@hongbo-miao
Copy link
Contributor

hongbo-miao commented Sep 7, 2020

Got same error. I noticed my Sentry blows up because of this bug. 😅

image

@vmarchaud
Copy link
Member Author

This has been fixed with #1643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants