From 1484a555db80be15627cbe5aec331c03c5ebed09 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Tue, 2 Feb 2021 22:32:20 +0000
Subject: [PATCH] Set a longer metric retention time for Prometheus

---
 roles/monitor/defaults/main.yml               | 2 ++
 roles/monitor/templates/prometheus.default.j2 | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/roles/monitor/defaults/main.yml b/roles/monitor/defaults/main.yml
index da5429b..a01e536 100644
--- a/roles/monitor/defaults/main.yml
+++ b/roles/monitor/defaults/main.yml
@@ -3,3 +3,5 @@
 graphite_secret_key: "changeme"
 grafana_secret_key: "changeme"
 test_source_stream: "/test.ogg"
+prometheus_tsdb_retention_time: "180d"
+
diff --git a/roles/monitor/templates/prometheus.default.j2 b/roles/monitor/templates/prometheus.default.j2
index 04ff559..7d7f42b 100644
--- a/roles/monitor/templates/prometheus.default.j2
+++ b/roles/monitor/templates/prometheus.default.j2
@@ -1,2 +1,2 @@
-ARGS="--web.external-url=https://monitor.{{ public_domain }}"
+ARGS="--web.external-url=https://monitor.{{ public_domain }} --storage.tsdb.retention.time={{ prometheus_tsdb_retention_time }}"
 
-- 
GitLab