Closed as not planned
Description
Description
When using the otelzap bridge in a short lived cli application zapcore.Core does not flush on application exit even when calling Sync method.
Environment
- OS: [macos, linux]
- Architecture: [ x86, arm64]
- Go Version: [ go1.24.3]
go.opentelemetry.io/contrib/bridges/otelzap v0.11.0
Steps To Reproduce
- Using this code ...
exporter, err = otlploggrpc.New(ctx, opts...)
processor := sdklog.NewBatchProcessor(exporter)
res, _ := resource.New(ctx,
resource.WithProcess(),
resource.WithContainer(),
resource.WithProcessExecutableName(),
resource.WithHost())
provider := sdklog.NewLoggerProvider(sdklog.WithResource(res), sdklog.WithProcessor(processor))
core := otelzap.NewCore("siren", otelzap.WithLoggerProvider(provider))
- Run the code (I can provide full main method if needed)
- I notice that after application exit the last couple of logs are missing
Expected behavior
Logs to flush/sync
From a quick glance at the code
it seems thatSync
is not implemented
I can follow up with a PR with possible fix but wanted an opinion or some context why Sync
implementation is the way it is