What is this?
promformat is a small utility library to help formatting Prometheus metrics.
Why?
In most cases exposing Prometheus metrics in Rust can be easily done using the prometheus crate, using global counters registered as lazy_static!s or similar tricks. However this can have potential downsides to some use cases.
For example, you may want to set and unset metrics based on varying conditions, or register/unregister specific label sets. Such a task is tricky and cumbersome to achieve in the prometheus crate.
Usage
Using promformat is pretty straightforward:
use Metrics;
let mut metrics = new;
let mut gauge1 = metrics.gauge;
gauge1.label.label.set;
let rendered = metrics.render;
License
promformat is licensed under the Apache 2.0 license