]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: support prometheus storage.tsdb.retention.time parameter
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 30 Mar 2021 07:49:10 +0000 (09:49 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 2 Apr 2021 11:17:59 +0000 (13:17 +0200)
This commit adds the parameter `--storage.tsdb.retention.time` to the
prometheus systemd unit template.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1928000
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit b60c61ce450db5b755744c491b4dfd1ce70fb124)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-prometheus/templates/prometheus.service.j2

index b515a258ad669779ab4b6527794a5cd6aa94e718..07373efea38144b4fe394b58952bed69bd2ee69a 100644 (file)
@@ -800,6 +800,10 @@ dummy:
 #prometheus_conf_dir: /etc/prometheus
 #prometheus_user_id: '65534'  # This is the UID used by the prom/prometheus container image
 #prometheus_port: 9092
+#prometheus_conf_overrides: {}
+# Uncomment out this variable if you need to customize the retention period for prometheus storage.
+# set it to '30d' if you want to retain 30 days of data.
+#prometheus_storage_tsdb_retention_time: 15d
 #alertmanager_container_image: "prom/alertmanager:v0.16.2"
 #alertmanager_container_cpu_period: 100000
 #alertmanager_container_cpu_cores: 2
index 020b06cd49a9b7bc08abe5795ebcdda23d9325e6..c2146ba1489d3c9d4e59fb3617047ad22e9d9f5a 100644 (file)
@@ -800,6 +800,10 @@ prometheus_container_image: registry.redhat.io/openshift4/ose-prometheus:v4.6
 #prometheus_conf_dir: /etc/prometheus
 #prometheus_user_id: '65534'  # This is the UID used by the prom/prometheus container image
 #prometheus_port: 9092
+#prometheus_conf_overrides: {}
+# Uncomment out this variable if you need to customize the retention period for prometheus storage.
+# set it to '30d' if you want to retain 30 days of data.
+#prometheus_storage_tsdb_retention_time: 15d
 alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.6
 #alertmanager_container_cpu_period: 100000
 #alertmanager_container_cpu_cores: 2
index 6d23f54c4be3c214d2b65faffb520fd3036b093d..fbeab3d8094f0fa2fa7de12efa41ed362ef5a676 100644 (file)
@@ -792,6 +792,10 @@ prometheus_data_dir: /var/lib/prometheus
 prometheus_conf_dir: /etc/prometheus
 prometheus_user_id: '65534'  # This is the UID used by the prom/prometheus container image
 prometheus_port: 9092
+prometheus_conf_overrides: {}
+# Uncomment out this variable if you need to customize the retention period for prometheus storage.
+# set it to '30d' if you want to retain 30 days of data.
+#prometheus_storage_tsdb_retention_time: 15d
 alertmanager_container_image: "prom/alertmanager:v0.16.2"
 alertmanager_container_cpu_period: 100000
 alertmanager_container_cpu_cores: 2
index 601f19a1db9b4f85749c14d2a2f4f332142bd922..3f2ed5602af483df1e3286bdc656113ea8a75167 100644 (file)
@@ -31,6 +31,9 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name=prometheus \
   {{ prometheus_container_image }} \
   --config.file=/etc/prometheus/prometheus.yml \
   --storage.tsdb.path=/prometheus \
+{% if prometheus_storage_tsdb_retention_time is defined %}
+  --storage.tsdb.retention.time={{ prometheus_storage_tsdb_retention_time }} \
+{% endif %}
   --web.external-url=http://{{ ansible_facts['fqdn'] }}:{{ prometheus_port }}/ \
   --web.listen-address={{ grafana_server_addr }}:{{ prometheus_port }}
 {% if container_binary == 'podman' %}