Module prometheus_client::encoding::text
source · Expand description
Open Metrics text format implementation.
let mut buffer = vec![];
encode(&mut buffer, ®istry).unwrap();
let expected = "# HELP my_counter This is my counter.\n".to_owned() +
"# TYPE my_counter counter\n" +
"my_counter_total 1\n" +
"# EOF\n";
assert_eq!(expected, String::from_utf8(buffer).unwrap());
Structs
Helper type for
EncodeMetric
, see EncodeMetric::encode
.Traits
Trait implemented by each metric type, e.g.
Counter
, to implement its encoding.