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: String
Unique rule ID
name: String
Human-readable name
description: String
Description of what triggers this alert
metric: MetricType
Metric to monitor
operator: ComparisonOperator
Comparison operator
threshold: f64
Threshold value
duration_secs: u64
Duration the condition must persist before alerting
severity: AlertSeverity
Alert severity
enabled: bool
Enable/disable this rule
channels: Vec<String>
Notification channels to use
labels: HashMap<String, String>
Custom labels for this alert
suppress_duration_secs: u64
Suppress 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