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.
This commit is contained in:
iris 2026-09-20 20:02:42 +02:00
commit ff0da0b617

View file

@ -349,7 +349,7 @@
"uid": "@logsDatasourceUid@" "uid": "@logsDatasourceUid@"
}, },
"queryType": "stats", "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}}" "legendFormat": "{{_SYSTEMD_UNIT}}"
} }
], ],
@ -401,7 +401,7 @@
"uid": "@logsDatasourceUid@" "uid": "@logsDatasourceUid@"
}, },
"queryType": "stats", "queryType": "stats",
"expr": "* | stats by (_HOSTNAME) count() as rows", "expr": "* | stats by (_HOSTNAME) count() as rows | sort by (rows) desc",
"legendFormat": "{{_HOSTNAME}}" "legendFormat": "{{_HOSTNAME}}"
} }
], ],