Function prometheus_http_query::label_names
source · pub fn label_names(host: &str) -> Result<LabelNamesQueryBuilder, Error>
Expand description
Create a LabelNamesQueryBuilder
to apply filters to a query for the label
names endpoint before sending it to Prometheus.
This is just a convenience function for one-off requests, see Client::label_names
.
use prometheus_http_query::label_names;
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), anyhow::Error> {
let response = label_names("http://localhost:9090")?.get().await;
assert!(response.is_ok());
Ok(())
}