https://github.com/ccakes/prometheus-parse-rs
Rust parser for the Prometheus exposition text format
https://github.com/ccakes/prometheus-parse-rs
Last synced: 10 months ago
JSON representation
Rust parser for the Prometheus exposition text format
- Host: GitHub
- URL: https://github.com/ccakes/prometheus-parse-rs
- Owner: ccakes
- License: apache-2.0
- Created: 2019-05-21T03:53:45.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-09T22:27:38.000Z (over 2 years ago)
- Last Synced: 2024-04-24T14:29:54.231Z (about 2 years ago)
- Language: Rust
- Size: 31.3 KB
- Stars: 7
- Watchers: 1
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
# prometheus-parse
Simple but effective Rust parser for the Prometheus scrape format.
```rust
let body = reqwest::get("https://prometheus.example.com/metrics")?
.text()?;
let lines: Vec<_> = body.lines().map(|s| Ok(s.to_owned)).collect();
let metrics = prometheus_parse::Scrape::parse(lines.into_iter())?;
```
### Attribution
This crate is 99.99% lifted from [prometheus-scrape](https://crates.io/crates/prometheus-scrape) with some minor API changes and a GitHub repo to encourage PRs.
## License
Apache License 2.0 - same as original project