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§
Sourcefn on_success(&self, _ctx: &IngestionContext, _stats: IngestionStats)
fn on_success(&self, _ctx: &IngestionContext, _stats: IngestionStats)
Called when ingestion succeeds.
Sourcefn on_failure(
&self,
_ctx: &IngestionContext,
_severity: IngestionSeverity,
_error: &IngestionError,
)
fn on_failure( &self, _ctx: &IngestionContext, _severity: IngestionSeverity, _error: &IngestionError, )
Called when ingestion fails.
Sourcefn on_alert(
&self,
ctx: &IngestionContext,
severity: IngestionSeverity,
error: &IngestionError,
)
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.