From 169862d11d5075087a018177939634d281a82870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannig=20Perr=C3=A9?= Date: Sat, 20 Nov 2021 15:18:19 +0100 Subject: [PATCH] =?UTF-8?q?:memo:=20Ajout=20fichier=20d'exemple=20police?= =?UTF-8?q?=20de=20r=C3=A9tention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapitre-17/retention-policy.influx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 chapitre-17/retention-policy.influx diff --git a/chapitre-17/retention-policy.influx b/chapitre-17/retention-policy.influx new file mode 100644 index 0000000..e88fc0e --- /dev/null +++ b/chapitre-17/retention-policy.influx @@ -0,0 +1,10 @@ +ALTER RETENTION POLICY autogen ON prometheus DURATION 1d SHARD DURATION 1h + +CREATE RETENTION POLICY "1m" ON prometheus DURATION 15d REPLICATION 1 +CREATE CONTINUOUS QUERY "1m" ON prometheus BEGIN SELECT max(value), mean(value), min(value), sum(value) INTO prometheus."1m".:MEASUREMENT FROM prometheus../.*/ GROUP BY time(1m), * END + +CREATE RETENTION POLICY "5m" ON prometheus DURATION 63d REPLICATION 1 +CREATE CONTINUOUS QUERY "5m" ON prometheus BEGIN SELECT max(value), mean(value), min(value), sum(value) INTO prometheus."5m".:MEASUREMENT FROM prometheus../.*/ GROUP BY time(5m), * END + +CREATE RETENTION POLICY "1h" ON prometheus DURATION 455d REPLICATION 1 +CREATE CONTINUOUS QUERY "1h" ON prometheus BEGIN SELECT max(value), mean(value), min(value), sum(value) INTO prometheus."1h".:MEASUREMENT FROM prometheus../.*/ GROUP BY time(1h), * END