How to fill up a measurement series, if only changes are written to InfluxDB

Hello,
I am a newbie and therefor I’m even not sure, for which keywords I could search to find a solution. So, here is my challenge.

The data source is sending measurements to InfluxDB 1.8.5 via Telegraf 1.18.1 over UDP to the inputs.socket_listener only, if measurement-values are changing. E.g. changes may happen for certain measurements only once per hour, but for others every second as well.

I am using Grafana for the visualization. The issue is, if I zoom into a smaller time-range e.g.15 minutes, there may be no data for the slowly changing measurement. Then the measurement series disappears completely from the panel/diagram. But I really would need to see even the slowly changing measurement with it’s past value, which exists before the time-range, and may be interpolated to the value, which exists after the time range.

Is there any way to accomplish this?

P.S. At the moment I have worked around this issue. With a small “proxy” app I am repeating the actual value every 10 seconds and sending it to InfluxDB. But for me this is a quite annoying approach.

Thank you.
Ralf

Hello @Ralf,
Welcome!
Just out of curiosity, if you’re a new user, why are you using 1.8 instead of 2.x?
Hmm I’m not sure why the visualization completely disappears with Grafana, it doesn’t with the InfluxDB UI.

So are you asking for how to perform linear interpolation?

Otherwise, what does your query look like?
You could group by time and then use fill
https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#group-by-time-intervals-and-fill

Hello @Anaisdg

I’m using 1.8.5, because 2.0 isn’t available as binary for Windows and even not for ARMv7 (Raspberry Pi).

The linear interpolation is fine and I am aware of it. This works fine for me.

But you have guided me to the relevant documentation. And there is exactly described, what my issue is:
https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#queries-with-fill-when-no-data-fall-within-the-querys-time-range

Then I looked into the 2.0 documentation but I wasn’t able to find an appropriate solution. May be you or someone else could give me a hint.

And now I will create a feature request.

Thank you very much.

Hello @Ralf,
You could use the window() function with the createEmpty=true
https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/window/

However if you’re looking to perform linear interpolation with a fill() function specifically, that isn’t available yet, but they’re working on it.

Thank you very much for your further swift response.

I have looked into the window() function but it looks quite static regarding the start and endtime, which isn’t static in my measurement series.

Now I have implemented a workaround with an app, which receives the value and sends it to Telegraf every 10 s, no matter if there is a change or not.

Hopefully there will come a solution with InfluxDB, so that I can get rid of my workaround again.