pub struct AlertRule {
pub name: String,
pub description: String,
pub condition: String,
pub severity: AlertSeverity,
pub for_duration: Duration,
pub labels: HashMap<String, String>,
pub annotations: HashMap<String, String>,
pub kernel_filter: Vec<String>,
pub domain_filter: Vec<String>,
}Expand description
Alert rule definition
Fields§
§name: StringRule name
description: StringRule description
condition: StringAlert condition expression
severity: AlertSeveritySeverity level
for_duration: DurationDuration condition must be true before firing
labels: HashMap<String, String>Labels for routing
annotations: HashMap<String, String>Annotations for alert message
kernel_filter: Vec<String>Kernels this rule applies to (empty = all)
domain_filter: Vec<String>Domains this rule applies to (empty = all)
Implementations§
Source§impl AlertRule
impl AlertRule
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set description
Sourcepub fn severity(self, severity: AlertSeverity) -> Self
pub fn severity(self, severity: AlertSeverity) -> Self
Set severity
Sourcepub fn for_duration(self, duration: Duration) -> Self
pub fn for_duration(self, duration: Duration) -> Self
Set for_duration
Sourcepub fn annotation(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn annotation( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add an annotation
Sourcepub fn for_kernels(self, kernels: Vec<String>) -> Self
pub fn for_kernels(self, kernels: Vec<String>) -> Self
Filter to specific kernels
Sourcepub fn for_domains(self, domains: Vec<String>) -> Self
pub fn for_domains(self, domains: Vec<String>) -> Self
Filter to specific domains
Sourcepub fn kernel_unhealthy() -> Self
pub fn kernel_unhealthy() -> Self
Kernel unhealthy rule
Sourcepub fn high_latency() -> Self
pub fn high_latency() -> Self
High latency rule
Sourcepub fn high_error_rate() -> Self
pub fn high_error_rate() -> Self
High error rate rule
Sourcepub fn queue_depth() -> Self
pub fn queue_depth() -> Self
Queue depth rule
Sourcepub fn gpu_memory() -> Self
pub fn gpu_memory() -> Self
GPU memory rule
Sourcepub fn slo_violation(slo_name: impl Into<String>) -> Self
pub fn slo_violation(slo_name: impl Into<String>) -> Self
SLO violation rule
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.