Trait opentelemetry::sdk::metrics::exporter::PushMetricsExporter
source · pub trait PushMetricsExporter: AggregationSelector + TemporalitySelector + Send + Sync + 'static {
// Required methods
fn export<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 mut ResourceMetrics
) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn force_flush<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn shutdown(&self) -> Result<(), MetricsError>;
}
Available on crate feature
metrics
only.Expand description
Exporter handles the delivery of metric data to external receivers.
This is the final component in the metric push pipeline.
Required Methods§
sourcefn export<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 mut ResourceMetrics
) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn export<'life0, 'life1, 'async_trait>( &'life0 self, metrics: &'life1 mut ResourceMetrics ) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
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 reported to a configured error Handler.
sourcefn force_flush<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
fn force_flush<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), MetricsError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,
Flushes any metric data held by an exporter.
sourcefn shutdown(&self) -> Result<(), MetricsError>
fn shutdown(&self) -> Result<(), MetricsError>
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.