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§
- Counter
Value Encoder - Encoder for a counter value.
- Descriptor
Encoder - Encoder for a Metric Descriptor.
- Exemplar
Value Encoder - Encoder for an exemplar value.
- Gauge
Value Encoder - Encoder for a gauge value.
- Label
Encoder - Encoder for a label.
- Label
KeyEncoder - Encoder for a label key.
- Label
SetEncoder - Encoder for a label set.
- Label
Value Encoder - Encoder for a label value.
- Metric
Encoder - Encoder for a metric.
- Registered
- A metric handle whose lifetime controls registry exposure and attached cleanup.
- Registration
- A shared lifecycle token for a
Registeredmetric handle. - Registry
- Manages metrics with explicit lifetimes.
Enums§
- Metric
Type - OpenMetrics metric type.
- NoLabel
Set - Uninhabited type to represent the lack of a label set for a metric
Traits§
- Encode
Counter Value - An encodable counter value.
- Encode
Exemplar Time - An encodable exemplar time.
- Encode
Exemplar Value - An encodable exemplar value.
- Encode
Gauge Value - An encodable gauge value.
- Encode
Label - An encodable label.
- Encode
Label Key - An encodable label key.
- Encode
Label SetTrait - An encodable label set.
- Encode
Label Value Trait - An encodable label value.
- Encode
Metric - Trait implemented by each metric type, e.g.
Counter, to implement its encoding in the OpenMetric text format. - Gauge
Ext - Convenience methods for Prometheus gauges.
- Metric
- Super trait representing an abstract Prometheus metric.
- Metrics
Ext - One-line constructors for the common metric types.
- Typed
Metric - 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.
- Counter
Family - A registered family of counters keyed by
L. - Gauge
- A registered gauge metric.
- Gauge
Family - A registered family of gauges keyed by
L. - Gauge
Value - Native integer width used by
raw::Gaugeon this target. - Histogram
- A registered histogram metric.
Derive Macros§
- Encode
Label Set - Encode
Label SetTrait - Derive
prometheus_client::encoding::EncodeLabelSet. - Encode
Label Value - Encode
Label Value Trait - Derive
prometheus_client::encoding::EncodeLabelValue. - Encode
Struct