Simple FastAPI status page backed by Prometheus queries.
- A service exposes health/metrics data (
/metrics) directly, or via an exporter (for example cAdvisor, blackbox, postgres-exporter). - Prometheus scrapes that target based on
prometheus/prometheus.yml(scrape_configs). - Prometheus stores those time series (for example
up,probe_success,container_last_seen). system_status/services.ymldefines which PromQL query each row (or child row) should use.system_status/server.pyruns each query against Prometheus (/api/v1/query_range) for the last 24 hours.- The app converts query results into UP/DOWN/NO DATA + history.
system_status/templates/index.htmlrenders the final status page.
- Make sure the service has a metric source (native
/metricsor an exporter). - Add/confirm a scrape job in
prometheus/prometheus.yml. - Add a row in
system_status/services.ymlwith a query that returns 0/1 style status. - Restart affected containers:
docker compose restart prometheus system-statusdocker compose up -d --build system-statusOpen: http://localhost:9110
JSON mode: http://localhost:9110/?json=1