Function prometheus_http_query::label_names
source · pub async fn label_names(
host: &str,
selectors: Option<Vec<Selector<'_>>>,
start: Option<i64>,
end: Option<i64>
) -> Result<Vec<String>, Error>
Expand description
Retrieve all label names (or use Selectors to select time series to read label names from).
This is just a convenience function for one-off requests, see Client::label_names.
use prometheus_http_query::{label_names, Error};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
let response = label_names("http://localhost:9090", None, None, None).await;
assert!(response.is_ok());
Ok(())
}