opentelemetry_sdk::export::logs

Trait LogExporter

source
pub trait LogExporter:
    Send
    + Sync
    + Debug {
    // Required method
    fn export<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        batch: LogBatch<'life1>,
    ) -> Pin<Box<dyn Future<Output = LogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn shutdown(&mut self) { ... }
    fn set_resource(&mut self, _resource: &Resource) { ... }
}
Expand description

LogExporter defines the interface that log exporters should implement.

Required Methods§

source

fn export<'life0, 'life1, 'async_trait>( &'life0 mut self, batch: LogBatch<'life1>, ) -> Pin<Box<dyn Future<Output = LogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Exports a batch of log records and their associated instrumentation scopes.

The export method is responsible for sending a batch of log records to an external destination. It takes a LogBatch as an argument, which contains references to the log records and their corresponding instrumentation scopes. The method returns a LogResult indicating the success or failure of the export operation.

§Arguments
  • batch - A LogBatch containing the log records and instrumentation scopes to be exported.
§Returns

A LogResult<()>, which is a result type indicating either a successful export (with Ok(())) or an error (Err(LogError)) if the export operation failed.

Provided Methods§

source

fn shutdown(&mut self)

Shuts down the exporter.

source

fn set_resource(&mut self, _resource: &Resource)

Set the resource for the exporter.

Implementors§