6 releases
0.6.3 | Sep 20, 2022 |
---|---|
0.6.2 | May 16, 2022 |
0.6.1 | Apr 6, 2022 |
0.6.0 | Mar 18, 2022 |
0.5.1 | Jul 29, 2021 |
#562 in Asynchronous
3,795 downloads per month
51KB
856 lines
Rust Prometheus utilities
A Rust crate adding helpful utilities on top of the prometheus
crate, including:
- APIs to instrument futures with Prometheus metrics.
- APIs to ensure greater safety around gauges (through gaurds).
- Labeled metric APIs that apply some static checking to the labels.
lib.rs
:
Utilities for working with Prometheus metrics in Rust
This crate builds on the Promtheus crate to provide API with additional safety guardrails:
- Use
InstrumentedFuture
to easily instrument futures with metric updates. - Use
GuardedGauge
to work with gauges using an RAII-style guard that decrements the gauge upon drop. - Use
IntCounterWithLabels
andIntGaugeWithLabels
to produce labeled Prometheus metrics with a type-safe API.
Dependencies
~2.6–3.5MB
~71K SLoC