I have a timeseries panel(Grafana8) where I want to show a sum of values overtime. The values are retrieved from an Influx database(version 1.8)
The problem is, the values should be persisted in influx one data point per hour, but it’s not always the case. Sometimes I see multiple datapoints in the databse, and this messes strongly with my query.
My query is like this:
SELECT sum(sum1) from (select sum(“number”) as sum1 FROM “measurement” WHERE <> AND $timeFilter) GROUP BY time($__interval) fill(none)
$__interval should be set at 1 hour, in theory, but since my data comes in at irregular intervals, the panel shows weird spikes. Same behaviour I get if I let Grafana to set the interval.
Here, the value should be 11, but because I had 2 values in that interval Grafana shows 22.
Is there a way to get the sum of values over time, even if I don’t get data regularly?