[][src]Crate proq

Idiomatic Async Prometheus Query (PromQL) Client for Rust.

This crate provides general client API for Prometheus Query API. All queries can be written with PromQL notation.

Basic Usage

use proq::prelude::*;

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 extensive documentation about which methods are available and what they are doing you can see the api::ProqClient documentation.

Modules

api

Proq client API

errors

Proq client related error listing

prelude

Prelude of the Proq package.

query_types

Request types that are sent by the Proq to different endpoints.

result_types

Response types to Proq from Prometheus.

value_types

All value types which enables us to interpret various parts of Prometheus.