Today's build is a Grafana Dashboard which is pulling in live data from aws timestream.
Currently, it's showing line graphs which is broken down by hour. The query we use is this:
WITH binned_query AS (
SELECT
BIN(time,1h) AS "point",
x_id AS "series",
max(measure_value::bigint) AS "metric"
FROM $__database.$__table
WHERE measure_name = 'x'
AND $__timeFilter
GROUP BY BIN(time,1h), x_id order by 1
)
SELECT series, CREATE_TIME_SERIES(point,metric)
FROM binned_query
GROUP BY series
With the above what is happening is that we are getting data points that are all 1 hour apart. Which is great for some date ranges like 24 hours or 2 days, but when you are looking at 1 hour it would be nice to have it show every minute or 10 minutes.
To accomplish this I see two potential solutions neither of which I've been successful in implementing:
Any help would be greatly appreciated, been a frustrating morning trying to get this working :)
The $__interval
variable might be more useful here instead of 1h
.
This value will change based on the size of the graph/panel and time range. Alternatively if you wanted to keep it at 1h for all graphs and change as you see fit, you could still use this variable and set the interval manually in the panel settings.