Hi
I did implement Influx retention on our icinga Server according to Retention policies and continuous queries made simple
But after some days, i recognized all data in flux DB is deleted one week back.
I did following changes on the Database:
CREATE RETENTION POLICY "rp_2_years" ON "icinga2" DURATION 104w REPLICATION 1
CREATE RETENTION POLICY "rp_3_years" ON "icinga2" DURATION 156w REPLICATION 1
CREATE CONTINUOUS QUERY "cq_after_1_year" ON "icinga2" BEGIN SELECT mean(value) AS value,mean(crit) AS crit,mean(warn) AS warn INTO "icinga2"."rp_2_years".:MEASUREMENT FROM "icinga2"."default"./.*/ WHERE time < 'now()-52w' GROUP BY time(1h),* END
CREATE CONTINUOUS QUERY "cq_after_2_year" ON "icinga2" BEGIN SELECT mean(value) AS value,mean(crit) AS crit,mean(warn) AS warn INTO "icinga2"."rp_3_years".:MEASUREMENT FROM "icinga2"."rp_2_years"./.*/ WHERE time < 'now()-104w' GROUP BY time(1d),* END
ALTER RETENTION POLICY "default" ON "icinga2" DURATION 52w DURATION 168h
Which result in the following printouts:
> SHOW CONTINUOUS QUERIES
name: _internal
---------------
name query
name: icinga2
-------------
name query
cq_after_1_year CREATE CONTINUOUS QUERY cq_after_1_year ON icinga2 BEGIN SELECT mean(value) AS value, mean(crit) AS crit, mean(warn) AS warn INTO icinga2.rp_2_years.:MEASUREMENT FROM icinga2."default"./.*/ WHERE time < 'now()-52w' GROUP BY time(1h), * END
cq_after_2_year CREATE CONTINUOUS QUERY cq_after_2_year ON icinga2 BEGIN SELECT mean(value) AS value, mean(crit) AS crit, mean(warn) AS warn INTO icinga2.rp_3_years.:MEASUREMENT FROM icinga2.rp_2_years./.*/ WHERE time < 'now()-104w' GROUP BY time(1d), * END
> SHOW RETENTION POLICIES ON icinga2
name duration replicaN default
default 168h0m0s 1 true
rp_3_years 26208h0m0s 1 false
rp_2_years 17472h0m0s 1 false
>
I was struggling on the Queries above, because we run a quite old version of influxDB - 0.10.0
Can someone show me my mistakes?
Thank you very much! A