Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d63654
feat(observability): discover workloads in managed namespaces and ale…
Baylem Nov 11, 2026
7159fbc
chore(stack): reuse tenant isolation for monitoring qualification
Baylem Nov 11, 2026
4ba4fb8
chore(stack): reuse relay metrics for fleet monitoring
Baylem Nov 11, 2026
7215a34
chore(stack): combine tenant network policies and relay instrumentation
Baylem Nov 11, 2026
22cd8c7
chore(stack): track the shared monitoring prerequisites
Baylem Nov 11, 2026
0a0fc72
feat(observability): verify tenant scrapes and expose relay saturation
Baylem Nov 11, 2026
5d4286b
chore(stack): include qualified relay baseline for telemetry
Baylem Nov 11, 2026
f7389bf
chore(stack): inherit the verified FRP baseline
Baylem Nov 11, 2026
b6149d0
chore(stack): include corrected Cilium probe policy for issue 880
Baylem Nov 11, 2026
2933bf1
chore(stack): synchronize monitoring with the updated network profile
Baylem Nov 11, 2026
0daa36a
chore(stack): include raw relay qualification records in the monitori…
Baylem Nov 11, 2026
4340be0
docs(observability): link engine-verified Palworld frame rate support
Baylem Nov 11, 2026
887aff7
chore(stack): synchronize the published relay qualification evidence
Baylem Nov 11, 2026
1cd4039
fix(e2e): clear inherited probe allowances in the tenant monitoring d…
Baylem Nov 11, 2026
ba9386f
fix(e2e): scope tenant monitoring setup to its own suite
Baylem Nov 11, 2026
633f77b
fix(e2e): qualify monitored relays through their scoped FRP peer
Baylem Nov 11, 2026
ac6d73d
merge: carry named kubelet probe qualification into monitoring base
Baylem Nov 11, 2026
b8f443f
merge: sync corrected tenant network qualification into monitoring
Baylem Nov 11, 2026
ea99124
docs(changelog): record monitoring across managed tenants
Baylem Nov 11, 2026
c9fd247
chore(stack): integrate updated fix/tenant-network-profile
Baylem Nov 11, 2026
3fba3c1
chore(stack): integrate updated fix/879-relay-flow-metrics
Baylem Nov 11, 2026
d3facc6
chore(stack): synchronize tenant networking and relay prerequisites
Baylem Nov 12, 2026
d433b72
chore(stack): include the published tenant networking head for monito…
Baylem Nov 12, 2026
659795a
chore(monitoring): integrate the current tenant network and relay bas…
Baylem Nov 12, 2026
44e3c87
chore(monitoring): stack on the current tenant networking feature
Baylem Nov 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/unreleased/908-tenant-monitoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Monitoring across managed tenants

Prometheus discovers game workloads in managed namespaces and distinguishes missing targets
from failed scrapes. Dashboards show process RSS and container working set separately. [PR #908](https://github.com/GameplanePanel/Gameplane/pull/908)
40 changes: 40 additions & 0 deletions charts/gameplane/dashboards/gameplane-workloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,46 @@
"legendFormat": "{{namespace}} / {{pod}} {{metric}}"
}
]
},
{
"id": 11,
"title": "Relay drops and rejected flows",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 40 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "ops", "noValue": "Unknown", "custom": { "spanNulls": false } } },
"targets": [
{
"refId": "A",
"expr": "max by (namespace,pod,protocol) (rate(gameplane_tunnel_flow_rejections_total{namespace=~\"$namespace\"}[5m]))",
"legendFormat": "{{namespace}} / {{pod}} {{protocol}} rejections"
},
{
"refId": "B",
"expr": "max by (namespace,pod) (rate(gameplane_tunnel_udp_queue_drops_total{namespace=~\"$namespace\"}[5m]))",
"legendFormat": "{{namespace}} / {{pod}} UDP queue drops"
}
]
},
{
"id": 12,
"title": "Game process RSS and container working set",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 40 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "bytes", "noValue": "Unknown", "custom": { "spanNulls": false } } },
"targets": [
{
"refId": "A",
"expr": "max by (namespace,pod) (gameplane_agent_memory_bytes{namespace=~\"$namespace\"})",
"legendFormat": "{{namespace}} / {{pod}} process RSS"
},
{
"refId": "B",
"expr": "max by (namespace,pod) (container_memory_working_set_bytes{namespace=~\"$namespace\",container=\"game\"})",
"legendFormat": "{{namespace}} / {{pod}} working set"
}
]
}
]
}
47 changes: 34 additions & 13 deletions charts/gameplane/templates/monitoring-rules.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and .Values.prometheusRules.enabled (eq (include "gameplane.operatorEnabled" .) "true") }}
{{- $namespaces := join "|" (include "gameplane.operatorGameNamespaces" . | fromJsonArray) }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand All @@ -13,59 +14,79 @@ spec:
groups:
- name: gameplane.workloads
rules:
- alert: GameplaneScrapeTargetMissing
expr: |
(
max by (namespace, pod, gameplane_component) (
label_replace(kube_pod_container_status_running{namespace=~"{{ $namespaces }}",container=~"agent|tunnel"} == 1,
"gameplane_component", "$1", "container", "(agent|tunnel)")
)
and on (namespace, pod) kube_pod_labels{namespace=~"{{ $namespaces }}",label_app_kubernetes_io_name=~"gameplane-game|gameplane-tunnel"}
)
unless on (namespace, pod, gameplane_component) up{namespace=~"{{ $namespaces }}",gameplane_component=~"agent|tunnel"}
for: 5m
labels: { severity: warning }
annotations: { summary: "Running Gameplane workload is missing from scrape discovery" }
- alert: GameplaneScrapeUnavailable
expr: max by (namespace, pod, gameplane_component) (up{gameplane_component=~"agent|tunnel",namespace="{{ .Values.gamesNamespace }}"}) == 0
expr: max by (namespace, pod, gameplane_component) (up{gameplane_component=~"agent|tunnel",namespace=~"{{ $namespaces }}"}) == 0
for: 5m
labels: { severity: warning }
annotations: { summary: "Gameplane metrics target cannot be scraped" }
- alert: GameplaneRelayUnavailable
expr: (max by (namespace, pod) (gameplane_tunnel_ready{namespace="{{ .Values.gamesNamespace }}"}) == 0) and on (namespace, pod) (max by (namespace, pod) (gameplane_tunnel_connection_known{namespace="{{ .Values.gamesNamespace }}"}) == 1)
expr: (max by (namespace, pod) (gameplane_tunnel_ready{namespace=~"{{ $namespaces }}"}) == 0) and on (namespace, pod) (max by (namespace, pod) (gameplane_tunnel_connection_known{namespace=~"{{ $namespaces }}"}) == 1)
for: 2m
labels: { severity: warning }
annotations: { summary: "Gameplane relay connection or forwards are unavailable" }
- alert: GameplaneRelayHealthUnknown
expr: (max by (namespace, pod) (gameplane_tunnel_connection_known{namespace="{{ .Values.gamesNamespace }}"}) == 0) and on (namespace, pod) (max by (namespace, pod) (gameplane_tunnel_connection_supported{namespace="{{ .Values.gamesNamespace }}"}) == 1)
expr: (max by (namespace, pod) (gameplane_tunnel_connection_known{namespace=~"{{ $namespaces }}"}) == 0) and on (namespace, pod) (max by (namespace, pod) (gameplane_tunnel_connection_supported{namespace=~"{{ $namespaces }}"}) == 1)
for: 5m
labels: { severity: info }
annotations: { summary: "Gameplane provider cannot confirm live relay health" }
- alert: GameplaneRelaySaturated
expr: |
max by (namespace, pod) (increase(gameplane_tunnel_flow_rejections_total{namespace=~"{{ $namespaces }}"}[5m])) > 0
or
max by (namespace, pod) (increase(gameplane_tunnel_udp_queue_drops_total{namespace=~"{{ $namespaces }}"}[5m])) > 0
labels: { severity: warning }
annotations: { summary: "Relay rejected traffic at its flow limit or dropped queued UDP packets" }
- alert: GameplanePerformanceUnknown
expr: max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_available{namespace="{{ .Values.gamesNamespace }}"}) == 0
expr: max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_available{namespace=~"{{ $namespaces }}"}) == 0
for: 5m
labels: { severity: warning }
annotations: { summary: "Declared game performance measurement is unavailable" }
- alert: GameplanePerformanceDegraded
expr: |
(max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_value{namespace="{{ .Values.gamesNamespace }}"})
(max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_value{namespace=~"{{ $namespaces }}"})
< on (namespace, pod, metric, signal, unit)
max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_degraded_threshold{namespace="{{ .Values.gamesNamespace }}",direction="below"}))
max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_degraded_threshold{namespace=~"{{ $namespaces }}",direction="below"}))
or
(max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_value{namespace="{{ .Values.gamesNamespace }}"})
(max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_value{namespace=~"{{ $namespaces }}"})
> on (namespace, pod, metric, signal, unit)
max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_degraded_threshold{namespace="{{ .Values.gamesNamespace }}",direction="above"}))
max by (namespace, pod, metric, signal, unit) (gameplane_agent_performance_degraded_threshold{namespace=~"{{ $namespaces }}",direction="above"}))
for: 5m
labels: { severity: warning }
annotations: { summary: "Game performance crossed its module-declared threshold" }
- alert: GameplaneCPUThrottled
expr: max by (namespace, pod, container) (rate(container_cpu_cfs_throttled_periods_total{namespace="{{ .Values.gamesNamespace }}",container="game"}[5m]) / rate(container_cpu_cfs_periods_total{namespace="{{ .Values.gamesNamespace }}",container="game"}[5m])) > 0.25
expr: max by (namespace, pod, container) (rate(container_cpu_cfs_throttled_periods_total{namespace=~"{{ $namespaces }}",container="game"}[5m]) / rate(container_cpu_cfs_periods_total{namespace=~"{{ $namespaces }}",container="game"}[5m])) > 0.25
for: 10m
labels: { severity: warning }
annotations: { summary: "Game container CPU is throttled in more than 25% of periods" }
- alert: GameplaneMemoryPressure
expr: max by (namespace, pod, container) (container_memory_working_set_bytes{namespace="{{ .Values.gamesNamespace }}",container="game"} / (container_spec_memory_limit_bytes{namespace="{{ .Values.gamesNamespace }}",container="game"} > 0)) > 0.9
expr: max by (namespace, pod, container) (container_memory_working_set_bytes{namespace=~"{{ $namespaces }}",container="game"} / (container_spec_memory_limit_bytes{namespace=~"{{ $namespaces }}",container="game"} > 0)) > 0.9
for: 10m
labels: { severity: warning }
annotations: { summary: "Game container working set exceeds 90% of its memory limit" }
- alert: GameplaneContainerOOM
expr: (max by (namespace, pod, container) (increase(kube_pod_container_status_restarts_total{namespace="{{ .Values.gamesNamespace }}"}[10m])) > 0) and on (namespace, pod, container) (max by (namespace, pod, container) (kube_pod_container_status_last_terminated_reason{namespace="{{ .Values.gamesNamespace }}",reason="OOMKilled"}) == 1)
expr: (max by (namespace, pod, container) (increase(kube_pod_container_status_restarts_total{namespace=~"{{ $namespaces }}"}[10m])) > 0) and on (namespace, pod, container) (max by (namespace, pod, container) (kube_pod_container_status_last_terminated_reason{namespace=~"{{ $namespaces }}",reason="OOMKilled"}) == 1)
labels: { severity: warning }
annotations: { summary: "Gameplane container restarted after an OOM kill" }
- alert: GameplanePodPending
expr: max by (namespace, pod) (kube_pod_status_phase{namespace="{{ .Values.gamesNamespace }}",phase="Pending"}) == 1
expr: max by (namespace, pod) (kube_pod_status_phase{namespace=~"{{ $namespaces }}",phase="Pending"}) == 1
for: 10m
labels: { severity: warning }
annotations: { summary: "Gameplane Pod has remained Pending for ten minutes" }
- alert: GameplaneNodePressure
expr: (max by (node, condition) (kube_node_status_condition{condition=~"MemoryPressure|DiskPressure|PIDPressure",status="true"}) == 1) and on (node) max by (node) (kube_pod_info{namespace="{{ .Values.gamesNamespace }}"})
expr: (max by (node, condition) (kube_node_status_condition{condition=~"MemoryPressure|DiskPressure|PIDPressure",status="true"}) == 1) and on (node) max by (node) (kube_pod_info{namespace=~"{{ $namespaces }}"})
for: 5m
labels: { severity: warning }
annotations: { summary: "A node hosting Gameplane Pods reports resource pressure" }
Expand Down
4 changes: 4 additions & 0 deletions charts/gameplane/templates/servicemonitors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames: {{ include "gameplane.operatorGameNamespaces" . }}
selector:
matchLabels: { app.kubernetes.io/name: gameplane-game }
podMetricsEndpoints:
Expand All @@ -124,6 +126,8 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames: {{ include "gameplane.operatorGameNamespaces" . }}
selector:
matchLabels: { app.kubernetes.io/name: gameplane-tunnel }
podMetricsEndpoints:
Expand Down
8 changes: 7 additions & 1 deletion charts/gameplane/tests/monitoring-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ set -euo pipefail
cd "$(dirname "$0")/../../.."
scratch="$(mktemp -d)"
trap 'rm -rf "$scratch"' EXIT
helm template gameplane charts/gameplane -f docs/examples/monitoring/gameplane-values.yaml > "$scratch/rendered.yaml"
helm template gameplane charts/gameplane -f docs/examples/monitoring/gameplane-values.yaml \
--set 'operator.gameNamespaces={tenant-b,gameplane-games}' > "$scratch/rendered.yaml"
python3 - "$scratch" <<'PY'
import pathlib,sys,yaml
root=pathlib.Path(sys.argv[1])
groups=[]
monitors={}
for document in yaml.safe_load_all((root/'rendered.yaml').read_text()):
if document and document.get('kind')=='PrometheusRule':
groups.extend(document['spec']['groups'])
if document and document.get('kind')=='PodMonitor':
monitors[document['metadata']['name']]=document['spec']['namespaceSelector']['matchNames']
expected=['gameplane-games','tenant-b']
assert monitors=={'gameplane-agent':expected,'gameplane-tunnel':expected}, monitors
(root/'rules.yaml').write_text(yaml.safe_dump({'groups':groups}))
PY
cp charts/gameplane/tests/monitoring-rules.test.yaml "$scratch/tests.yaml"
Expand Down
48 changes: 48 additions & 0 deletions charts/gameplane/tests/monitoring-rules.test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
rule_files: [rules.yaml]
evaluation_interval: 1m
tests:
- interval: 1m
input_series:
- series: 'gameplane_tunnel_flow_rejections_total{namespace="gameplane-games",pod="busy",protocol="tcp"}'
values: '0x2 1x10'
- series: 'gameplane_tunnel_udp_queue_drops_total{namespace="tenant-b",pod="backlogged"}'
values: '0x2 1x10'
- series: 'gameplane_tunnel_udp_queue_drops_total{namespace="unmanaged",pod="outside"}'
values: '0+10x12'
- series: 'gameplane_tunnel_forward_metrics_supported{namespace="tenant-b",pod="opaque"}'
values: '0x12'
alert_rule_test:
- eval_time: 4m
alertname: GameplaneRelaySaturated
exp_alerts:
- exp_labels: {namespace: gameplane-games, pod: busy, severity: warning}
exp_annotations: {summary: "Relay rejected traffic at its flow limit or dropped queued UDP packets"}
- exp_labels: {namespace: tenant-b, pod: backlogged, severity: warning}
exp_annotations: {summary: "Relay rejected traffic at its flow limit or dropped queued UDP packets"}
- eval_time: 10m
alertname: GameplaneRelaySaturated
exp_alerts: []
- interval: 1m
input_series:
- series: 'kube_pod_container_status_running{namespace="tenant-b",pod="sleepy-0",container="agent"}'
values: '1x12'
- series: 'kube_pod_labels{namespace="tenant-b",pod="sleepy-0",label_app_kubernetes_io_name="gameplane-game"}'
values: '1x12'
- series: 'kube_pod_container_status_running{namespace="tenant-b",pod="relay",container="tunnel"}'
values: '1x12'
- series: 'kube_pod_labels{namespace="tenant-b",pod="relay",label_app_kubernetes_io_name="gameplane-tunnel"}'
values: '1x12'
- series: 'up{namespace="tenant-b",pod="relay",gameplane_component="tunnel"}'
values: '0x12'
- series: 'kube_pod_container_status_running{namespace="unmanaged",pod="hidden",container="agent"}'
values: '1x12'
- series: 'kube_pod_labels{namespace="unmanaged",pod="hidden",label_app_kubernetes_io_name="gameplane-game"}'
values: '1x12'
alert_rule_test:
- eval_time: 8m
alertname: GameplaneScrapeTargetMissing
exp_alerts:
- exp_labels: {namespace: tenant-b, pod: sleepy-0, gameplane_component: agent, severity: warning}
exp_annotations: {summary: "Running Gameplane workload is missing from scrape discovery"}
- eval_time: 8m
alertname: GameplaneScrapeUnavailable
exp_alerts:
- exp_labels: {namespace: tenant-b, pod: relay, gameplane_component: tunnel, severity: warning}
exp_annotations: {summary: "Gameplane metrics target cannot be scraped"}
- interval: 1m
input_series:
- series: 'gameplane_agent_performance_value{namespace="gameplane-games",pod="duration-0",metric="tick",signal="tick_duration",unit="seconds"}'
Expand Down
47 changes: 46 additions & 1 deletion docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ Check Prometheus **Status → Targets** for agent and tunnel targets with `up=1`
then query `gameplane_agent_players_online` and `gameplane_tunnel_ready`.
Unknown player counts are absent even when scraping works.

The agent and tunnel PodMonitors live in the primary games namespace. Their
target lists include that namespace and every entry in `operator.gameNamespaces`.
Ensure Prometheus honors PodMonitor namespace selectors and can list and watch
pods in each target namespace. Provision the same approved scraper ingress in
additional namespaces that enforce default deny, and allow Prometheus egress.
Workload alerts select the same explicit list of namespaces.

For installations using `networkPolicies.tenantIsolation: true`, the chart
installs the approved scraper ingress in every managed game namespace. Tenant
operators should query a tenant-scoped Prometheus endpoint or a datasource
that enforces their namespace. A Grafana variable filters a view and grants no
authorization. Keep the fleet-wide Prometheus credentials with operators.

`GameplaneScrapeUnavailable` fires when a discovered endpoint stays down.
`GameplaneScrapeTargetMissing` compares discovered targets with running
agent/tunnel containers on Gameplane-labeled pods. Enable kube-state-metrics
pod label collection for `app.kubernetes.io/name` (for example
`--metric-labels-allowlist=pods=[app.kubernetes.io/name]`) and scrape its
container-running and pod-label metrics to enable that comparison.

With the operator and its NetworkPolicies enabled, the chart requires a nonempty
`serviceMonitors.scrapeNamespaceSelector`. Missing configuration fails with a
message naming the setting. If another system owns the policies, set
Expand Down Expand Up @@ -135,16 +155,41 @@ staleness limit. See [relay-health.md](relay-health.md).
Tailscale, frp and Playit all use the same metrics path. Metrics contain no
credentials, login URLs, proxy names or provider error messages.

`GameplaneRelaySaturated` fires on an increase in a supervisor flow-rejection
or UDP queue-drop counter over five minutes. The dashboard shows both rates
by namespace and Pod. The embedded Tailscale forwarder supplies these counters.
For frp and Playit the support gauge is zero and the counters are absent.
Use provider-side measurements for those paths.

Container CPU throttling and working-set pressure require kubelet/cAdvisor
scrapes. OOM/restart, Pending Pod and node pressure rules require kube-state-metrics.
Install/configure those collectors (kube-prometheus-stack normally provides
them); the minimal Prometheus example demonstrates Gameplane discovery and
does not deploy them or Grafana. A missing upstream collector leaves those
series absent; it does not mean zero pressure. Agent process RSS is not total
container memory. These rules filter the games namespace and use `max` to
container memory. These rules filter the explicitly managed game namespaces and use `max` to
deduplicate replicated sources. The existing fleet rules likewise collapse
duplicate operator replicas instead of adding their cache-derived counts.

In operator-managed games the RSS series sums the game processes in the shared
PID namespace. cAdvisor reports the game container's working set independently.
Distinguish sustained growth from allocator churn by correlating both with an
engine profiler, such as JVM allocation and GC events from Java Flight Recorder
on a compatible Minecraft JVM. Allocation rate can rise while RSS stays flat.
Native engine heap or frame profiles require that engine's profiling tools.

At official module revision `48b8b65c`, Minecraft Java, ARK Survival
Ascended, Palworld, Project Zomboid and CS2 have no numeric tick or frame
declarations. Minecraft Java's `seed` readout is display-only. The
[Palworld module change](https://github.com/GameplanePanel/module/pull/60)
declares instantaneous server FPS from the authenticated REST metrics
endpoint. Its [engine fixture](https://github.com/GameplanePanel/module/blob/54e9a11a694c10b0dc2550391782b95bf1a883de/palworld/samples/metrics.json)
records 59 FPS on Steam build 25247047. Its average FPS and frame time are
separate fields. Select a module revision containing the declaration. Missing
or malformed responses leave the numeric series absent. A server tick-rate
setting describes a configured target, while this series describes observed
frames.

The Workloads dashboard shows scrape health, relay readiness/known state,
supported game measurements, container pressure, restarts and Pending Pods.
Missing measurements remain gaps. CI renders and evaluates the shipped alert
Expand Down
Loading
Loading