I have data from sensors that is being collected every 10 seconds, and I have task that creates downsampled data every 5 minutes.
During some periods there is no data from sensors, but for reporting I need to have 5-minute intervals with null data for such cases
For example:
In downsampled bucket I have data with timestamps 2024-06-18T23:15:00.000Z
, 2024-06-18T23:20:00.000Z
and 2024-06-18T23:30:00.000Z
, but do not have records with timestamps 2024-06-18T23:10:00.000Z
and 2024-06-18T23:25:00.000Z
When I query data from 2024-06-18T23:10:00.000Z to 2024-06-18T23:30:00.000Z I would like to get the following result:
2024-06-18T23:10:00.000Z - NULL
2024-06-18T23:15:00.000Z - real value from DB
2024-06-18T23:20:00.000Z - real value from DB
2024-06-18T23:25:00.000Z - NULL
2024-06-18T23:30:00.000Z - real value from DB
I have an idea to check data availability in task and insert dummy records (i.e. timestamp with value == NULL), but can’t find out how to do that in Flux. Or may be it possible to solve without inserting such dummy records.
I am aware of availability of interpolate.linear(every: 5m), but it doesn’t fit for my case (I need NULLs, not linear interpolation).
Any ideas are very appreciated