Crates.io | proq |
lib.rs | proq |
version | 0.1.0 |
source | src |
created_at | 2019-12-23 20:04:19.282201 |
updated_at | 2020-01-03 18:43:06.148366 |
description | Idiomatic Async Prometheus Query (PromQL) Client for Rust. |
homepage | https://github.com/vertexclique/proq |
repository | https://github.com/vertexclique/proq |
max_upload_size | |
id | 191848 |
size | 38,959 |
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.
[dependencies]
proq = "0.1"
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.