-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Currently, shutdown of a tracer requires this wrapper:
// Shutdown will flush any remaining spans and shut down the exporter.
return tracerProvider.Shutdown
return func(ctx context.Context) error {
// apparently, an explicit force flush is required to be sure that buffers are flushed
tracerProvider.ForceFlush(ctx)
return tracerProvider.Shutdown(ctx)
}
Our naive assumption was that Shutdown would also ForceFlush implicitly.
We classify this as a bug, because the result is that even with proper calls to Shutdown, buffered spans will be lost.
Environment
- OS: linux
- Architecture: any
- Go Version: go 1.25.1
- opentelemetry-go version: go.opentelemetry.io/otel/sdk v1.38.0
Steps To Reproduce
Trying to trace a kubernetes job with defer.End() on a span in main had a 100% success rate for both the issue and the fix.
Expected behavior
Shutdown should call ForceFlush but continue in case of errors, because on EOL for a job, the best you can do is try to flush everything and close all connections.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working