What watches what
| Watcher | Checks | Reaches the operator by |
|---|---|---|
| Alert engine (in the binary, every minute) | Cameras and venues | Telegram |
/healthz | The server answers, its version, free disk | make check, after every deploy |
| Dead-man ping (every 5 min, when set) | The server itself is alive | An outside service notices the pings stop |
| The journal | Everything the binary logs | make logs, journalctl -u guzva |
The alert engine
internal/alert evaluates rules over the same data the admin board shows. Each rule is a pure function of a snapshot and a clock, so it is tested with a fake clock. A message goes out once when a condition starts (⚠ …) and once when it ends (✓ Resolved: …), never every minute.
| Rule | Fires when |
|---|---|
| Stale | An open venue has no new picture for longer than its interval allows |
| Weak signal | A camera's Wi-Fi stays weak for a while (a single dip is normal) |
| Reboot loop | A camera boots too many times in a short window |
| Brownout | A camera reports its power supply dipped |
| Many stale | Several venues go stale at once: points at the server or the network, not one camera |
| Disk low | Free disk falls under the ingest safety threshold |
After a restart, history-based rules wait before clearing an alert: their memory starts empty, which would otherwise read as "resolved".
Why the server can't be its own alarm: if guzva is down, it can't send a Telegram message saying so. The dead-man ping solves that from the outside.
GUZVA_DEADMAN_URLpoints at a service such as healthchecks.io; guzva calls it every 5 minutes, and when the calls stop, that service alerts the operator. Not configured yet.
Logs
The binary logs JSON lines through log/slog to stdout; systemd stores them in the journal. One line per ingest outcome includes the camera's signal, free memory, boot count and failed posts, which is what the soak report (make soak) reads. Request bodies and pictures are never logged.
make logs # follow ingest lines live
journalctl -u guzva -n 50 # on the server: the last 50 lines
Planned (O6)
- A
/metricspage in Prometheus format, readable only from the server itself. - Prometheus collects it every 15 s, Grafana draws it, reached through an SSH tunnel.
- Three written targets: venue page speed, ingest success rate, backup age.