IngestionObserver

Trait IngestionObserver 

Source
pub trait IngestionObserver: Send + Sync {
    // Provided methods
    fn on_success(&self, _ctx: &IngestionContext, _stats: IngestionStats) { ... }
    fn on_failure(
        &self,
        _ctx: &IngestionContext,
        _severity: IngestionSeverity,
        _error: &IngestionError,
    ) { ... }
    fn on_alert(
        &self,
        ctx: &IngestionContext,
        severity: IngestionSeverity,
        error: &IngestionError,
    ) { ... }
}
Expand description

Observer interface for ingestion outcomes.

Implementors can record metrics, logs, or trigger alerts.

Provided Methods§

Source

fn on_success(&self, _ctx: &IngestionContext, _stats: IngestionStats)

Called when ingestion succeeds.

Source

fn on_failure( &self, _ctx: &IngestionContext, _severity: IngestionSeverity, _error: &IngestionError, )

Called when ingestion fails.

Source

fn on_alert( &self, ctx: &IngestionContext, severity: IngestionSeverity, error: &IngestionError, )

Called when an ingestion failure meets an alert threshold.

Default behavior forwards to Self::on_failure.

Implementors§