https://github.com/vertexclique/proq
Idiomatic Async Prometheus Query (PromQL) Client for Rust.
https://github.com/vertexclique/proq
async-client metric-aggregation metrics-gathering prometheus promql rust-lang
Last synced: about 1 year ago
JSON representation
Idiomatic Async Prometheus Query (PromQL) Client for Rust.
- Host: GitHub
- URL: https://github.com/vertexclique/proq
- Owner: vertexclique
- Created: 2019-12-23T22:26:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T09:36:04.000Z (about 6 years ago)
- Last Synced: 2025-03-26T11:11:18.584Z (over 1 year ago)
- Topics: async-client, metric-aggregation, metrics-gathering, prometheus, promql, rust-lang
- Language: Rust
- Homepage: https://docs.rs/proq
- Size: 194 KB
- Stars: 20
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Proq – Idiomatic Async Prometheus Query (PromQL) Client for Rust.
[](https://github.com/vertexclique/proq/actions)
[](https://crates.io/crates/proq)
[](https://docs.rs/proq/)
This crate provides async client for Prometheus Query API.
All queries can be written with PromQL notation.
Timeout and protocol configuration can be passed at the client initiation time.
#### Adding as dependency
```toml
[dependencies]
proq = "0.1"
```
#### Basic Usage
```rust
use proq::prelude::*;
use std::time::Duration;
fn main() {
let client = ProqClient::new(
"localhost:9090",
Some(Duration::from_secs(5)),
).unwrap();
futures::executor::block_on(async {
let end = Utc::now();
let start = Some(end - chrono::Duration::minutes(1));
let step = Some(Duration::from_secs_f64(1.5));
let rangeq = client.range_query("up", start, Some(end), step).await;
});
}
```
For more information please head to the [Documentation](https://docs.rs/proq/).