How to show null value when there is no data in time series? null as zero not working

My sensor was not sending data to InfluxDB database for few hours (since 2017-04-17 22h until 2017-04-17 17h), and once battery in sensor was replaced it started sending data again.

How to show null or zero data? I have tried editing this graph and choosing “null” and “null as zero” but that seams to do nothing. I’m running grafana server 4.2.0-beta1

Any suggestions?

Here is how query looks like:

Add a group by time, you should always have a group by time, never remove it!

After that you can add a fill(null) to your query, so that time intervals with no data return null.

Also set a lower limit of the auto group by time interval to the rate at which you write data, you do this with an expression like >10s

What am I doing wrong? When I add group by time whole graph disappears :frowning:

My sensor is uploading data to influxdb every 3 minutes (180 seconds), but if I add group by time then graph just disappears. Any ideas why?

I added “>180s” in “Group by time interval”.

I just had to figure out where to read error messages, and this is the error message I got:

{
“error”: “error parsing query: aggregate function required inside the call to moving_average”,
“message”: “error parsing query: aggregate function required inside the call to moving_average”
}

After removing “moving average” and enabling “median” now graph works! And here is how it looks like:

2 Likes