deploy/monitoring
The stack's monitoring, under the Compose profile monitoring (docker compose --profile monitoring up -d; Deploying): Prometheus keeps 15 days of metrics and evaluates the alerts, Grafana shows the dashboards on /grafana behind its login (GRAFANA_ADMIN_PASSWORD; it does not start without one).
| File | What |
|---|---|
prometheus.yml | What is scraped: the API (api:8080/metrics), the stack's game server, the fleet's game processes and hosts as the API's registry lists them (/fleet/targets, Prometheus's http_sd), the stack's host (node-exporter). |
alerts.yml | The loop's p99 step over 10 ms, a game server lost without draining, a target down, a disk over 85 %, CPU steal over 10 %, players falling back from the WebRTC data channel to the WebSocket (over 5 in 10 minutes and a third of the channels opened), the platform's model past 80 % of its month (CreatorBudget80, foi_creator_budget_usd). Shown in Prometheus and Grafana; sent on by adding Alertmanager or a Grafana contact point. |
dashboards.mjs | Writes the dashboards (grafana/dashboards/*.json): the fleet (servers, players against capacity, the loop's p99, bandwidth, the hosts), the rooms (by $room, and each server's data channels: the players on UDP, the fall backs by reason), the API (requests by route, p95, errors, the processes), creation (the month's spend against its cap, today's budget, spent and reserved, the spend by what for, the creations by how they went, the briefs refused by why). Run it after changing a panel. |
grafana/provisioning/ | Grafana's data source (this Prometheus, uid prometheus) and the dashboards' folder. |
monitoring.test.ts | The dashboards are what the script writes, and every foi_ metric a dashboard or an alert asks for is one the game server or the API exports. |
The game server's metrics are apps/server/src/metrics.ts, the API's apps/api/src/metrics.ts; neither is routed by the proxy (/api/metrics and /api/fleet… answer 404 there).