From e4d0812a6952d11949d09d8119c0d075460ffeae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20D=C3=A9siles?= <1536672+cdesiles@users.noreply.github.com> Date: Sun, 6 Sep 2026 23:51:22 +0200 Subject: [PATCH] fix(grafana): NUT dashboard instance variable ignores stale series The variable used label_values() which lists all instances across full retention, alphabetically sorting and auto-selecting the dead 127.0.0.1:9199 (relabeled to 'eaton' ~31h ago). Its stale series has no samples in the visible window so every panel rendered empty. Replace with query_result(count by (instance) (...)) which only surfaces live targets. --- roles/grafana/files/nut-status-dashboard.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/grafana/files/nut-status-dashboard.json b/roles/grafana/files/nut-status-dashboard.json index 2ad200f..71183ed 100644 --- a/roles/grafana/files/nut-status-dashboard.json +++ b/roles/grafana/files/nut-status-dashboard.json @@ -16,7 +16,8 @@ "label": "UPS", "type": "query", "datasource": { "type": "prometheus", "uid": "prometheus" }, - "query": { "query": "label_values(network_ups_tools_device_info, instance)", "refId": "A" }, + "query": { "query": "query_result(count by (instance) (network_ups_tools_device_info))", "refId": "A" }, + "regex": "/.*instance=\"([^\"]+)\".*/", "refresh": 2, "multi": false, "includeAll": false,