alerts

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package alerts dispatches anomaly notifications with TTL-cache deduplication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

Dispatcher sends anomaly notifications with TTL-cache deduplication. A (source, reason-category) pair is suppressed for SuppressWindow after first delivery.

func New

func New(n *notify.Notify, suppressWindow time.Duration) *Dispatcher

New creates a Dispatcher. suppressWindow=0 disables dedup (every anomaly notified).

func (*Dispatcher) Close

func (d *Dispatcher) Close()

Close stops the background TTL goroutine.

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(ctx context.Context, source string, score float64, reason, line string)

Dispatch sends an alert unless the same (source, reason-category) was notified within the suppress window.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL