pub struct TargetMetadataQueryBuilder { /* private fields */ }Expand description
Provides methods to build a query to the target metadata endpoint and send it to Prometheus.
Implementations§
Source§impl TargetMetadataQueryBuilder
Note that Prometheus combines all filters that have been set in the final request
and only returns target metadata that matches all filters.
See the official documentation for a thorough explanation on the filters that can
be set: Prometheus API documentation.
impl TargetMetadataQueryBuilder
Note that Prometheus combines all filters that have been set in the final request
and only returns target 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 match_target(self, match_target: impl Display) -> Self
pub fn match_target(self, match_target: impl Display) -> Self
Pass a label selector to instruct Prometheus to filter targets by their label sets. Calling this repeatedly will replace the current label selector.
Sourcepub fn metric(self, metric: impl Display) -> Self
pub fn metric(self, metric: impl Display) -> Self
Set this to only retrieve target metadata for this metric. Calling this repeatedly will replace the current metric name.
Sourcepub fn limit(self, limit: i64) -> Self
pub fn limit(self, limit: i64) -> Self
Limit the maximum number of targets to match. Calling this repeatedly will replace the current limit.
Sourcepub async fn get(self) -> Result<Vec<TargetMetadata>, Error>
pub async fn get(self) -> Result<Vec<TargetMetadata>, Error>
Execute the target metadata query (using HTTP GET) and return the collection of
TargetMetadata sent by Prometheus.