feat: alert channel health indicator + test alerts #36
Reference in New Issue
Block a user
Delete Branch "feat/alert-health"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Alert channels now show whether they're working. Previously fire-and-forget with no visibility.
Changes
Engine (
monitor.go):AlertHealthstruct tracks per-channel: last send time, success/fail, error, countstriggerAlertrecords delivery result after each Send()GetAlertHealth(id)exposes health for TUITestAlert(id)sends test notification synchronously, records resultAlerts tab (
tab_alerts.go):TUI (
tui.go):tkey on alerts tab sends test notification[n]New [e]Edit [d]Del [t]Test [T]Theme [Tab]Switch [q]QuitInspired by
Grafana's contact point health columns (Health, Last Delivery Attempt, Duration).
Files (3)
internal/monitor/monitor.go— AlertHealth type, tracking, test alertinternal/tui/tab_alerts.go— health dot, last sent column, formattersinternal/tui/tui.go— t key handler, keybinding displayTrack alert delivery health at runtime: - AlertHealth struct: LastSendAt, LastSendOK, LastError, SendCount, FailCount - triggerAlert records success/failure after each Send() - Health data exposed via GetAlertHealth() for TUI Alerts tab enriched: - Health dot column: green (OK), red (failed), gray (never sent) - LAST SENT column: relative time ("2m ago", "never") - [t] key sends test notification through selected channel Inspired by Grafana's contact point health columns.