Skip to main content

series

Function series 

Source
pub fn series(host: &str) -> Result<SeriesQueryBuilder, Error>
Expand description

Create a SeriesQueryBuilder to apply filters to a series metadata query before sending it to Prometheus.

This is just a convenience function for one-off requests, see Client::series.

use prometheus_http_query::series;

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), anyhow::Error> {
    let response = series("http://localhost:9090")?
        .match_many(&["{handler=\"/api/v1/query\"}"])
        .get()
        .await;

    assert!(response.is_ok());

    Ok(())
}