How to make dashboard graph panel query scale time series values accordingly when time groupping interval changes?
I’m using InfluxDB datasource with Grafana 4.1.2.
Suppose I have time series data with bytes_per_5min values stored every 5min and I’m interested in bitrate.
For relatively short time range(24 hours) 5 min resolution is OK and query might look like:
SELECT sum(“bytes_per_5min”)*8/300 as ‘bitrate’ FROM “SomeMeasurement” WHERE $timeFilter GROUP BY time(5m),“device” fill(null)
For longer time range (90 days) 5 minutes steps are usually not needed and 1day steps might be enough.
So, the query should look like:
SELECT sum(“bytes_per_5min”)*8/86400 FROM “SomeMeasurement” WHERE $timeFilter GROUP BY time(1d),“device” fill(null)
Thus scaling factor in query must change synchronously with time range and interval changes. Preferably with intervals selected from a predefined set. Can it be done in current grafana?
Related question: if autoscaling describe above is not supported yet is there a way to restrict users from selecting arbitrary too wide time range windows for any given dashboard?
So that fixed-time-window daily-,weekly-,monthly-dashboards can be pre-created for users without the risk of blowing up their browsers or overloading influxdb server.