opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

SimpleSpanProcessor.forceFlush doesn't wait for pending exports

Open anuraaga opened this issue 4 years ago • 1 comments
trafficstars

While examining https://github.com/aws-observability/aws-otel-community/issues/17, I noticed that SimpleSpanProcessor.forceFlush doesn't allow blocking on pending exports.

https://github.com/open-telemetry/opentelemetry-js/blob/392c43f2f6b10c608e8882cd97925a2fedd58b08/packages/opentelemetry-tracing/src/export/SimpleSpanProcessor.ts#L37

Presumably, onEnd needs to store the Promise for the call to export in some Set-like object which is removed from when the export completes, so that forceFlush can block on the promises in that set.

anuraaga avatar Jan 18 '21 04:01 anuraaga

Related to #3067. This is not a bug but a spec inconsistency. This can't be fixed until #3067 is resolved.

dyladan avatar Jul 20 '22 16:07 dyladan