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:
parent
cf2b8c2ee4
commit
ff0da0b617
1 changed files with 2 additions and 2 deletions
|
|
@ -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}}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue