Skip to the page
gužvadocs
Menu

Engineering

Monitoring and alerts

How problems surface: the alert rules, the health check, the dead-man ping and the logs.

What watches what

WatcherChecksReaches the operator by
Alert engine (in the binary, every minute)Cameras and venuesTelegram
/healthzThe server answers, its version, free diskmake check, after every deploy
Dead-man ping (every 5 min, when set)The server itself is aliveAn outside service notices the pings stop
The journalEverything the binary logsmake 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.

RuleFires when
StaleAn open venue has no new picture for longer than its interval allows
Weak signalA camera's Wi-Fi stays weak for a while (a single dip is normal)
Reboot loopA camera boots too many times in a short window
BrownoutA camera reports its power supply dipped
Many staleSeveral venues go stale at once: points at the server or the network, not one camera
Disk lowFree 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_URL points 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 /metrics page 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.