[][src]Trait opentelemetry::sdk::export::trace::SpanExporter

pub trait SpanExporter: Send + Debug {
#[must_use]    pub fn export<'life0, 'async_trait>(
        &'life0 mut self,
        batch: Vec<SpanData>
    ) -> Pin<Box<dyn Future<Output = ExportResult> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; pub fn shutdown(&mut self) { ... } }
This is supported on crate feature trace only.

SpanExporter defines the interface that protocol-specific exporters must implement so that they can be plugged into OpenTelemetry SDK and support sending of telemetry data.

The goal of the interface is to minimize burden of implementation for protocol-dependent telemetry exporters. The protocol exporter is expected to be primarily a simple telemetry data encoder and transmitter.

Required methods

#[must_use]pub fn export<'life0, 'async_trait>(
    &'life0 mut self,
    batch: Vec<SpanData>
) -> Pin<Box<dyn Future<Output = ExportResult> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Exports a batch of readable spans. Protocol exporters that will implement this function are typically expected to serialize and transmit the data to the destination.

This function will never be called concurrently for the same exporter instance. It can be called again only after the current call returns.

This function must not block indefinitely, there must be a reasonable upper limit after which the call must time out with an error result.

Any retry logic that is required by the exporter is the responsibility of the exporter.

Loading content...

Provided methods

pub fn shutdown(&mut self)[src]

Shuts down the exporter. Called when SDK is shut down. This is an opportunity for exporter to do any cleanup required.

This function should be called only once for each SpanExporter instance. After the call to shutdown, subsequent calls to export are not allowed and should return an error.

This function should not block indefinitely (e.g. if it attempts to flush the data and the destination is unavailable). SDK authors can decide if they want to make the shutdown timeout configurable.

Loading content...

Implementors

impl SpanExporter for TestSpanExporter[src]

impl SpanExporter for TokioSpanExporter[src]

impl SpanExporter for NoopSpanExporter[src]

impl<W> SpanExporter for Exporter<W> where
    W: Write + Debug + Send + 'static, 
[src]

pub fn export<'life0, 'async_trait>(
    &'life0 mut self,
    batch: Vec<SpanData>
) -> Pin<Box<dyn Future<Output = ExportResult> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Export spans to stdout

Loading content...