pub struct AlertRule {
pub name: String,
pub expr: String,
pub metric_name: Option<String>,
pub severity: Option<String>,
pub message: Option<String>,
pub runbook_url: Option<String>,
pub file: PathBuf,
pub line: usize,
pub column: usize,
}Expand description
A discovered Prometheus alert rule.
Represents an alert rule found in YAML files that references a metric
via its PromQL expression.
Fields§
§name: StringThe alert name (e.g., HighErrorRate).
expr: StringThe PromQL expression for this alert.
metric_name: Option<String>The primary metric name extracted from the expression.
severity: Option<String>Alert severity (if specified in labels).
message: Option<String>Alert message (from annotations).
runbook_url: Option<String>Runbook URL (from annotations).
file: PathBufThe file path where this alert is defined.
line: usizeLine number (1-indexed) where the alert starts.
column: usizeColumn number (0-indexed).
Trait Implementations§
impl Eq for AlertRule
impl StructuralPartialEq for AlertRule
Auto Trait Implementations§
impl Freeze for AlertRule
impl RefUnwindSafe for AlertRule
impl Send for AlertRule
impl Sync for AlertRule
impl Unpin for AlertRule
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more