pub fn rules(host: &str) -> Result<RulesQueryBuilder, Error>
Expand description

Create a RulesQueryBuilder to apply filters to the rules query before sending it to Prometheus.

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

use prometheus_http_query::{rules, RuleKind};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), anyhow::Error> {
    let response = rules("http://localhost:9090")?.kind(RuleKind::Recording).get().await;

    assert!(response.is_ok());

    Ok(())
}