opentelemetry-js
opentelemetry-js copied to clipboard
SimpleSpanProcessor.forceFlush doesn't wait for pending exports
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.
Related to #3067. This is not a bug but a spec inconsistency. This can't be fixed until #3067 is resolved.