prometheus-extensions
Prometheus extensions for richer metric collection in Rust.
Types
| Type | Purpose |
|---|---|
AggregateCounter |
A CounterVec wrapper that automatically emits an extra unlabeled total alongside every per-label counter. |
ScientificEncoder |
A Prometheus text-format encoder that renders values in scientific notation with a trailing comma after the last label (Kafka JMX exporter compatible). |
Sensor |
A lock-free exponential moving average (EMA) gauge for tracking smoothed rates. |
Usage
use Opts;
use Collector;
use ;
let counter = new.unwrap;
counter.with_label_values.inc_by;
counter.with_label_values.inc_by;
// Collecting yields 3 metrics: unlabeled total (142) + two labeled.
let families = counter.collect;
// Encode in scientific notation
let encoder = new;
let mut buf = Vecnew;
encoder.encode.unwrap;
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.