Hi @djvanhelmond. SQL queries must be ordered by time for a graph visualization like the one you’re using to show properly.
For the Timestream datasource you’re useing, the macro to use would be $__timeFilter, per the “Macros” section of the Timestream plugin doc here: Amazon Timestream plugin for Grafana | Grafana Labs
And then the query would need to have something like a “ORDER BY ASC” clause.
I don’t have an exact example for Timestream but here’s how that SQL query would look in for the MySQL datasource (based on the variables described for that data source here: MySQL | Grafana Labs)
UNIX_TIMESTAMP(atimestamp) as time,
aint as value,
avarchar as metric
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp ASC