Grafana get x time range from the last readings

so i know how to set Grafana up to read a relative time range like say 10, 15, or 30mins since the current time (now). but is there anyway to make this range to start from the latest reading (time)? bc is the range say, last 15mins doesnt have any data, the chart will be empty, it’s better to show the chart starting from the latest reading.

No, I’m not aware of such range relative to last data.
As workaround, you can use the “custom time range”
check all last week then select a range with the mouse.
For big ranges you can also average values in the query so that retrieving a whole year of data can still be quite fast.
You can also write command line in influx tool to check the data, but I bet that’s not your preferred way.
There’s a tool “Chronograph” from the same database company that has more exploration features in case you do know well what’s in the database.

1 Like

ye, i was wondering how Grafana handles large dataset. so u are saying if i put average it will work better for large records?

Yes, then the query looks like this see GROUP BY

SELECT mean("energy")/60 FROM "shelly washing machine" WHERE $timeFilter GROUP BY time(1h)

And the average is computed on the server, you only get results, try to count one data per pixel because more is useless.

so grafana sometime show nodata after a refresh, then it shows again after i refresh it again. hav u experience such issue? i think when it fails to get the data it doesn’t do a retry.

Do you have wifi connection between the browser client, the server or the db server ? If so, it’s normal.

Every dashboard has a refresh rate configurable so would refresh automatically.

I only experienced such issues when the web page goes in background, then with new page load it always worked.