grafana-aws-athena-datasource icon indicating copy to clipboard operation
grafana-aws-athena-datasource copied to clipboard

How to get timeseries data

Open theironrobin opened this issue 5 years ago • 2 comments

I am doing a count(*) which just returns one value. I thought this would make graph view work but grafana is telling me "unable to graph data, switch to table view" any idea how to get graph view to work so i can plot data over time?

theironrobin avatar Aug 10 '20 16:08 theironrobin

Update: was able to get graphed data by doing posting query and doing something like SELECT count(*) AS "200 event/media", localtimestamp AS ts but it doesn't persist, it just keeps updating but its only one dot, it does not continue as a line graph. any advice?

theironrobin avatar Aug 10 '20 17:08 theironrobin

i solved it partially by changing my query to query 5 minute windows like so: SELECT FROM_UNIXTIME( FLOOR( TO_UNIXTIME( DATE_PARSE(time, '%Y-%m-%dT%H:%i:%s.%fZ') )/300 ) * 300 ) AS five_minute_window, COUNT(*) AS "count" FROM alb_logs GROUP BY 1

its slow but it works

theironrobin avatar Aug 11 '20 18:08 theironrobin