pub struct MetricMetadataQueryBuilder { /* private fields */ }
Expand description
Provides methods to build a query to the metric metadata endpoint and send it to Prometheus.
Implementations§
source§impl MetricMetadataQueryBuilder
impl MetricMetadataQueryBuilder
Note that Prometheus combines all filters that have been set in the final request
and only returns metric metadata that matches all filters.
See the official documentation for a thorough explanation on the filters that can
be set: Prometheus API documentation.
sourcepub fn metric(self, metric: impl Display) -> Self
pub fn metric(self, metric: impl Display) -> Self
Instruct Prometheus to filter metadata by this metric name. Calling this repeatedly will replace the current setting.
sourcepub fn limit(self, limit: i32) -> Self
pub fn limit(self, limit: i32) -> Self
Limit the maximum number of metrics to return. Calling this repeatedly will replace the current limit.
sourcepub fn limit_per_metric(self, limit_per_metric: i32) -> Self
pub fn limit_per_metric(self, limit_per_metric: i32) -> Self
Limit the maximum number of metadata to return per metric. Calling this repeatedly will replace the current limit.
sourcepub async fn get(self) -> Result<HashMap<String, Vec<MetricMetadata>>, Error>
pub async fn get(self) -> Result<HashMap<String, Vec<MetricMetadata>>, Error>
Execute the metric metadata query (using HTTP GET) and return the collection of
MetricMetadata
sent by Prometheus.
Trait Implementations§
source§impl Clone for MetricMetadataQueryBuilder
impl Clone for MetricMetadataQueryBuilder
source§fn clone(&self) -> MetricMetadataQueryBuilder
fn clone(&self) -> MetricMetadataQueryBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more