fix(dashboard): scope GPU panels to selected namespace

Pod-level panels on the efficiency dashboard and DCGM-level panels on
the performance dashboard ignored the $namespace template variable, so
changing it left the visualizations unchanged. Add the filter to each
query. Performance-side queries use the `$namespace|` empty-tolerant
form so host-level DCGM series without a namespace label remain
visible when a specific namespace is selected.

Signed-off-by: Arsolitt <arsolitt@gmail.com>
This commit is contained in:
Arsolitt 2026-04-18 07:27:33 +03:00
parent 4e37f64553
commit 5db6ec3e1f
No known key found for this signature in database
GPG key ID: 4D8302CE6A9247C4
2 changed files with 8 additions and 8 deletions

View file

@ -363,7 +363,7 @@
"id": 21,
"targets": [
{
"expr": "topk(20, pod:tensor_saturation:avg5m * 100)",
"expr": "topk(20, pod:tensor_saturation:avg5m{namespace=~\"$namespace\"} * 100)",
"instant": true,
"range": false,
"format": "table",
@ -501,7 +501,7 @@
"id": 22,
"targets": [
{
"expr": "topk(20, pod:util_per_watt:avg5m)",
"expr": "topk(20, pod:util_per_watt:avg5m{namespace=~\"$namespace\"})",
"instant": true,
"range": false,
"format": "table",

View file

@ -553,7 +553,7 @@
"id": 22,
"targets": [
{
"expr": "DCGM_FI_DEV_FB_FREE{Hostname=~\"$Hostname\"} * 1048576",
"expr": "DCGM_FI_DEV_FB_FREE{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"} * 1048576",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}
@ -617,7 +617,7 @@
"id": 31,
"targets": [
{
"expr": "DCGM_FI_DEV_POWER_USAGE{Hostname=~\"$Hostname\"}",
"expr": "DCGM_FI_DEV_POWER_USAGE{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"}",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}
@ -668,7 +668,7 @@
"id": 32,
"targets": [
{
"expr": "DCGM_FI_DEV_GPU_TEMP{Hostname=~\"$Hostname\"}",
"expr": "DCGM_FI_DEV_GPU_TEMP{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"}",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}
@ -751,7 +751,7 @@
"id": 41,
"targets": [
{
"expr": "max by (Hostname, gpu) (DCGM_FI_DEV_XID_ERRORS{Hostname=~\"$Hostname\"})",
"expr": "max by (Hostname, gpu) (DCGM_FI_DEV_XID_ERRORS{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"})",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}
@ -809,7 +809,7 @@
"id": 42,
"targets": [
{
"expr": "rate(DCGM_FI_DEV_POWER_VIOLATION{Hostname=~\"$Hostname\"}[5m])",
"expr": "rate(DCGM_FI_DEV_POWER_VIOLATION{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"}[5m])",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}
@ -857,7 +857,7 @@
"id": 43,
"targets": [
{
"expr": "rate(DCGM_FI_DEV_THERMAL_VIOLATION{Hostname=~\"$Hostname\"}[5m])",
"expr": "rate(DCGM_FI_DEV_THERMAL_VIOLATION{Hostname=~\"$Hostname\", namespace=~\"$namespace|\"}[5m])",
"legendFormat": "{{Hostname}}/{{gpu}}",
"refId": "A"
}