pub struct AlertRouter { /* private fields */ }Expand description
Alert router that directs alerts to appropriate sinks
§Routing Rules
- If an alert has tags, it’s sent to sinks that handle those tags
- If no tag matches, it’s sent to default sinks (those with empty tag lists)
- Sinks with no tags configured receive all alerts
§Dead Letter Queue
Failed deliveries are stored in a dead-letter queue for later retry.
Implementations§
Source§impl AlertRouter
impl AlertRouter
Sourcepub fn with_max_dlq_size(self, size: usize) -> Self
pub fn with_max_dlq_size(self, size: usize) -> Self
Set maximum dead-letter queue size
Sourcepub fn register_sink(&self, name: &str, sink: Arc<dyn AlertSink>)
pub fn register_sink(&self, name: &str, sink: Arc<dyn AlertSink>)
Sourcepub fn unregister_sink(&self, name: &str) -> bool
pub fn unregister_sink(&self, name: &str) -> bool
Sourcepub fn list_sinks(&self) -> Vec<String>
pub fn list_sinks(&self) -> Vec<String>
List registered sink names
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AlertRouter
impl RefUnwindSafe for AlertRouter
impl Unpin for AlertRouter
impl UnsafeUnpin for AlertRouter
impl UnwindSafe for AlertRouter
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> 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>
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