Skip to main content

Module metrics

Module metrics 

Source
Expand description

Utility functions for metrics

Re-exports§

pub use histogram::HistogramExt;

Modules§

collector
Metric collector implementation.
encoding
Exposition format implementations.
histogram
Utilities for working with histograms.
raw
Underlying Prometheus metric types. Used when constructing a metric to pass to crate::Metrics::register.
registry
Metric registry implementation.
status
Recording metrics with a status.

Structs§

CounterValueEncoder
Encoder for a counter value.
DescriptorEncoder
Encoder for a Metric Descriptor.
ExemplarValueEncoder
Encoder for an exemplar value.
GaugeValueEncoder
Encoder for a gauge value.
LabelEncoder
Encoder for a label.
LabelKeyEncoder
Encoder for a label key.
LabelSetEncoder
Encoder for a label set.
LabelValueEncoder
Encoder for a label value.
MetricEncoder
Encoder for a metric.
Registered
A metric handle whose lifetime controls registry exposure and attached cleanup.
Registration
A shared lifecycle token for a Registered metric handle.
Registry
Manages metrics with explicit lifetimes.

Enums§

MetricType
OpenMetrics metric type.
NoLabelSet
Uninhabited type to represent the lack of a label set for a metric

Traits§

EncodeCounterValue
An encodable counter value.
EncodeExemplarTime
An encodable exemplar time.
EncodeExemplarValue
An encodable exemplar value.
EncodeGaugeValue
An encodable gauge value.
EncodeLabel
An encodable label.
EncodeLabelKey
An encodable label key.
EncodeLabelSetTrait
An encodable label set.
EncodeLabelValueTrait
An encodable label value.
EncodeMetric
Trait implemented by each metric type, e.g. Counter, to implement its encoding in the OpenMetric text format.
GaugeExt
Convenience methods for Prometheus gauges.
Metric
Super trait representing an abstract Prometheus metric.
MetricsExt
One-line constructors for the common metric types.
TypedMetric
A metric that is aware of its Open Metrics metric type.

Functions§

add_attribute
Add an attribute to a sorted attribute list, maintaining sorted order via binary search.
validate_label
Validates that a label matches Prometheus metric name format: [a-zA-Z][a-zA-Z0-9_]*.

Type Aliases§

Counter
A registered counter metric.
CounterFamily
A registered family of counters keyed by L.
Gauge
A registered gauge metric.
GaugeFamily
A registered family of gauges keyed by L.
GaugeValue
Native integer width used by raw::Gauge on this target.
Histogram
A registered histogram metric.

Derive Macros§

EncodeLabelSet
EncodeLabelSetTrait
Derive prometheus_client::encoding::EncodeLabelSet.
EncodeLabelValue
EncodeLabelValueTrait
Derive prometheus_client::encoding::EncodeLabelValue.
EncodeStruct