Monitoring
Health checks, Prometheus metrics, useful alerts, database checks and background jobs for keeping an eye on a Stater install.
On this page
Stater reports its own health over HTTP and in Prometheus metrics, checks its database in plain language, and lists its background jobs.
Health checks#
GET /health/live(process up) andGET /health/ready(database reachable) for load balancers and monitoring.- HAProxy in front of the replicas checks
/health/ready, so failover is the load balancer's health check (Architecture).
Metrics#
GET /metrics: Prometheus text format — requests by status class, live connections, database pool, outbox backlog, licence days left. Features add their own:
| Metric | From |
|---|---|
stater_outbox_retrying |
Webhook deliveries being retried (Webhooks) |
stater_licence_days_left |
Days until the licence ends (Plans and licences) |
stater_mail_failed |
Emails that failed in the last day (Email) |
stater_siem_pending, stater_siem_retrying |
Security events waiting for, or being retried to, a SIEM (SIEM forwarding) |
stater_security_events_dropped_total |
Security events dropped when thousands arrive at once (Security events) |
stater_threat_indicators_active, stater_threat_blocks_total |
Threat-feed indicators in force, and what they blocked (Threat feeds) |
Backup metrics are not in /metrics yet (Database and backups).
Who can read /metrics#
- Linux packages:
/metricsanswers only callers on this machine unlessSTATER_METRICS_TOKEN_FILEis set; do not route it through the proxy. - Kubernetes:
/metricsneedssecrets.metricsToken.enabled.metrics.serviceMonitor.enabled=trueadds a ServiceMonitor for the Prometheus Operator that sends the token. - Anywhere else, restrict it at the proxy if the server is reachable from outside.
Alerts#
Add each Stater replica to your monitoring with an HTTP check on /health/ready, and scrape /metrics with Prometheus. Useful alerts: stater_outbox_retrying > 0 for 15 minutes (a webhook endpoint is down), stater_licence_days_left < 14, and any rise in the 5xx rate.
Stater raises some alerts itself (a failed backup, a licence running out). They are logged and, once email is set up, emailed to the alerts address or every owner with an email address, at most one an hour per alert and person (Email). Failed emails show on Today for owners.
The database#
stater db doctor and Admin › System health (owners only) check the database in plain language: the connection and its encryption, the PostgreSQL version, the search extension, migrations, clocks, the connection budget, clean-up, replication, long queries, the last good backup and free space. The command exits 0 when nothing is critical, 3 when something is, and 1 when it cannot run at all, so it suits a deployment check. See Database and backups.
Background jobs#
Background jobs (backups, polling, pruning) are claimed through the jobs table with a lease, so one replica runs each; a crashed replica's lease runs out and another takes over. GET /api/v1/system/jobs lists them, among them counter_images.prune (tile pictures no layout uses), offline_syncs.prune (the offline tills' sync log) and the hourly "Email clean-up". Run now (POST /api/v1/system/jobs/{name}/run) is owner-only and audited.