Trait PushMetricExporter

Source
pub trait PushMetricExporter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn export(
        &self,
        metrics: &ResourceMetrics,
    ) -> impl Future<Output = OTelSdkResult> + Send;
    fn force_flush(&self) -> OTelSdkResult;
    fn shutdown_with_timeout(&self, timeout: Duration) -> OTelSdkResult;
    fn temporality(&self) -> Temporality;

    // Provided method
    fn shutdown(&self) -> OTelSdkResult { ... }
}
Expand description

Exporter handles the delivery of metric data to external receivers.

This is the final component in the metric push pipeline.

Required Methods§

Source

fn export( &self, metrics: &ResourceMetrics, ) -> impl Future<Output = OTelSdkResult> + Send

Export serializes and transmits metric data to a receiver.

All retry logic must be contained in this function. The SDK does not implement any retry logic. All errors returned by this function are considered unrecoverable and will be logged.

Source

fn force_flush(&self) -> OTelSdkResult

Flushes any metric data held by an exporter.

Source

fn shutdown_with_timeout(&self, timeout: Duration) -> OTelSdkResult

Releases any held computational resources.

After Shutdown is called, calls to Export will perform no operation and instead will return an error indicating the shutdown state.

Source

fn temporality(&self) -> Temporality

Access the Temporality of the MetricExporter.

Provided Methods§

Source

fn shutdown(&self) -> OTelSdkResult

Shutdown with the default timeout of 5 seconds.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§