Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ispringle/openmetrics-rs
An OpenMetrics (Prometheus Metrics) Parser in Rust
https://github.com/ispringle/openmetrics-rs
hacktoberfest hacktoberfest2020 openmetrics prometheus prometheus-metrics rust
Last synced: 2 months ago
JSON representation
An OpenMetrics (Prometheus Metrics) Parser in Rust
- Host: GitHub
- URL: https://github.com/ispringle/openmetrics-rs
- Owner: ispringle
- License: mit
- Created: 2020-02-27T18:40:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T17:44:48.000Z (over 1 year ago)
- Last Synced: 2024-04-25T04:02:34.418Z (8 months ago)
- Topics: hacktoberfest, hacktoberfest2020, openmetrics, prometheus, prometheus-metrics, rust
- Language: Rust
- Homepage:
- Size: 22.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenMetrics-rs
![Rust](https://github.com/pard68/openmetrics-rs/workflows/Rust/badge.svg?branch=master&event=push)
[![Docs](https://docs.rs/openmetrics/badge.svg)](https://docs.rs/openmetrics)
[![Crates.io](https://img.shields.io/crates/v/openmetrics)](https://crates.io/crates/openmetrics)An OpenMetrics parser in Rust 🦀
## Example
```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:
```shell
{
"go_goroutines": MetricGroup {
help: "Number of goroutines that currently exist.",
type: GAUGE,
metric: Metric(
[
{
"value": "9",
},
],
),
},
}
```# TODO
- [X] bin -> lib
- [ ] consume URLs
- [ ] consume specific file
- [ ] methods to specify specific alternative output (JSON/YAML/TOML/string/etc)
- [X] 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)