storage is better dir name than runtime

This commit is contained in:
Girish Ramakrishnan 2023-07-11 19:15:18 +05:30
parent c35bfa6977
commit e7c9398ecc
2 changed files with 7 additions and 3 deletions

View file

@ -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"

View file

@ -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"