pub struct PrometheusExporter { /* private fields */ }
Available on crate feature
prometheus
only.Expand description
A Prometheus exporter for OpenTelemetry metrics.
Responsible for encoding OpenTelemetry metrics into Prometheus format.
The exporter implements the
opentelemetry_sdk::metrics::reader::MetricReader
trait and therefore can be passed to a
opentelemetry_sdk::metrics::SdkMeterProvider
.
Use collector
to get a
prometheus_client::collector::Collector
that can be registered with a
prometheus_client::registry::Registry
to provide metrics to Prometheus.
Implementations§
Source§impl PrometheusExporter
impl PrometheusExporter
Sourcepub fn builder() -> PrometheusExporterBuilder
pub fn builder() -> PrometheusExporterBuilder
Returns a new PrometheusExporterBuilder
to configure a PrometheusExporter
.
Trait Implementations§
Source§impl Clone for PrometheusExporter
impl Clone for PrometheusExporter
Source§fn clone(&self) -> PrometheusExporter
fn clone(&self) -> PrometheusExporter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Collector for PrometheusExporter
impl Collector for PrometheusExporter
Source§impl Debug for PrometheusExporter
impl Debug for PrometheusExporter
Source§impl MetricReader for PrometheusExporter
impl MetricReader for PrometheusExporter
Source§fn register_pipeline(&self, pipeline: Weak<Pipeline>)
fn register_pipeline(&self, pipeline: Weak<Pipeline>)
Registers a [MetricReader] with a [Pipeline]. Read more
Source§fn collect(&self, rm: &mut ResourceMetrics) -> MetricResult<()>
fn collect(&self, rm: &mut ResourceMetrics) -> MetricResult<()>
Gathers and returns all metric data related to the [MetricReader] from the
SDK and stores it in the provided [ResourceMetrics] reference. Read more
Source§fn force_flush(&self) -> OTelSdkResult
fn force_flush(&self) -> OTelSdkResult
Flushes all metric measurements held in an export pipeline. Read more
Source§fn shutdown(&self) -> OTelSdkResult
fn shutdown(&self) -> OTelSdkResult
Flushes all metric measurements held in an export pipeline and releases any
held computational resources. Read more
Source§fn temporality(&self, kind: InstrumentKind) -> Temporality
fn temporality(&self, kind: InstrumentKind) -> Temporality
The output temporality, a function of instrument kind.
This SHOULD be obtained from the exporter. Read more
Auto Trait Implementations§
impl Freeze for PrometheusExporter
impl RefUnwindSafe for PrometheusExporter
impl Send for PrometheusExporter
impl Sync for PrometheusExporter
impl Unpin for PrometheusExporter
impl UnwindSafe for PrometheusExporter
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