From e7c9398eccc6c51597f0d32c0d15b695362f4f58 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 11 Jul 2023 19:15:18 +0530 Subject: [PATCH] storage is better dir name than runtime --- env.sh.template | 3 ++- start.sh | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/env.sh.template b/env.sh.template index d9248ba..9ccdb73 100755 --- a/env.sh.template +++ b/env.sh.template @@ -3,4 +3,5 @@ # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects export retention_time="15d" -export cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/runtime" +# edit this variable for various startup options +export cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/storage" diff --git a/start.sh b/start.sh index 2e8f32b..47e5cc7 100755 --- a/start.sh +++ b/start.sh @@ -2,7 +2,10 @@ set -eu -mkdir -p /app/data/runtime /app/data/config +# migration remove in next release +[[ -d /app/data/runtime ]] && mv /app/data/runtime /app/data/storage + +mkdir -p /app/data/storage /app/data/config if [[ ! -f /app/data/config/prometheus.yml ]]; then echo "=> Creating config file on first run" @@ -20,7 +23,7 @@ fi # migration remove in next release if ! grep -q cli_option /app/data/env.sh; then - echo -e '\nexport cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/runtime"' >> /app/data/env.sh + echo -e '\nexport cli_options="--storage.tsdb.retention.time=$retention_time --storage.tsdb.path=/app/data/storage"' >> /app/data/env.sh fi echo "=> Source custom variables for cli args"