Module prometheus_client::encoding::protobuf

source ·
Available on crate feature protobuf only.
Expand description

Open Metrics protobuf implementation.

// Returns `MetricSet`, the top-level container type. Please refer to [openmetrics_data_model.proto](https://github.com/OpenObservability/OpenMetrics/blob/main/proto/openmetrics_data_model.proto) for details.
let metric_set = encode(&registry).unwrap();

let family = metric_set.metric_families.first().unwrap();
assert_eq!("my_counter", family.name);
assert_eq!("This is my counter.", family.help);

Modules§

Functions§

  • Encode the metrics registered with the provided Registry into MetricSet using the OpenMetrics protobuf format.