Trait opentelemetry::sdk::export::metrics::AggregatorSelector
source · pub trait AggregatorSelector {
// Required method
fn aggregator_for(
&self,
descriptor: &Descriptor
) -> Option<Arc<dyn Aggregator + Sync + Send + 'static>>;
}
Available on crate feature
metrics
only.Expand description
AggregatorSelector supports selecting the kind of Aggregator
to use at
runtime for a specific metric instrument.
Required Methods§
sourcefn aggregator_for(
&self,
descriptor: &Descriptor
) -> Option<Arc<dyn Aggregator + Sync + Send + 'static>>
fn aggregator_for( &self, descriptor: &Descriptor ) -> Option<Arc<dyn Aggregator + Sync + Send + 'static>>
This allocates a variable number of aggregators of a kind suitable for the requested export.
When the call returns None
, the metric instrument is explicitly disabled.
This must return a consistent type to avoid confusion in later stages of the metrics export process, e.g., when merging or checkpointing aggregators for a specific instrument.
This call should not block.