|
2 | 2 | use crate::logs::LogRecord;
|
3 | 3 | use crate::Resource;
|
4 | 4 | use async_trait::async_trait;
|
| 5 | +use futures_util::future::BoxFuture; |
5 | 6 | #[cfg(feature = "logs_level_enabled")]
|
6 | 7 | use opentelemetry::logs::Severity;
|
7 | 8 | use opentelemetry::logs::{LogError, LogResult};
|
@@ -91,6 +92,25 @@ pub trait LogExporter: Send + Sync + Debug {
|
91 | 92 | // By default, all logs are enabled
|
92 | 93 | true
|
93 | 94 | }
|
| 95 | + |
| 96 | + /// This is a hint to ensure that the export of any Spans the exporter |
| 97 | + /// has received prior to the call to this function SHOULD be completed |
| 98 | + /// as soon as possible, preferably before returning from this method. |
| 99 | + /// |
| 100 | + /// This function SHOULD provide a way to let the caller know |
| 101 | + /// whether it succeeded, failed or timed out. |
| 102 | + /// |
| 103 | + /// This function SHOULD only be called in cases where it is absolutely necessary, |
| 104 | + /// such as when using some FaaS providers that may suspend the process after |
| 105 | + /// an invocation, but before the exporter exports the completed spans. |
| 106 | + /// |
| 107 | + /// This function SHOULD complete or abort within some timeout. This function can be |
| 108 | + /// implemented as a blocking API or an asynchronous API which notifies the caller via |
| 109 | + /// a callback or an event. OpenTelemetry client authors can decide if they want to |
| 110 | + /// make the flush timeout configurable. |
| 111 | + fn force_flush(&mut self) -> BoxFuture<'static, ExportResult> { |
| 112 | + Box::pin(async { Ok(()) }) |
| 113 | + } |
94 | 114 | /// Set the resource for the exporter.
|
95 | 115 | fn set_resource(&mut self, _resource: &Resource) {}
|
96 | 116 | }
|
|
0 commit comments