pub struct AlertRule {
pub id: String,
pub name: String,
pub description: String,
pub metric: MetricType,
pub operator: ComparisonOperator,
pub threshold: f64,
pub duration_secs: u64,
pub severity: AlertSeverity,
pub enabled: bool,
pub channels: Vec<String>,
pub labels: HashMap<String, String>,
pub suppress_duration_secs: u64,
}Expand description
Alert rule configuration
Fields§
§id: StringUnique rule ID
name: StringHuman-readable name
description: StringDescription of what triggers this alert
metric: MetricTypeMetric to monitor
operator: ComparisonOperatorComparison operator
threshold: f64Threshold value
duration_secs: u64Duration the condition must persist before alerting
severity: AlertSeverityAlert severity
enabled: boolEnable/disable this rule
channels: Vec<String>Notification channels to use
labels: HashMap<String, String>Custom labels for this alert
suppress_duration_secs: u64Suppress similar alerts for this duration
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AlertRule
impl<'de> Deserialize<'de> for AlertRule
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 AlertRule
impl RefUnwindSafe for AlertRule
impl Send for AlertRule
impl Sync for AlertRule
impl Unpin for AlertRule
impl UnwindSafe for AlertRule
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