Module 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/prometheus/OpenMetrics/blob/v1.0.0/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§

openmetrics_data_model
Data models that are automatically generated from OpenMetrics protobuf format.

Functions§

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