From ff0da0b617f6262f42b78cb68eea69d19a58a441 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 20 Sep 2026 20:02:42 +0200 Subject: [PATCH] swarm-grafana: sort logstore bargauge panels by value 'Rows by unit' and 'Rows by host' use VictoriaLogs LogsQL, not PromQL, so the sort_desc() fix from the PromQL panels doesn't port directly. Verified live against the real store (swarm-logs query) that '| sort by (rows) desc' after 'stats by (...)' orders correctly on our VictoriaLogs version -- the VictoriaMetrics/VictoriaLogs#258 sort-order bug doesn't reproduce here. Append the sort clause to both panel queries. --- nix/host-modules/swarm-grafana/dashboards/logstore.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/host-modules/swarm-grafana/dashboards/logstore.json b/nix/host-modules/swarm-grafana/dashboards/logstore.json index 0d8cc37b..a16b9f63 100644 --- a/nix/host-modules/swarm-grafana/dashboards/logstore.json +++ b/nix/host-modules/swarm-grafana/dashboards/logstore.json @@ -349,7 +349,7 @@ "uid": "@logsDatasourceUid@" }, "queryType": "stats", - "expr": "* | stats by (_SYSTEMD_UNIT) count() as rows", + "expr": "* | stats by (_SYSTEMD_UNIT) count() as rows | sort by (rows) desc", "legendFormat": "{{_SYSTEMD_UNIT}}" } ], @@ -401,7 +401,7 @@ "uid": "@logsDatasourceUid@" }, "queryType": "stats", - "expr": "* | stats by (_HOSTNAME) count() as rows", + "expr": "* | stats by (_HOSTNAME) count() as rows | sort by (rows) desc", "legendFormat": "{{_HOSTNAME}}" } ],