aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-08-27 22:42:23 -0400
committerMitch Riedstra <mitch@riedstra.us>2019-08-27 22:43:09 -0400
commit4d82dba8e2ce90364cb899a293c75ba37cbb791f (patch)
treeef92bf2967c2b2347e3736ef38d0aaa1b0d197f3
parent440d524e4769f82417c6bc12d83a1fe1d9113986 (diff)
downloadprometheus-4d82dba8e2ce90364cb899a293c75ba37cbb791f.tar.gz
prometheus-4d82dba8e2ce90364cb899a293c75ba37cbb791f.tar.xz
Set a default retention time
-rw-r--r--defaults/main.yml1
-rw-r--r--templates/prometheus/runit/run1
2 files changed, 2 insertions, 0 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index 634243f..23bdc38 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -3,6 +3,7 @@
prometheus_ui_listen: ':9090'
prometheus_home_dir: /var/lib/prometheus
prometheus_data_dir: '{{prometheus_home_dir}}/data'
+prometheus_retention_time: "730d"
prometheus_user: prometheus
prometheus_version: "2.7.2"
prometheus_os: "{{ansible_facts['system']|lower}}" # Should resolve to "linux"
diff --git a/templates/prometheus/runit/run b/templates/prometheus/runit/run
index f70f1ae..cf9ad65 100644
--- a/templates/prometheus/runit/run
+++ b/templates/prometheus/runit/run
@@ -2,4 +2,5 @@
exec {{prometheus_home_dir}}/prometheus/prometheus \
--config.file "{{prometheus_home_dir}}/conf/prometheus.yml" \
--storage.tsdb.path "{{prometheus_data_dir}}" \
+ --storage.tsdb.retention.time "{{prometheus_retention_time}}" \
--web.listen-address "{{prometheus_ui_listen}}"