Documentation
¶
Overview ¶
Package alerting provides threshold-based operational alerting that monitors policy/recovery/budget signals and generates alerts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliveryChannel ¶
type DeliveryChannel interface {
// Send delivers a single alert event. Implementations should not retry.
Send(ctx context.Context, evt eventbus.AlertEvent) error
// Type returns the channel type identifier (e.g. "webhook").
Type() string
}
DeliveryChannel delivers alerts to an external system.
type DeliveryRouter ¶
type DeliveryRouter struct {
// contains filtered or unexported fields
}
DeliveryRouter subscribes to AlertEvent on the EventBus and fans out to configured delivery channels, filtering by minimum severity.
func NewDeliveryRouter ¶
func NewDeliveryRouter(bus *eventbus.Bus, channels []config.AlertDeliveryConfig) *DeliveryRouter
NewDeliveryRouter creates a router with the given channels and subscribes to the bus.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher monitors operational signals and publishes AlertEvent when configurable thresholds are exceeded within a sliding window.
func NewDispatcher ¶
func NewDispatcher(bus *eventbus.Bus, policyBlockRate, recoveryRetries int) *Dispatcher
NewDispatcher creates a Dispatcher that publishes alerts to bus when the given thresholds are breached within a 5-minute window.
func (*Dispatcher) Subscribe ¶
func (d *Dispatcher) Subscribe(bus *eventbus.Bus)
Subscribe registers the dispatcher to receive events from the bus.
type WebhookDelivery ¶
type WebhookDelivery struct {
// contains filtered or unexported fields
}
WebhookDelivery delivers alerts as JSON HTTP POST requests.
func NewWebhookDelivery ¶
func NewWebhookDelivery(url string) *WebhookDelivery
NewWebhookDelivery creates a webhook delivery channel targeting the given URL.
func (*WebhookDelivery) Send ¶
func (w *WebhookDelivery) Send(ctx context.Context, evt eventbus.AlertEvent) error
Send posts the alert event as JSON to the webhook URL.
func (*WebhookDelivery) Type ¶
func (w *WebhookDelivery) Type() string