From a4f74014088b86d1507dd998e77aa9dcafa9ca00 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Fri, 26 Feb 2021 13:24:08 +0100 Subject: [PATCH 1/4] Create wizard file for the DMS package --- setup-wizard.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 setup-wizard.yml diff --git a/setup-wizard.yml b/setup-wizard.yml new file mode 100644 index 0000000..81a0be1 --- /dev/null +++ b/setup-wizard.yml @@ -0,0 +1,14 @@ +version: "2" +fields: + - id: log-retention-time + target: + type: environment + name: RETENTION + service: prometheus + title: Log Retention Time + description: >- + Define how much time the logs/data of your applications will be stored. By default, this time is set up to 15 days. + Take care of using a big number because the logs can occupy so much disk space. The unit measure is days. So if you define 30, the retention time will be 30 days. + pattern: "^[0-9]*$" + patternErrorMessage: "The input must contain only numbers." + required: false From fddd7b76c8a5625c5d919feed468da05aef1baa3 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Fri, 26 Feb 2021 13:25:53 +0100 Subject: [PATCH 2/4] Define the environment variable on the dockerfile --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index d6da5fc..77996cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,8 @@ services: volumes: - "prometheus_data:/prometheus" - "prometheus_file_sd:/prometheus_file_sd" + environment: + RETENTION: 15 manager: build: ./manager image: "manager.dms.dnp.dappnode.eth:1.0.1" From 3b9d65cf72fa160001f471f34068e8135f3d68e0 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Fri, 26 Feb 2021 13:26:53 +0100 Subject: [PATCH 3/4] Override Entrypoint of the prometheus dockerfile --- prometheus/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prometheus/Dockerfile b/prometheus/Dockerfile index e2828e4..e56da09 100644 --- a/prometheus/Dockerfile +++ b/prometheus/Dockerfile @@ -1,3 +1,8 @@ FROM prom/prometheus COPY prometheus.yml /etc/prometheus/ + +ENTRYPOINT [ "sh","-c","/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \ + --storage.tsdb.path=/prometheus \ + --web.console.libraries=/usr/share/prometheus/console_libraries \ + --storage.tsdb.retention.time=${RETENTION}d" ] From 53b01c556d8f6a6083f269fd3ef3621c525a4655 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Thu, 11 Mar 2021 18:16:21 +0100 Subject: [PATCH 4/4] Fix the env variable name --- docker-compose.yml | 2 +- prometheus/Dockerfile | 2 +- setup-wizard.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 77996cc..60cc496 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: - "prometheus_data:/prometheus" - "prometheus_file_sd:/prometheus_file_sd" environment: - RETENTION: 15 + DATA_RETENTION_DAYS: 15 manager: build: ./manager image: "manager.dms.dnp.dappnode.eth:1.0.1" diff --git a/prometheus/Dockerfile b/prometheus/Dockerfile index e56da09..e90c4d9 100644 --- a/prometheus/Dockerfile +++ b/prometheus/Dockerfile @@ -5,4 +5,4 @@ COPY prometheus.yml /etc/prometheus/ ENTRYPOINT [ "sh","-c","/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \ --storage.tsdb.path=/prometheus \ --web.console.libraries=/usr/share/prometheus/console_libraries \ - --storage.tsdb.retention.time=${RETENTION}d" ] + --storage.tsdb.retention.time=${DATA_RETENTION_DAYS}d" ] diff --git a/setup-wizard.yml b/setup-wizard.yml index 81a0be1..40343d2 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -3,7 +3,7 @@ fields: - id: log-retention-time target: type: environment - name: RETENTION + name: DATA_RETENTION_DAYS service: prometheus title: Log Retention Time description: >-