Hello everyone, what is the best way to query influx for time series happened between 9 am and 3 pm each day for say one week / month at time? Latter is same as filter away all time series from 3 pm today until 9 am next day and then for some period of time like one week or month.
We had the same requirement: exclude non working time from some queries. Eventually we did it by adding two tags to every datapoint: âhour-of-dayâ and âday-of-weekâ. The series cardinality goes up by a 24*7 factor, but in our case it is still manageable and with the new releases it shouldnât be an issue anymore, I hope.
As you know, on Influx you canât really âaddâ tags to an existing datapoint, but you must insert a new datapoint with the same data plus the new tags. We did it at an intermediate step where data is aggregated in a complex way on hourly basis. Due to the kind of business logic applied, we couldnât do it with a proper continuous query but had to code it in a AWS Lambda function triggered every hour.