Skip to content

Server metrics

Lightweight metrics collection ze 7 serverů → SQLite na sentinelu. Nahrazuje Grafana/Prometheus pro malý setup.

Owner sentinel
Status running (nasazeno 2026-03-31)
Stack Python collector + Bash agent + SQLite

Komponenty

Co Kde
Collector /opt/metrics/collector.py (systemd s60-metrics, port 9100)
Agent /opt/metrics/agent.sh (cron */1 na všech 7 serverech)
Storage /opt/metrics/metrics.db (SQLite, 7 dní retence)
Status page https://sentinel.studio60.cz/status/ (sekce Servery + sparkline)

API

GET /metrics/api/metrics/current             # aktuální stav všech serverů
GET /metrics/api/metrics/history/<host>      # historie pro daný host

POST API key (pro agenty): s60-metrics-2026-collector

Co se sbírá

  • CPU
  • RAM
  • Disk
  • Load average
  • Síťový throughput

Co se nesbírá

  • Per-container metrics (k tomu by byl Prometheus)
  • Application metrics (k tomu je GlitchTip pro errors)

Přidat nový server

scp /opt/metrics/agent.sh root@<new-server>:/opt/metrics/
ssh root@<new-server> "echo '*/1 * * * * /opt/metrics/agent.sh' | crontab -"

Detail: runbooks/metrics.md.

Související