LoggerProvider::ForceFlush() doesn't return false on failed log exports #3075
Labels
bug
Something isn't working
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Describe your environment
Using
OtlpGrpcLogRecordExporter
orOtlpHttpLogRecordExporter
log export failures are ignored at theLogRecordProcessor
layer.SimpleLogRecordProcessor
has a comment that failures onLogRecordExporter::Export()
should be surfaced, butBatchLogRecordProcessor
just blindly callsLogRecordExporter::Export()
.There's no programmatic way to ensure that logs are reaching their target destination and not being dropped from the
LogRecordProcessor
orLoggerProvider
.Steps to reproduce
Modify the https://github.com/open-telemetry/opentelemetry-cpp/blob/main/examples/otlp/http_log_main.cc example to call and report on the result of
ForceFlush()
, then run the example against an address that's not an OTLP endpoint.ForceFlush()
will report true.What is the expected behavior?
I was expecting
ForceFlush()
to report false if theLogRecordExporter::Export()
call had failed.What is the actual behavior?
ForceFlush()
returns true regardless of the logs failing to export.Additional context
Turning up the global logging level, it is possible to observe error events, but that's not the same as being able to check for successful logging.
The text was updated successfully, but these errors were encountered: