Module alerting

Module alerting 

Source
Expand description

Alert routing system for enterprise monitoring.

This module provides a pluggable alert routing system with support for multiple destinations including webhooks (Slack, Teams, PagerDuty), email, and custom sinks.

§Feature Flags

  • alerting - Enables HTTP webhook delivery (requires reqwest crate)

§Example

use ringkernel_core::alerting::{AlertRouter, Alert, AlertSeverity, WebhookSink};

let router = AlertRouter::new()
    .with_sink(WebhookSink::new("https://hooks.slack.com/services/...")
        .with_severity_filter(AlertSeverity::Warning))
    .with_sink(WebhookSink::pagerduty("your-integration-key")
        .with_severity_filter(AlertSeverity::Critical));

router.send(Alert::new(AlertSeverity::Critical, "GPU memory exhausted")
    .with_source("kernel_1")
    .with_metadata("gpu_id", "0")
    .with_metadata("memory_used_gb", "24.5"));

Structs§

Alert
An alert to be routed to sinks.
AlertRouter
Alert router that sends alerts to multiple sinks.
AlertRouterStats
Alert router statistics.
AlertRoutingRule
Alert routing rule: route alerts to specific sinks based on criteria.
AlertTrigger
A threshold-based alert trigger that fires when a metric crosses a threshold.
DeduplicationConfig
Configuration for alert deduplication.
InMemorySink
Alert sink that stores alerts in memory (for testing).
LogSink
Alert sink that writes to the tracing/log system.

Enums§

AlertSeverity
Alert severity levels.
AlertSinkError
Error type for alert sink operations.
ThresholdOperator
Comparison operator for threshold triggers.

Traits§

AlertSink
Trait for pluggable alert destinations.

Functions§

escape_json 🔒
Escape a string for JSON.
operator_symbol 🔒

Type Aliases§

AlertSinkResult
Result type for alert sink operations.