An OpenMetrics parser in Rust 🦀
extern crate openmetrics;
use std::fs;
fn main() {
let unparsed_file = fs::read_to_string("test.prom").expect("cannot read file!");
openmetrics::parse_metrics(unparsed_file);
}
Sample metrics data:
{
"go_goroutines": MetricGroup {
help: "Number of goroutines that currently exist.",
type: GAUGE,
metric: Metric(
[
{
"value": "9",
},
],
),
},
}
- bin -> lib
- consume URLs
- consume specific file
- methods to specify specific alternative output (JSON/YAML/TOML/string/etc)
- Add label and metric logic to convert parsed pest data into usable data
- parse labels within each metricLine
- reconsider best way to handle labels and special labels (such as quartile)