The companion Prometheus + Grafana for host-agent. Brings you from "I just installed the agent on three boxes" to "I can see them on a dashboard" in two commands.
cd examples/server-side
docker compose up -dThat's it. You now have:
- Prometheus at
http://localhost:9090, acceptingremote_writepushes on/api/v1/write, with thehosts_activerecording rule loaded. - Grafana at
http://localhost:3000(admin / admin), with the Prometheus datasource pre-wired (UIDprometheus) and the Server Overview dashboard already provisioned.
Both bind to 127.0.0.1 only — put TLS in front of them if you expose
them. Override the Grafana admin password via env:
GRAFANA_ADMIN_PASSWORD=$(openssl rand -hex 16) docker compose up -dOn each host that's running host-agent, set the remote-write target to this box's address:
PROMETHEUS_REMOTE_WRITE_URL=http://<your-prometheus-host>:9090/api/v1/writeThe dashboard's host dropdown populates automatically as each agent sends its first push — no central config edits needed.
- Retention: change
--storage.tsdb.retention.time=30dindocker-compose.yml. - Auth on the receiver: bind Prometheus behind nginx / Caddy with
basic or bearer auth; configure each host-agent with the matching
PROMETHEUS_REMOTE_WRITE_USERNAME/_PASSWORDorPROMETHEUS_REMOTE_WRITE_BEARER_TOKEN. - External storage: swap the
prometheusimage for VictoriaMetrics or Mimir if you outgrow single-node TSDB. The dashboard works unchanged — it only depends on Prometheus query syntax. - Extra dashboards: drop more JSON into
grafana/dashboards/and Grafana picks them up on its next provisioning cycle (60s).