Column order in grafana table

3,883 views
Skip to first unread message

Benjamin

unread,
Sep 27, 2018, 3:40:36 AM9/27/18
to Prometheus Users
When getting a prometheus metrics with labels displayed in a grafana table, the order of the grafana columns(labels in prometheus) are just sorted in alphabetical order.  There is no way to display the column in a different order.  

I just googled this issue, and there are lots of similar discussions. The feedback from the grafana team is that Grafana just displays the labels in the same order as what is returned from the data source(prometheus in this case).  So their point is that the users should can control the order of the labels in the query results. Accordingly they think that this issue should be resolved by the data source instead of grafana.  

But unfortunately, we can't change the order of the labels in prometheus. They are always in alphabetical order.  

I tried to change the order of the labels using "by", but it did not work. For example,  the label "label_a" is still displayed ahead of "label_b) in the following expression.
max(whatever_metrics) by (label_b, label_a)

How do you think?

Ben Kochie

unread,
Sep 27, 2018, 3:45:46 AM9/27/18
to 汪超, Prometheus Users
IMO, this is just Json data results, and it's up to the UI (Grafana) to do what you want.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8ebde86d-3a19-4fcc-b9e1-b3368dc0eb27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjamin

unread,
Sep 27, 2018, 3:59:58 AM9/27/18
to Prometheus Users
I just found that there is an open issue for grafana. But the issue was raised more than 2 years ago. Obviously the grafana team doesn't want to fix it. 


在 2018年9月27日星期四 UTC+8下午3:45:46,Ben Kochie写道:

Ben Kochie

unread,
Sep 27, 2018, 4:17:44 AM9/27/18
to 汪超, Prometheus Users
I wouldn't say that, sometimes these things just lack visibility and someone to look into it.

We have a couple people at Grafana that might be able to bring this issue up.

Benjamin

unread,
Sep 27, 2018, 4:21:05 AM9/27/18
to Prometheus Users
It would be better, thanks.

在 2018年9月27日星期四 UTC+8下午4:17:44,Ben Kochie写道:
Reply all
Reply to author
Forward
0 new messages