The OtlpHttpLogExporter currently does not work well when used with the PersistenceLogExporterDecorator. Specifically, the OtlpHttpLogExporter’s export function always returns success immediately, without waiting for the HTTP request to complete. This behavior results in the PersistenceLogExporterDecorator prematurely deleting the logs from the file system, thus not effectively utilizing the persistence mechanism.
Steps to Reproduce
Decorate OtlpHttpLogExporter with PersistenceLogExporterDecorator.
Send logs that are expected to persist until confirmed exported.
Observe that logs are removed from the file system without confirmation of successful upload.
Expected Behavior
The OtlpHttpLogExporter should wait for the HTTP request to complete before returning success, allowing the PersistenceLogExporterDecorator to safely remove the batch of logs from the file system only after they are confirmed uploaded.
Actual Behavior
The OtlpHttpLogExporter immediately returns success, causing PersistenceLogExporterDecorator to delete logs prematurely, which defeats the purpose of file system persistence.
Suggested Solution
It would be beneficial for the OtlpHttpLogExporter to await the completion of the HTTP request before it returns the ExportResult. This approach would enable the PersistenceLogExporterDecorator to manage the deletion or retrying of the batch effectively.
The
OtlpHttpLogExporter
currently does not work well when used with thePersistenceLogExporterDecorator
. Specifically, the OtlpHttpLogExporter’sexport
function always returns success immediately, without waiting for the HTTP request to complete. This behavior results in thePersistenceLogExporterDecorator
prematurely deleting the logs from the file system, thus not effectively utilizing the persistence mechanism.Steps to Reproduce
OtlpHttpLogExporter
withPersistenceLogExporterDecorator
.Expected Behavior
The
OtlpHttpLogExporter
should wait for the HTTP request to complete before returning success, allowing thePersistenceLogExporterDecorator
to safely remove the batch of logs from the file system only after they are confirmed uploaded.Actual Behavior
The
OtlpHttpLogExporter
immediately returns success, causingPersistenceLogExporterDecorator
to delete logs prematurely, which defeats the purpose of file system persistence.Suggested Solution
It would be beneficial for the
OtlpHttpLogExporter
to await the completion of the HTTP request before it returns theExportResult
. This approach would enable thePersistenceLogExporterDecorator
to manage the deletion or retrying of the batch effectively.