Metrics, Alerts & Dashboards
Prometheus endpoints, platform metrics, alert rules, and optional Grafana assets for production operations.
Gameplane exports Prometheus metrics from the operator, API, and agent sidecars. Recommended alert rules and Grafana dashboards are bundled with the Helm chart but disabled by default.
Enable observability
To start collecting metrics, enable the serviceMonitor integration in your Helm values:
serviceMonitors:
enabled: true
labels: {} # labels for Prometheus selector matching
This creates ServiceMonitors for the operator and API, plus PodMonitors for agent sidecars and relay tunnel pods. Agent metrics are plain HTTP on port 9090; tunnel metrics share the health listener on 8091. Neither uses the mTLS control port 8090. The telemetry receiver gets a ServiceMonitor only when its dashboard token is configured. Its /metrics moved to the dashboard port 8081 in v0.4.0 and requires Authorization: Bearer with the dashboard token.
The diagram below shows how each metrics endpoint reaches Prometheus, the alert rules, and the Grafana dashboards.
flowchart LR
agent["Agent sidecar :9090 metrics"] --> pma["PodMonitor gameplane-agent"]
tunnel["Tunnel relay :8091 health and metrics"] --> pmt["PodMonitor gameplane-tunnel"]
op["Operator :8080 metrics"] --> smo["ServiceMonitor gameplane-operator"]
api["API metrics listener"] --> sma["ServiceMonitor gameplane-api"]
pma --> prom["Prometheus"]
pmt --> prom
smo --> prom
sma --> prom
prom --> rules["PrometheusRule alerts (operator, scrape, relay, workload)"]
cm["Dashboard ConfigMap (label grafana_dashboard=1)"] --> graf["Grafana sidecar"]
graf -- "queries" --> prom
Operator metrics
The operator exports controller-runtime standard metrics plus fleet gauges. Aggregate fleet metrics with max by (phase) (...) when you have 2+ operator replicas — each replica reports the same cache-derived counts.
Core metric families
| Metric | Labels | Purpose |
|---|---|---|
gameplane_gameservers |
phase |
GameServers per lifecycle phase: Pending, Starting, Running, Stopping, Stopped, Suspended, Failed |
gameplane_backups |
phase |
Backups per phase: Pending, Running, Succeeded, Failed |
gameplane_gameservers_idle |
state |
Wake-on-connect sleeping vs. awake server count |
controller_runtime_reconcile_time_seconds |
controller |
Reconcile latency histogram (Operator, Cluster, Backup, Module) |
controller_runtime_reconcile_errors_total |
controller |
Reconcile error rate counter |
workqueue_depth |
name |
Items waiting in each reconciliation queue |
workqueue_longest_running_processor_seconds |
name |
Longest-running reconcile (detects stuck controllers) |
API metrics
The API server exposes custom application metrics via Prometheus:
| Metric | Labels | Purpose |
|---|---|---|
gameplane_audit_webhook_events_total |
result |
Audit webhook delivery outcomes |
gameplane_audit_s3_events_total |
result |
Audit S3 mirror delivery outcomes |
gameplane_notify_deliveries_total |
kind, result |
Notification sink delivery outcomes |
Agent metrics
Each game server’s agent sidecar reports per-server observability on port 9090:
| Metric | Labels | Meaning |
|---|---|---|
gameplane_agent_cpu_millicores |
server, namespace, template, game |
Game process CPU usage (millicores from /proc) |
gameplane_agent_cpu_limit_millicores |
server, namespace, template, game |
Container CPU limit (millicores) |
gameplane_agent_memory_bytes |
server, namespace, template, game |
Game process memory usage (bytes from /proc) |
gameplane_agent_memory_limit_bytes |
server, namespace, template, game |
Container memory limit (bytes) |
gameplane_agent_disk_used_bytes |
server, namespace, template, game |
Disk used in the server’s data directory |
gameplane_agent_disk_total_bytes |
server, namespace, template, game |
Total disk capacity of the data directory |
gameplane_agent_players_online |
server, namespace, template, game |
Players currently online (via RCON) |
gameplane_agent_players_max |
server, namespace, template, game |
Max player capacity (−1 for unlimited, unknown if RCON fails) |
All agent metrics include the source server name, namespace, template, and game identifiers. Metrics are emitted only when readable (e.g., players_max is absent if RCON fails or capacity is unknown).
Game performance and relay metrics (v0.4.0)
Modules can declare numeric game measurements by reusing a read-only capabilities.status.metrics[] entry with a performance block (signal is tick_rate, tick_duration or frame_rate; degradedThreshold is optional). The agent polls these in the background, so scrapes never run RCON. Samples expire 75 seconds after the command completed. Supported declarations emit:
gameplane_agent_performance_value, the measurement in its base unit (hertz or seconds)gameplane_agent_performance_available,0when a supported declaration fails (the value series is then absent)gameplane_agent_performance_sample_timestamp_secondsgameplane_agent_performance_degraded_threshold(optional), with adirectionlabel ofbeloworabove
Labels are bounded: the metric ID, the signal and the base unit. Display strings, commands, responses and errors never become labels. No external module opts in by default.
Relay health is exported from each tunnel pod (gameplane_tunnel_ready, gameplane_tunnel_connection_supported, gameplane_tunnel_connection_known, gameplane_tunnel_connected, gameplane_tunnel_forwards_registered, gameplane_tunnel_endpoint_assigned, gameplane_tunnel_observation_timestamp_seconds). Readiness and registration gauges read zero until the relay confirms them. The connected gauge and the observation timestamp are absent while their evidence is unknown or stale.
Alert rules
Enable PrometheusRules in Helm values to activate recommended alerts:
prometheusRules:
enabled: true
labels: {} # labels for Prometheus rule selector matching
Operator alerts
| Alert | Signal | Duration | Response |
|---|---|---|---|
| GameplaneOperatorReconcileErrors | Reconciliation errors sustained per controller | 10m | Check operator logs; inspect the failing controller |
| GameplaneOperatorWorkqueueBacklog | Work queue has 50+ items | 15m | Operator is falling behind — check throttling or dependencies |
| GameplaneOperatorReconcileStuck | Single reconcile running >5 minutes | 10m | Wedged controller — inspect the longest-running task |
Scrape, relay and performance alerts
| Alert | Signal | Duration | Severity |
|---|---|---|---|
| GameplaneScrapeUnavailable | An agent or tunnel metrics target cannot be scraped | 5m | warning |
| GameplaneRelayUnavailable | A tunnel’s relay connection or forwards are unavailable | 2m | warning |
| GameplaneRelayHealthUnknown | A provider that can report health cannot confirm it (excludes Playit) | 5m | info |
| GameplanePerformanceUnknown | A declared game measurement is unavailable | 5m | warning |
| GameplanePerformanceDegraded | A game measurement crossed its module-declared threshold | 5m | warning |
Container pressure rules (GameplaneCPUThrottled, GameplaneMemoryPressure, GameplaneContainerOOM, GameplanePodPending, GameplaneNodePressure) need kubelet/cAdvisor and kube-state-metrics. A missing collector leaves those series absent; it does not mean zero pressure.
Fleet alerts
| Alert | Signal | Duration | Response |
|---|---|---|---|
| GameplaneGameServerFailed | One or more GameServers stuck in Failed phase | 10m | Check the GameServer status and operator logs for crash or bad template |
| GameplaneBackupFailed | A Backup in Failed phase (data-loss risk) | 15m | Inspect the Backup status and operator logs; recovery may be at risk |
Rules use only the operator’s own metrics (controller_runtime_*, workqueue_*, and gameplane_* gauges) with no install-specific job names or relabel assumptions. They are portable across Prometheus setups.
Grafana dashboards
A pre-built operator dashboard is bundled as a ConfigMap. Enable auto-import via Helm:
grafanaDashboards:
enabled: true
labels:
grafana_dashboard: "1" # default label; override if your Grafana sidecar differs
The dashboard visualizes:
- GameServer phase distribution and transition rates
- Backup success and failure rates
- Operator reconcile latency and error trends
- Workqueue depth and longest-running reconciles
- System resource usage across the control plane
- Relay readiness and known state, supported game measurements, container pressure, restarts and Pending Pods (Workloads dashboard, v0.4.0)
You must explicitly enable these in your Helm values to activate metrics collection, alert rules, and dashboard imports. This prevents unexpected Prometheus and Grafana dependencies in disconnected or minimal clusters.
Custom observability
For production environments, integrate your own observability stack:
- Create or modify ServiceMonitor/PodMonitor resources to target the metrics ports (
9090for agents,8091for relay tunnel pods, the API’s own port, and the telemetry receiver’s dashboard port8081with a bearer token) with your custom Prometheus relabeling and authentication. - Wire alerts into your alertmanager by deploying additional PrometheusRule resources that scrape the same metrics or combine them with your own signals.
- Build dashboards using the bundled Grafana dashboard as a starting point — export it from Grafana or adapt the ConfigMap YAML in
charts/gameplane/dashboards/.
Next steps
- Production Observability — scaling metrics collection across a fleet
- Notification Sinks — route alerts to Slack, PagerDuty, or webhooks
- System Log Viewer — audit logs and operator event streams