cozystack/packages/system
Aleksei Sviridkin 3977aef509
feat(monitoring): add GPU observability dashboards and recording rules (#2418)
## What this PR does

Adds GPU observability to Cozystack: five Grafana dashboards, a set of
VictoriaMetrics recording rules with a throttle-regression alert, and
reference manifests for wiring the NVIDIA GPU Operator and DCGM Exporter
on Talos when running GPU workloads directly in pods.

### Components

1. **Dashboards** — `dashboards/gpu/*.json`, registered in
`packages/system/monitoring/dashboards-infra.list`. All follow the
project convention: the Prometheus data source is selected through the
`$ds_prometheus` template variable.

- `gpu-performance` — per-GPU utilization (NVML, tensor pipe, graphics
engine, memory copy), VRAM, power, temperature, and health (XID errors,
power/thermal throttling). All metrics are shown per-GPU, filterable by
the `$Hostname` selector.
- `gpu-fleet` — cluster-wide inventory, capacity, utilization, and
per-node power draw as percentage of TDP.
- `gpu-tenants` — per-namespace allocation and 24-hour GPU-hour/kWh
accounting; utilization and power are shown per-node (DCGM cannot
attribute hardware metrics to namespaces).
- `gpu-quotas` — allocated vs. requested GPUs, pending pods, and a
per-namespace requests/limits table. All counts derive from the
`namespace:gpu_count:allocated` recording rule, which excludes
`Failed`/`Succeeded` pod carryover.
- `gpu-efficiency` — cluster and per-GPU efficiency: tensor saturation,
util-per-watt, and per-GPU power/thermal throttle fractions.

2. **Recording rules and alert** —
`packages/system/monitoring-agents/alerts/gpu-recording.rules.yaml`.
Four rule groups:

- `gpu.recording.cluster.1m` — cluster-wide totals consumed by overview
panels.
- `gpu.recording.node.1m` — per-node hardware aggregates (grouped by
`Hostname`) plus per-namespace allocation counts from kube resource
requests; filters `cozy-*`/`kube-*`.
- `gpu.recording.efficiency.1m` — per-GPU tensor saturation and
util-per-watt, plus per-GPU power/thermal throttle fractions bounded via
`clamp_max(..., 1)`.
- `gpu.recording.throttle.validation.5m` — houses the
`GPUThrottleFractionOverOne` warning alert that fires if the pre-clamp
throttle fraction exceeds 1.0. This guards against DCGM counter-unit
drift between GPU families; the `/1e9` divisor is verified on NVIDIA A10
with DCGM 3.x.

Rules are safe on clusters without DCGM — they evaluate to empty series
when no matching metrics are scraped.

3. **Reference manifests** under
`packages/system/gpu-operator/examples/`. These are **not** templates;
they document one working configuration:

- `values-native-talos.yaml` — Cozystack Package values for the
native-pod scenario.
- `dcgm-custom-metrics.yaml` — ConfigMap extending the DCGM CSV with
profiling, ECC, throttling, and energy counters used by the dashboards
and recording rules.
- `nvidia-driver-compat.yaml` — DaemonSet that stages
`libnvidia-ml.so.1` and `nvidia-smi` from the Talos glibc tree into a
location the GPU Operator validator inspects. Workaround for
[NVIDIA/gpu-operator#1687](https://github.com/NVIDIA/gpu-operator/issues/1687).
Requires `pod-security.kubernetes.io/enforce: privileged` on the target
namespace when the cluster enforces baseline/restricted
PodSecurityStandards.
- `README.md` — explains the two deployment paths (sandbox vs. native),
which DCGM metrics each dashboard depends on, and how the pieces fit
together.

4. **Cross-validation test** — `hack/check-gpu-recording-rules.bats`
enforces that every recording-rule reference in tracked dashboards
resolves, and that every DCGM metric referenced by the rules is declared
in either the upstream default CSV snapshot
(`hack/dcgm-default-counters.csv`) or the custom CSV shipped under
`examples/`.

### Why reference manifests, not templates

The out-of-the-box `packages/system/gpu-operator/values-talos.yaml`
targets **sandbox workloads** — GPUs passed through to KubeVirt VMs via
VFIO, driver disabled on the host, device plugin disabled. That is the
sensible default for Cozystack today.

Running GPU workloads directly in pods on Talos is also possible but
requires a different configuration that makes assumptions not every user
shares:

- the NVIDIA Talos system extension must be installed on GPU nodes,
- the operator's own driver and toolkit components must be disabled
because the extension provides them,
- the validator's hardcoded paths need a workaround until
NVIDIA/gpu-operator#1687 lands upstream.

Shipping those as active templates would silently impose those
assumptions. Shipping them as reference files next to the package lets
operators opt in with eyes open and understand the moving parts before
applying them.

### Scope note

The dashboards and recording rules are useful independently of the
reference manifests — any cluster that scrapes DCGM Exporter (however it
is installed) will populate them. The reference manifests are
self-contained and do not change any default behavior of the
`gpu-operator` package.

### Screenshots

<img width="2824" height="1055" alt="2026-04-27_12-36-52"
src="https://github.com/user-attachments/assets/71f85de7-1c80-4817-b36c-aeb1c2bdd39a"
/>
<img width="2913" height="1255" alt="2026-04-27_12-36-39"
src="https://github.com/user-attachments/assets/7a54daca-0727-4510-938c-080d31bdc229"
/>
<img width="2932" height="1251" alt="2026-04-27_12-36-30"
src="https://github.com/user-attachments/assets/f6c6c215-3d05-400c-b21c-29f267c93f23"
/>
<img width="2864" height="1222" alt="2026-04-27_12-36-00"
src="https://github.com/user-attachments/assets/e9d34bab-ade5-434b-92c3-f36712cf68d9"
/>
<img width="2958" height="1226" alt="image"
src="https://github.com/user-attachments/assets/0047a5f8-12a5-4cda-8676-041de139cb76"
/>


### Release note

```release-note
feat(monitoring): add GPU observability — five Grafana dashboards (performance, fleet, tenants, quotas, efficiency), VictoriaMetrics recording rules with a throttle-regression alert, and reference manifests under packages/system/gpu-operator/examples/ for running GPU workloads natively in pods on Talos.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added five GPU dashboards for performance, efficiency, fleet overview,
quotas/allocation, and tenant usage (utilization, power, throttling,
allocation, billing).
* Added cluster recording rules and a throttling validation alert; new
Prometheus-derived metrics and per-GPU rankings/timeseries.

* **Documentation**
* Added GPU Operator examples and README documenting native Talos setup
and required DCGM counters.

* **Tests**
* Added validation tests ensuring dashboard ↔ recording-rule and DCGM
metric consistency.

* **Chores**
  * Registered new GPU dashboards in infra listings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-28 22:42:01 +03:00
..
application-definition-crd refactor(api): rename CozystackResourceDefinition to ApplicationDefinition 2026-01-15 22:35:56 +01:00
backup-controller Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
backupstrategy-controller fix(backups): move velero-configmap Role to velero chart (#2459) 2026-04-23 11:57:54 +05:00
bootbox refactor(labels): remove cozystack.io/ui label 2026-01-19 13:59:29 +01:00
bootbox-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
bucket Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
bucket-rd fix(bucket): regenerate schema and docs from values.yaml annotations 2026-03-03 19:32:32 +03:00
capi-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
capi-providers-bootstrap refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
capi-providers-core refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
capi-providers-cpprovider fix(capi-provider): update Kamaji CAPI provider to v0.16.0 2026-02-19 22:12:33 +03:00
capi-providers-infraprovider refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
cert-manager [cert-manager] Added cleanup before crds upgrade 2026-02-26 18:32:35 +05:00
cert-manager-crds [cert-manager] Updated cert-manager to 1.19.3 with new crd packaging 2026-02-26 15:28:19 +03:00
cert-manager-issuers fix(platform): migrate ACME HTTP-01 to ingressClassName API 2026-04-21 17:00:31 +05:00
cilium fix(cilium): rebuild image multi-arch and pin tag to 1.19.3 2026-04-23 17:33:19 +03:00
cilium-networkpolicy refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
clickhouse-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
clickhouse-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
cluster-autoscaler feat(cluster-autoscaler): enable enforce-node-group-min-size by default 2026-02-14 11:42:52 +01:00
clustersecret-operator Add clustersecret-operator system package 2026-02-10 22:47:20 +05:00
coredns fix coredns serviceaccount to match kubernetes bootstrap rbac 2026-02-02 15:32:50 +01:00
cozy-proxy feat(cozy-proxy): bump to v0.3.0 2026-04-28 11:14:27 +02:00
cozystack-api Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
cozystack-basics [system] Fix tenant RBAC for endpointslices read access (#2257) 2026-03-27 17:48:46 +05:00
cozystack-controller Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
cozystack-scheduler feat(scheduler): storage-aware scheduling 2026-04-13 17:15:09 +03:00
dashboard Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
etcd-operator fix(etcd-operator): replace deprecated kube-rbac-proxy image 2026-03-10 08:30:43 +01:00
etcd-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
external-dns feat(extra): add external-dns as standalone extra package 2026-03-10 12:48:01 +01:00
external-dns-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
external-secrets-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
flux-plunger Fix pre-commit check 2026-01-20 03:24:32 +01:00
fluxcd refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
fluxcd-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
foundationdb-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
foundationdb-rd refactor(labels): remove cozystack.io/ui label 2026-01-19 13:59:29 +01:00
gateway-api-crds refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
goldpinger refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
gpu-operator docs(gpu-operator): clarify violation counter unit ambiguity in DCGM CSV 2026-04-28 12:07:31 +03:00
grafana-operator Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
harbor Fix system postgresql images to 17.7-standard-trixie 2026-04-10 12:47:46 +05:00
harbor-rd fix(harbor): remove incorrect tenant module flags 2026-04-21 20:26:13 +02:00
hetzner-robotlb chore(hetzner-robotlb): update robotlb chart to appVersion 0.0.6 2026-04-23 16:57:23 +05:00
http-cache-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
info-rd refactor(labels): remove cozystack.io/ui label 2026-01-19 13:59:29 +01:00
ingress-nginx Replaced direct chart edits with patch files 2026-03-02 12:35:14 +05:00
ingress-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
kafka-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
kafka-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
kamaji fix(kamaji): increase memory limits and add startup probe (#2421) 2026-04-24 23:11:53 +03:00
keycloak fix(platform): migrate ACME HTTP-01 to ingressClassName API 2026-04-21 17:00:31 +05:00
keycloak-configure [keycloak-configure] Make values.yaml self-documenting 2026-04-02 19:29:54 +03:00
keycloak-operator [keycloak-operator] Update to v1.32.0 2026-03-11 15:15:09 +03:00
kilo [kilo] Switch from fork to upstream squat/kilo 2026-03-23 15:18:23 +03:00
kubeovn fix(kube-ovn): bump kube-ovn to v1.15.10 with port-group regression fix 2026-04-21 20:09:19 +02:00
kubeovn-plunger Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
kubeovn-webhook Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
kubernetes-rd feat(kubernetes): make wait-for-kubeconfig image overridable for air-gapped registries 2026-04-27 13:50:08 +03:00
kubevirt fix(kubevirt): disable serial console log to fix VM pod initialization 2026-02-21 20:46:31 +01:00
kubevirt-cdi feat(cdi): switch clone strategy to csi-clone 2026-03-10 12:42:01 +01:00
kubevirt-cdi-operator [cdi-operator] Update to v1.64.0 2026-02-20 20:16:33 +01:00
kubevirt-csi-node Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
kubevirt-instancetypes refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
kubevirt-operator [kubevirt-operator] Update to v1.6.4 2026-02-20 20:16:34 +01:00
lineage-controller-webhook Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
linstor feat(linstor): bump linstor-csi to v1.10.6 with Protocol-C dual-attach fix 2026-04-27 14:50:47 +02:00
linstor-gui build(linstor): use shared BUILDX_ARGS for linstor-gui image build 2026-04-27 17:31:07 +05:00
linstor-scheduler feat(scheduler): storage-aware scheduling 2026-04-13 17:15:09 +03:00
local-ccm Update local-ccm v0.3.0 2026-02-10 20:19:03 +01:00
mariadb-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
mariadb-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
metallb Prepare release v1.0.0-alpha.1 2026-01-15 23:32:41 +00:00
metrics-server refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
mongodb-operator Fix pre-commit check 2026-01-20 03:24:32 +01:00
mongodb-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
monitoring feat(monitoring): add GPU observability dashboards and recording rules (#2418) 2026-04-28 22:42:01 +03:00
monitoring-agents fix(monitoring): prevent many-to-many match in util-per-watt recording rule 2026-04-28 11:21:12 +03:00
monitoring-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
multus Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
nats Add monitoring for NATs 2026-02-17 22:54:12 +01:00
nats-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
nfs-driver refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
objectstorage-controller Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
openbao feat(openbao): add system chart with vendored upstream 2026-02-17 20:03:01 +03:00
openbao-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
opencost Fix pre-commit check 2026-01-20 03:24:32 +01:00
opensearch-operator [opensearch] Address PR review feedback 2026-03-17 11:20:44 +01:00
opensearch-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
piraeus-operator [piraeus-operator] Split LINSTOR controller availability and metrics alerts 2026-03-25 16:11:14 +03:00
piraeus-operator-crds Move CRDs installation logic to piraeus-operator-crds chart 2026-02-11 22:54:56 +01:00
postgres-operator docs(postgres-operator): fix backoffLimit/activeDeadlineSeconds comment math 2026-04-24 13:33:07 +03:00
postgres-rd docs(postgres): clarify bootstrap field descriptions 2026-04-21 14:34:30 +03:00
prometheus-operator-crds refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
qdrant [qdrant] Add Qdrant vector database application 2026-02-06 13:30:58 +03:00
qdrant-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
rabbitmq-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
rabbitmq-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
redis-operator refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
redis-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
reloader refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
seaweedfs Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
seaweedfs-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
snapshot-controller refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
tcp-balancer-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
telepresence refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
tenant-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
velero fix(backups): move velero-configmap Role to velero chart 2026-04-23 10:41:41 +05:00
vertical-pod-autoscaler Post upgrade fixes for v1.0 packagesources 2026-01-28 20:08:35 +03:00
vertical-pod-autoscaler-crds refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
victoria-metrics-operator feat(monitoring): upgrade victoria-metrics-operator to v0.68.4 2026-04-20 15:48:53 +03:00
virtualprivatecloud-rd [docs] Update cozyvalues-gen 2026-03-25 15:59:22 +05:00
vm-default-images [vm-default-images] Default to replicated storageClass and document storage requirements 2026-04-14 19:59:20 +05:00
vm-disk-rd [vm-disk] Fix vm-disk-rd 2026-04-14 19:59:19 +05:00
vm-instance-rd [vm-instance] Add externalAllowICMP knob, drop in-PR changelog 2026-04-28 08:37:13 +02:00
vpn-rd [docs] Updated app go types 2026-03-25 15:57:25 +05:00
vsnap-crd refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
Makefile refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00