You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
n-ravichandran
changed the title
OtlpHttpLogExporter does not wait for HTTP request completion, causing issues with PersistenceLogExporterDecoratorOtlpHttpLogExporter does not wait for HTTP request completion, causing issues with PersistenceLogExporterDecoratorNov 7, 2024
There's an additional, slightly related issue that all of the OtlpHttp*Exporter classes treat 4xx/5xx errors as 'success': The HTTPClient class that they use only returns failures if URLSession reports an error for the request... which only happens if there's a connection error; as far as URLSession is concerned, a 4xx or 5xx response is a 'success'. Something in HTTPClient should probably be checking the http status code and surfacing those as failures for the exporter classes to handle appropriately.
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.The text was updated successfully, but these errors were encountered: