pub struct AlertRuleConfig {
pub query: AlertRuleQuery,
pub condition: AlertRuleCondition,
pub labels: HashMap<String, String>,
pub evaluation: Option<AlertRuleEvaluation>,
pub absent_data_alert: Option<AbsentDataAlert>,
pub additional_queries: HashMap<String, AlertRuleQuery>,
pub formula: Option<String>,
pub reduce_to: Option<AlertReduceTo>,
}Expand description
An alert rule’s config: a metric query and a threshold condition (both
required), plus optional evaluation, absent-data alerting, and a formula over
additional_queries.
Fields§
§query: AlertRuleQueryThe metric to alert on. Required.
condition: AlertRuleConditionThe threshold check. Required.
labels: HashMap<String, String>Free-form labels attached to fired incidents.
evaluation: Option<AlertRuleEvaluation>Evaluation frequency and window.
absent_data_alert: Option<AbsentDataAlert>Alert when the metric stops reporting.
additional_queries: HashMap<String, AlertRuleQuery>Extra named queries (keys B..Z) referenced by formula.
formula: Option<String>A formula combining query and additional_queries.
reduce_to: Option<AlertReduceTo>Collapses each series to a single value before the threshold check.
Implementations§
Source§impl AlertRuleConfig
impl AlertRuleConfig
Sourcepub fn new(query: AlertRuleQuery, condition: AlertRuleCondition) -> Self
pub fn new(query: AlertRuleQuery, condition: AlertRuleCondition) -> Self
A config from a query and a condition, leaving everything else default.
Trait Implementations§
Source§impl Clone for AlertRuleConfig
impl Clone for AlertRuleConfig
Source§fn clone(&self) -> AlertRuleConfig
fn clone(&self) -> AlertRuleConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlertRuleConfig
impl Debug for AlertRuleConfig
Source§impl<'de> Deserialize<'de> for AlertRuleConfig
impl<'de> Deserialize<'de> for AlertRuleConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AlertRuleConfig
impl RefUnwindSafe for AlertRuleConfig
impl Send for AlertRuleConfig
impl Sync for AlertRuleConfig
impl Unpin for AlertRuleConfig
impl UnsafeUnpin for AlertRuleConfig
impl UnwindSafe for AlertRuleConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more