Bar Gauge Not sorting value from Grafana 8.0

  • What Grafana version and what operating system are you using?

CentOS Linux release 7.9.2009 (Core)

grafana-8.0.0-1.x86_64

  • What are you trying to achieve?

I want that my old bar gauge dashboard working like before 8.0 release.

I’m using a Mysql query on timeseries mode

  • How are you trying to achieve it?

  • What happened?

Before 8.0 release my values was sorted but not with 8.0 release :

I notive that only metric are sorted but not value.

  • What did you expect to happen?

Do I have to make a special configuration to retrieve old behavior ?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

1 Like

I have this exact problem since the update. Found no solution yet.

2 Likes

I have this exact problem, :frowning:

@juliennycz @arthurqrcapital @kauayrocha

Have you experimented with the sort by transformation?

CleanShot 2021-07-09 at 10.49.45

I encountered the same problem after upgrading to Grafana 8.0 with an MS SQLServer datasource.
Changing “Format as” from “Time series” to “Table” fixed it for me. (the field is right beneath the query window)

1 Like

@phasedarray yes thank you, I did not think of that. Data frames went through a breaking change on SQL datasources in Grafana 8. You can read more about it and how to resolve it here.

I am having quite a similar issue.
Setup:

  • MySQL as input database
  • Bar Gauge view
  • Bar Gauge Calculation: “Last *”

The input table has such a format:

id; timestamp; metric_name; metric_value
id1; timestamp1; metric1; value1
id2; timestamp1; metric2; value2
id3; timestamp1; metric3; value3

id100; timestamp2; metric1; value 101

I am retrieving the data in grafana by:

SELECT
timestamp AS “time”,
metric_name AS metric,
metric_value
FROM table_name
ORDER BY timestamp

The Bar Gauge view is now always sorting the metrics alphabetically. As already mentioned this doesn’t change if I am additionally trying to sort in the select statement or the input database is already sorted.
Using the “Sort By” transformation doesn’t work in this case since there is no field I can select to sort by.
Switching from “Time Series” to “Table” results in an input which cannot be used by Grafana and I am not aware how I could change my Select statement such that the output is in the needed format.

Does anybody have a clue what I could do here?

@mattabrams this, doing the trick on my side Thx !