What to monitor on your own server: a few alerts that matter instead of 200 charts
Beautiful Grafana dashboards don't wake you up when something breaks. A practical way to choose the alerts worth receiving on a server running Docker services, a GPU and a website.
It’s easy to install Prometheus and Grafana, import a ready-made dashboard with two hundred charts, and feel the server is “monitored”. But charts do nothing while you’re asleep. The real question is: which few situations should send you a message right away?
Rule one: alert on symptoms, not causes
Google’s Site Reliability Engineering book sums up monitoring as two questions: what’s broken, and why? And it advises putting much more effort into catching symptoms than causes.
The difference is very practical:
- Symptom: the site doesn’t respond, is very slow, or returns errors. That’s what its users feel.
- Cause: the CPU is at 90%. That may be perfectly normal while a model is running.
Alert on the symptom, and use charts for causes when you investigate. Prometheus’s own docs say the same: alert on symptoms associated with user pain, as high up in the stack as possible.
Rule two: every alert needs an action
The SRE book says every page should be actionable, and that a page needing only a robotic response shouldn’t be a page. Ask of each alert: when it arrives, what will I do? If the answer is “nothing” or “wait”, delete it or turn it into a chart.
The framework: four signals for services, three questions for resources
For services (a website, an API, a model server): the SRE book’s four golden signals are latency, traffic, errors and saturation.
For resources (disk, memory, GPU): Brendan Gregg’s USE method — for every resource, check utilization, saturation (work waiting in a queue) and errors.
The alerts I’d recommend for a small server
1. The site doesn’t respond from outside. The Blackbox exporter probes the site the way a visitor sees it. Alert when probe_success is zero for several minutes in a row. This is the most important alert of all.
2. A TLS certificate is about to expire. The probe_ssl_earliest_cert_expiry metric gives the expiry time of the nearest certificate. Alert early enough to act:
- alert: CertExpiringSoon
expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 14
for: 1h
3. The disk will fill soon — not “the disk is 80% full”. Prometheus’s predict_linear function predicts a metric’s value some time ahead using linear regression. node_exporter’s official rules use it like this: a warning when free space is below 40% and the trend predicts the disk filling within 24 hours, and a critical alert when it’s below 20% and filling within 4 hours. A disk that has sat at 85% for a year doesn’t need an alert; a disk at 60% filling fast with runaway logs does.
4. A systemd service failed. node_exporter’s rules include a ready-made alert for this (NodeSystemdServiceFailed). For containers, alert on a container that keeps restarting, not on every restart.
5. The server’s clock isn’t synchronized. The NodeClockNotSynchronising alert from the same rules. A wrong clock silently breaks certificates, logs and scheduled jobs.
6. The GPU. NVIDIA’s DCGM exporter provides metrics such as temperature (DCGM_FI_DEV_GPU_TEMP), memory used (DCGM_FI_DEV_FB_USED) and the last XID error (DCGM_FI_DEV_XID_ERRORS). Alert on sustained high temperature and on XID errors — not on high utilization; the card is there to be used.
7. Monitoring itself is working. Prometheus’s docs recommend monitoring Prometheus and Alertmanager themselves. If the alerting system stops, you won’t know anything else stopped. The simplest fix: a small external check that confirms the monitoring system is alive.
Details that prevent noise
- Always use
for:. It makes Prometheus wait a while before firing, so a momentary spike doesn’t wake you. There’s alsokeep_firing_forto stop an alert flapping between firing and resolved. - Alertmanager groups and suppresses. Grouping turns twenty similar alerts into one message. Inhibition mutes dependent alerts while a bigger one is firing: if the whole server is down, you don’t need a message for each service on it. Silences pause alerts during maintenance.
- Two levels only: “now” (a message to your phone) and “tomorrow” (email or a channel). Everything else is a chart.
The takeaway
Good monitoring for a small server isn’t two hundred charts. It’s roughly seven alerts, each meaning you have to do something: the site is down, a certificate is expiring, the disk is filling fast, a service failed, the clock is wrong, the GPU is overheating or erroring, and monitoring itself has stopped. Start with those, and add a new alert only when you discover an outage that nothing told you about.
