Struct prometheus_http_query::RulesQueryBuilder
source · pub struct RulesQueryBuilder { /* private fields */ }
Expand description
Provides methods to build a query to the rules endpoint and send it to Prometheus.
Implementations§
source§impl RulesQueryBuilder
impl RulesQueryBuilder
Note that Prometheus combines all filters that have been set in the final request
and only returns rules that match all filters.
See the official documentation for a thorough explanation on the filters that can
be set: Prometheus API documentation.
sourcepub fn kind(self, kind: RuleKind) -> Self
pub fn kind(self, kind: RuleKind) -> Self
Set this to instruct Prometheus to only return a specific type of rule (either recording or alerting rules) instead of both. Calling this repeatedly will replace the current setting.
sourcepub fn names<T>(self, names: T) -> Self
pub fn names<T>(self, names: T) -> Self
Pass rule names to instruct Prometheus to only return those rules whose names match one of them. This method can be called repeatedly and merge the names with those that have been set before.
sourcepub fn name(self, name: impl Display) -> Self
pub fn name(self, name: impl Display) -> Self
Pass a rule name to instruct Prometheus to return rules that match this name. This method can be called repeatedly to extend the set of rule names that will be sent to Prometheus.
sourcepub fn groups<T>(self, groups: T) -> Self
pub fn groups<T>(self, groups: T) -> Self
Pass group names to instruct Prometheus to only return those rules that are part of one of these groups. This method can be called repeatedly and merge the group names with those that have been set before.
sourcepub fn group(self, group: impl Display) -> Self
pub fn group(self, group: impl Display) -> Self
Pass a group name to instruct Prometheus to return rules that are part of this group. This method can be called repeatedly to extend the set of group names that will be sent to Prometheus.
sourcepub fn files<T>(self, files: T) -> Self
pub fn files<T>(self, files: T) -> Self
Pass file names to instruct Prometheus to only return those rules that are defined in one of those files. This method can be called repeatedly and merge the file names with those that have been set before.
sourcepub fn file(self, file: impl Display) -> Self
pub fn file(self, file: impl Display) -> Self
Pass a file name to instruct Prometheus to return rules that are defined in this file. This method can be called repeatedly to extend the set of file names that will be sent to Prometheus.
Trait Implementations§
source§impl Clone for RulesQueryBuilder
impl Clone for RulesQueryBuilder
source§fn clone(&self) -> RulesQueryBuilder
fn clone(&self) -> RulesQueryBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more