Guidelines

This site is for tech Q&A. Please keep your posts focused on the subject at hand.

Ask one question at a time. Don't conflate multiple problems into a single question.

Make sure to include all relevant information in your posts. Try to avoid linking to external sites.

Links to documentation are fine, but in addition you should also quote the relevant parts in your posts.

0 votes
263 views
263 views

I want to display a metric in Grafana as a (horizontal) bar gauge with sorted values. I'm aware that the bar gauge itself doesn't provide a sorting mechanism, so I'm using the respective PromQL funtion:

sort_desc(rate(my_metric[5m]))

But the panel remains unsorted:

unsorted bar gauge panel

Why does Grafana ignore the sorting, and how do I fix it?

in Sysadmin
by (115)
2 18 33
edit history

Please log in or register to answer this question.

1 Answer

0 votes
 

Most likely you have the type in the panel options set to "Range" (the default). Change it to "Instant" and sorting should work the way you expect.

Grafana panel options: Type "Instant"

by (115)
2 18 33
edit history
...