pub struct Mutable { /* private fields */ }Expand description
metrics::registry::Storage backed by a prometheus::Registry and
allowing to change a help description of the registered prometheus
metrics in runtime.
This metrics::registry::Storage is capable of registering metrics in its
prometheus::Registry on the fly. By default, the
prometheus::default_registry() is used.
§Errors
This mutable Storage returns metric::Fallible in its
metrics::registry::Storage interface, because it cannot panic, as is
called inside metrics::Registry and, so, may poison its inner locks.
That’s why possible errors are passed through, up to the
metrics::Recorder using this Storage, and should be resolved there.
Implementations§
Source§impl Storage
impl Storage
Sourcepub fn describe<M>(&self, name: &str, description: String)
pub fn describe<M>(&self, name: &str, description: String)
Changes the help description of the prometheus Metric
identified by its name.
Accepts only the following prometheus Metrics:
prometheus::IntCounter,prometheus::IntCounterVecprometheus::Gauge,prometheus::GaugeVecprometheus::Histogram,prometheus::HistogramVec
Intended to be used in metrics::Recorder::describe_counter(),
metrics::Recorder::describe_gauge() and
metrics::Recorder::describe_histogram() implementations.
Sourcepub fn register_external<M>(&self, metric: M) -> Result<()>
pub fn register_external<M>(&self, metric: M) -> Result<()>
Registers the provided prometheus metric in the underlying
prometheus::Registry in the way making it usable via this
metrics::registry::Storage (and, so, metrics crate interfaces).
Accepts only the following prometheus metrics:
prometheus::IntCounter,prometheus::IntCounterVecprometheus::Gauge,prometheus::GaugeVecprometheus::Histogram,prometheus::HistogramVec
§Errors
If the underlying prometheus::Registry fails to register the
provided metric.
Trait Implementations§
Source§impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<GenericCounter<AtomicU64>, MetricVec<CounterVecBuilder<AtomicU64>>>>>>>>> for Storage
impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<GenericCounter<AtomicU64>, MetricVec<CounterVecBuilder<AtomicU64>>>>>>>>> for Storage
Source§fn collection(&self) -> &Collection<PrometheusIntCounter>
fn collection(&self) -> &Collection<PrometheusIntCounter>
Collection of metric::Bundles stored in this storage.Source§impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<GenericGauge<AtomicF64>, MetricVec<GaugeVecBuilder<AtomicF64>>>>>>>>> for Storage
impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<GenericGauge<AtomicF64>, MetricVec<GaugeVecBuilder<AtomicF64>>>>>>>>> for Storage
Source§fn collection(&self) -> &Collection<PrometheusGauge>
fn collection(&self) -> &Collection<PrometheusGauge>
Collection of metric::Bundles stored in this storage.Source§impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<Histogram, MetricVec<HistogramVecBuilder>>>>>>>> for Storage
impl Get<Arc<RwLock<HashMap<String, Describable<Option<Either<Histogram, MetricVec<HistogramVecBuilder>>>>>>>> for Storage
Source§fn collection(&self) -> &Collection<PrometheusHistogram>
fn collection(&self) -> &Collection<PrometheusHistogram>
Collection of metric::Bundles stored in this storage.