First, you’re talking about a Graph panel. My problem is with the Worldmap panel - and doing ORDER BY there doesn’t help at all. One of the developers is working on updating the Worldmap panel to accept the new time format but it hasn’t been released yet.
Second, it is quite possible that your problem isn’t fixed, either, and it just so happens that the human-readable timestamps are ordered correctly by ORDER BY. Try playing with different time ranges, encompassing different months, etc.
The problem is in the MySQL data source of Grafana. It has to be fixed there. Some kludges might work for some panels some of the time, but they are not a real fix.
I can confirm that I have see ORDER BY <time_field> ASC fix a number of weird issues with MySQL queries in Grafana that return timeseries data, including in Grafana 7 with the Graph panel.
FWIW, this was not fixed in Grafana 8.0.4. I noticed that the milestone for fixing it has now been moved to Grafana 8.0.5.
This is very unfortunate. The bug has been around for 3 weeks already, the fix was supposed to be in 8.0.3, then in 8.0.4 - and it’s still not fixed. I don’t know what the hold up is, but our visualization not working already made us miss an important report deadline.
I was hoping for this to be resolved quickly. I should have reverted to version 7.5 and blocked the updates of Grafana forever. Almost every single past update has either broken something or made things more inconvenient by moving the user interface elements around - but these were minor annoyances that I was willing to live with. But totally breaking an important visualization and not fixing it for weeks is really pushing the limits of my tolerance…
They have closed my issue on GitHub, saying that version 8.0.6 fixes it. It does not. The Worldmap plugin still doesn’t work. Now they’re saying that I must write some kind of transform - which is not clear to me how to do - and, yes, I’ve read the goddamn docs on this subject.
Fuck this shit. Grafana is dead to me. I’ve reverted to version 7, frozen the package, and will never, ever update it again. This is the only way to make this problem go away and get your stuff working.
Same problem for me on a graphe, even migrated in time series panel, still got "failed to convert long to wide series when converting from dataframe: long series must be sorted ascending by time to be converted " …