As has been discussed in the past here continuous queries don’t work well when data sources can get disconnected, and come back later to upload historical data in batches.
There is no good solution inside InfluxQL, so in case that is useful to someone here is a simple
sh + jq + influx workaround to derive a measurement from another one, without missing records:
#!/bin/bash LAST=`influx -database mydb -format json -execute 'select last(field1) from target' | jq '.results.series.values'` influx -database mydb <<EOD select integral(field1)/3600000 as field1 into target from source where time > $LAST group by time(30m); EOD
We could really use something like this inside InfluxDB itself IMHO…