20889: Adds configurable data retention parameter for Prometheus.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 18:36:27 +0000 (15:36 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 18:36:27 +0000 (15:36 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/config_examples/multi_host/aws/pillars/prometheus_server.sls
tools/salt-install/local.params.example.multiple_hosts
tools/salt-install/provision.sh

index 9952e3bbc440653f1d6c8791a12fac9f3c4a76c4..70320d610caec46d466714b1a6ab1a4f8b8f3e9e 100644 (file)
@@ -5,6 +5,7 @@
 
 {%- set controller_nodes = "__CONTROLLER_NODES__".split(',') %}
 {%- set enable_balancer = ("__ENABLE_BALANCER__"|to_bool) %}
+{%- set data_retention_time = "__PROMETHEUS_DATA_RETENTION_TIME__" %}
 
 ### PROMETHEUS
 prometheus:
@@ -18,6 +19,9 @@ prometheus:
     use_upstream_archive: true
     component:
       prometheus:
+        service:
+           args:
+             storage.tsdb.retention.time: {{ data_retention_time }}
         config:
           global:
             scrape_interval: 15s
index 5d4ebdc1d57f1f92e6d3aad836d6cf863f4a3d45..26cd16ed574b5264b62ad33e3cfe3bcbb8fda87f 100644 (file)
@@ -89,9 +89,14 @@ SSL_KEY_AWS_REGION="${AWS_REGION}"
 # Customize Prometheus & Grafana web UI access credentials
 MONITORING_USERNAME=${INITIAL_USER}
 MONITORING_EMAIL=${INITIAL_USER_EMAIL}
+
 # Sets the directory for Grafana dashboards
 # GRAFANA_DASHBOARDS_DIR="${SCRIPT_DIR}/local_config_dir/dashboards"
 
+# Sets the amount of data (expressed in time) Prometheus keeps on its
+# time-series database. Default is 15 days.
+# PROMETHEUS_DATA_RETENTION_TIME="180d"
+
 # The mapping of nodes to roles
 # installer.sh will log in to each of these nodes and then provision
 # it for the specified roles.
index 5dd40dd76c467c132624f514a1b8da2e797e633b..3a5662bedabd34ea6aaaaff47928d02bc2da7def 100755 (executable)
@@ -211,6 +211,7 @@ apply_var_substitutions() {
        s#__DISABLED_CONTROLLER__#${DISABLED_CONTROLLER}#g;
        s#__BALANCER_NODENAME__#${ROLE2NODES['balancer']:-}#g;
        s#__PROMETHEUS_NODENAME__#${ROLE2NODES['monitoring']:-}#g;
+       s#__PROMETHEUS_DATA_RETENTION_TIME__#${PROMETHEUS_DATA_RETENTION_TIME:-15d}#g;
        s#__CONTROLLER_NODES__#${ROLE2NODES['controller']:-}#g;
        s#__NODELIST__#${NODELIST}#g;
        s#__DISPATCHER_INT_IP__#${DISPATCHER_INT_IP}#g;