pub struct AlertPipeline { /* private fields */ }Expand description
A validated, runnable alert-processing pipeline.
Immutable after construction and cheap to clone behind an Arc, so it can
be swapped atomically on hot-reload while the sink task keeps a live
snapshot for the duration of a batch.
Implementations§
Source§impl AlertPipeline
impl AlertPipeline
Sourcepub fn static_silences(&self) -> &[StaticSilence]
pub fn static_silences(&self) -> &[StaticSilence]
The static silences declared in the config, for (re-)seeding the store.
Sourcepub fn max_dynamic_silences(&self) -> usize
pub fn max_dynamic_silences(&self) -> usize
Ceiling on concurrently-tracked dynamic (API) silences. The silence API rejects creation past this many.
Sourcepub fn incident_include(&self) -> Option<IncludeMode>
pub fn incident_include(&self) -> Option<IncludeMode>
The configured incident include mode, if grouping is enabled.
Sourcepub fn incident_nats_subject(&self) -> Option<&str>
pub fn incident_nats_subject(&self) -> Option<&str>
The configured incident NATS subject override, if any.
Sourcepub fn process(
&self,
results: ProcessResult,
state: &mut AlertPipelineState,
now: i64,
metrics: &dyn MetricsHook,
) -> ProcessResult
pub fn process( &self, results: ProcessResult, state: &mut AlertPipelineState, now: i64, metrics: &dyn MetricsHook, ) -> ProcessResult
Process the results produced from one input event: dedup folds
duplicates into dedup_store, grouping assigns survivors to incidents
in incident_store and annotates them with incident_id. Out-of-scope
results pass through untouched.
Sourcepub fn tick(
&self,
state: &mut AlertPipelineState,
now: i64,
metrics: &dyn MetricsHook,
) -> TickOutput
pub fn tick( &self, state: &mut AlertPipelineState, now: i64, metrics: &dyn MetricsHook, ) -> TickOutput
Advance time: emit due dedup repeat / resolved records and incident
emissions (group_wait / group_interval / repeat / resolved).
Sourcepub fn snapshot(&self, state: &AlertPipelineState) -> AlertPipelineSnapshot
pub fn snapshot(&self, state: &AlertPipelineState) -> AlertPipelineSnapshot
Capture the mutable state into a versioned persistence snapshot.
Sourcepub fn restore(
&self,
state: &mut AlertPipelineState,
snap: AlertPipelineSnapshot,
now: i64,
) -> bool
pub fn restore( &self, state: &mut AlertPipelineState, snap: AlertPipelineSnapshot, now: i64, ) -> bool
Restore a snapshot into state, pruning entries past their window at
now. Returns false on a version mismatch (caller starts fresh).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AlertPipeline
impl RefUnwindSafe for AlertPipeline
impl Send for AlertPipeline
impl Sync for AlertPipeline
impl Unpin for AlertPipeline
impl UnsafeUnpin for AlertPipeline
impl UnwindSafe for AlertPipeline
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
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> 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>
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>
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