Opentelemetry-js: metrics-exporters: uncontrolable unhandled rejection when failing to export

Created on 4 Sep 2020  路  3Comments  路  Source: open-telemetry/opentelemetry-js

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 ?

bug

All 3 comments

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.

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

image

Was this page helpful?
0 / 5 - 0 ratings