VictoriaMetrics and Grafana - Sometimes Missing Data

Hello,
I set up VictoriaMetrics and Grafana a couple of days ago to get long term storage of some sensor values.
I created a dashboard that shows humidity and temperature readings from 3 sensors (2x Aqara Zigbee, 1x AirGradient) and it works… partially.

My problem is now that I won’t get all the data in Grafana. So the graphs that I can see are “spotty” and have blank spots.

In HomeAssistant directly, I can see the entire history without interruptions.

Here are two screenshots to show the difference.
The Airgradient is in the Office and gives much more frequent updates compared to the Aqara sensors.

HomeAssistant

Grafana

As you can see, Grafana also has times when the value does not change, but there is still a line. So I guess that is not the problem.

Any help is appreciated
NIo

This has nothing to do with VictoriaStorage and everything to do with how Grafana displays missing data.

See: Time series | Grafana documentation use “Always” connect null values.

Also you probably want the fill option set to previous:

Screenshot 2023-01-26 at 09-20-46 Grafana – Home Assistant

2 Likes

If I understand correctly, this would draw straight lines where I currently see no data at all, right?

But the data is still missing?

To me, it appears that the data is still present in HomeAssistant or is HA just doing clever “null value connecting” as well?

If the data is also missing in HA, should I be concerned and try to troubleshoot or is this to be expected from both ESP32(Airgradient) and Zigbee Devices?

It’s not missing. The Grafana gaps correspond to flat areas in your Home Assistant graphs. I.e. times when the sensor has not changed. HA only sends data to influxdb when there is a change of state.

So if you make the changes I recommend both graphs will look the same.

1 Like

I made the changes you suggested and had it running for some time.

But I still see some differences.

Grafana shows a slope, while HA shows two distinct steps.
One example in the screenshots is between 5:30 an 6:30


You have not done this for all the entities you are trying to graph:

Screenshot 2023-01-26 at 09-20-46 Grafana – Home Assistant

Oh my bad!
You are correct, I did not change that setting!

But as far as I can tell, I can’t change that setting in my setup.

Ah. That may be an InfluxDB only setting. There’s probably a way to fill with previous value when using VictoriaMetrics but as I don’t use it I don’t know it.

After some googeling I found it :slight_smile:
There is keep_last_value for VictoriaMetrics
I had to go into the “code” mode

My setup now looks like this

Thanks for the help! :grinning:

5 Likes