pub enum MetricsExporter {
Tonic {
sender: Mutex<Sender<ExportMsg>>,
metadata: Option<MetadataMap>,
temporality_selector: Box<dyn TemporalitySelector>,
aggregation_selector: Box<dyn AggregationSelector>,
},
Http {
timeout: Duration,
headers: Option<HashMap<String, String>>,
collector_endpoint: Uri,
metrics_exporter: Option<Arc<dyn HttpClient>>,
temporality_selector: Box<dyn TemporalitySelector>,
aggregation_selector: Box<dyn AggregationSelector>,
},
}
Available on crate feature
metrics
only.Expand description
Export metrics in OTEL format.
Variants§
Tonic
Fields
§
metadata: Option<MetadataMap>
Additional headers of the outbound requests.
§
temporality_selector: Box<dyn TemporalitySelector>
temporality selector
§
aggregation_selector: Box<dyn AggregationSelector>
aggregation selector
Available on crate feature
grpc-tonic
only.metrics exporter using using tonic as grpc layer.
Http
Fields
§
metrics_exporter: Option<Arc<dyn HttpClient>>
metrics exporter
§
temporality_selector: Box<dyn TemporalitySelector>
temporality selector
§
aggregation_selector: Box<dyn AggregationSelector>
aggregation selector
Available on crate feature
http-proto
only.metrics exporter using HTTP transport
Implementations§
source§impl MetricsExporter
impl MetricsExporter
sourcepub fn new(
export_builder: TonicExporterBuilder,
temporality_selector: Box<dyn TemporalitySelector>,
aggregation_selector: Box<dyn AggregationSelector>
) -> Result<MetricsExporter>
Available on crate feature grpc-tonic
only.
pub fn new( export_builder: TonicExporterBuilder, temporality_selector: Box<dyn TemporalitySelector>, aggregation_selector: Box<dyn AggregationSelector> ) -> Result<MetricsExporter>
grpc-tonic
only.Create a new OTLP gRPC metrics exporter.
sourcepub fn new_http(
export_builder: HttpExporterBuilder,
temporality_selector: Box<dyn TemporalitySelector>,
aggregation_selector: Box<dyn AggregationSelector>
) -> Result<MetricsExporter>
Available on crate feature http-proto
only.
pub fn new_http( export_builder: HttpExporterBuilder, temporality_selector: Box<dyn TemporalitySelector>, aggregation_selector: Box<dyn AggregationSelector> ) -> Result<MetricsExporter>
http-proto
only.Create a new OTLP HTTP metrics exporter.
Trait Implementations§
source§impl AggregationSelector for MetricsExporter
impl AggregationSelector for MetricsExporter
source§fn aggregation(&self, kind: InstrumentKind) -> Aggregation
fn aggregation(&self, kind: InstrumentKind) -> Aggregation
Selects the aggregation and the parameters to use for that aggregation based on
the InstrumentKind.
source§impl Debug for MetricsExporter
impl Debug for MetricsExporter
source§impl PushMetricsExporter for MetricsExporter
impl PushMetricsExporter for MetricsExporter
source§fn export<'life0, 'life1, 'async_trait>(
&'life0 self,
metrics: &'life1 mut ResourceMetrics
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn export<'life0, 'life1, 'async_trait>( &'life0 self, metrics: &'life1 mut ResourceMetrics ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Export serializes and transmits metric data to a receiver. Read more
source§impl TemporalitySelector for MetricsExporter
impl TemporalitySelector for MetricsExporter
source§fn temporality(&self, kind: InstrumentKind) -> Temporality
fn temporality(&self, kind: InstrumentKind) -> Temporality
Selects the temporality to use based on the InstrumentKind.
Auto Trait Implementations§
impl !RefUnwindSafe for MetricsExporter
impl Send for MetricsExporter
impl Sync for MetricsExporter
impl Unpin for MetricsExporter
impl !UnwindSafe for MetricsExporter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request