-
Notifications
You must be signed in to change notification settings - Fork 928
Open
Labels
bugSomething isn't workingSomething isn't workingpriority:p4Bugs and spec inconsistencies which do not fall into a higher prioritizationBugs and spec inconsistencies which do not fall into a higher prioritization
Description
What happened?
Steps to Reproduce
When I end a span, then next call shutdown
, the ended span is not flushed. If I wait for the next event loop tick, the span is flushed as-expected. See this example in the repo that demonstrates the problem and an example work-around.
parentSpan.end();
// give some time before it is closed
setTimeout(() => {
// flush and close the connection.
exporter.shutdown();
}, 2000);
Providing 0
to setTimeout
also resolved the issue for me.
parentSpan.end();
setTimeout(() => {
exporter.shutdown();
}, 0);
Additional Details
See this other comment where the issue is shared.
Ideally, updating the example to below would work without the event loop wait.
parentSpan.end();
exporter.shutdown();
OpenTelemetry Setup Code
package.json
Relevant log output
Operating System and Version
No response
Runtime and Version
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority:p4Bugs and spec inconsistencies which do not fall into a higher prioritizationBugs and spec inconsistencies which do not fall into a higher prioritization