feat: heartbeat monitors pinged by cron jobs and scripts

A heartbeat monitor has a secret ping URL instead of a target and
regions. Jobs call it with GET, HEAD or POST after each run, or /fail
with an optional message. When no ping arrives within the interval plus
a grace period, a failure is recorded and evaluated like a checker
result, so confirmations, maintenance and notifications apply. One API
replica at a time checks deadlines. The URL is shown only to members who
may edit the monitor, since it can report the job healthy.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 11:36:14 +01:00
1 parent 04eff67e56
commit 5a76702dba
14 files changed
+1241 -587

No files matched your search

+9 -1
View File
@@ -22,10 +22,16 @@ const (
ICMP Type = "icmp"
DNS Type = "dns"
TLS Type = "tls"
// Heartbeat monitors are pinged by the monitored job; no checker runs
// them.
Heartbeat Type = "heartbeat"
)
// Types lists every check type.
var Types = []Type{HTTP, TCP, ICMP, DNS, TLS}
var Types = []Type{HTTP, TCP, ICMP, DNS, TLS, Heartbeat}
// Passive reports whether t is reported to us rather than run by checkers.
func Passive(t Type) bool { return t == Heartbeat }
// Spec is everything needed to run one check.
type Spec struct {
@@ -77,6 +83,8 @@ var impls = map[Type]impl{
ICMP: icmpCheck{},
DNS: dnsCheck{},
TLS: tlsCheck{},
Heartbeat: heartbeatCheck{},
}
// Validate checks target and config for type t and returns the normalized