Documentation
¶
Overview ¶
Package alert defines threshold alerts on event metrics — "fire when <event> count over the last N hours is above/below a threshold". The Server evaluates them on a schedule and delivers via webhooks; this package is the persisted rules + their runtime state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string `json:"id"`
Name string `json:"name"`
Event string `json:"event"`
Op string `json:"op"` // "gt" | "lt"
Threshold float64 `json:"threshold"`
WindowHours int `json:"window_hours"`
Enabled bool `json:"enabled"`
Created time.Time `json:"created"`
LastChecked time.Time `json:"last_checked"`
LastValue float64 `json:"last_value"`
LastFired time.Time `json:"last_fired"`
}
Alert is one rule plus its last-evaluation state.
Click to show internal directories.
Click to hide internal directories.