diff --git a/docker-compose.template.yml b/docker-compose.template.yml index 545a8db863..8afc29768d 100644 --- a/docker-compose.template.yml +++ b/docker-compose.template.yml @@ -47,9 +47,6 @@ services: - ${LOKI_WALL_DIR}:/wal:z #LOKI_DIR promotheus: - command: - - --config.file=/etc/prometheus/prometheus.yml - - --web.enable-lifecycle #PROMETHEUS_COMMAND_LINE #GENERAL_DOCER_CONFIG #PROMETHEUS_USER_PERMISSIONS diff --git a/docs/source/install/start-all.rst b/docs/source/install/start-all.rst index 4407b5495c..f270d092fd 100644 --- a/docs/source/install/start-all.rst +++ b/docs/source/install/start-all.rst @@ -23,6 +23,8 @@ You cannot use port mapping when using the ``-l`` flag **--auto-restart** When set, Docker will automatically restart all the services inside the containers in case of a failure. +**--compose** This is an experimental option. When set, it initiates a two-stage process. Firstly, a ``docker-compose.yml`` file is created along with an ``.env`` file. Following this, the script executes ``docker-compose up``. Please note that having docker-compose is a prerequisite. + Grafana Related Commands ------------------------ diff --git a/make-compose.sh b/make-compose.sh index 430f48b8bd..6b04cf8849 100755 --- a/make-compose.sh +++ b/make-compose.sh @@ -413,7 +413,7 @@ while getopts ':hleEd:g:p:v:s:n:a:c:j:b:m:r:R:M:G:D:L:N:C:Q:A:f:P:S:T:k:' option if [ ! -d $LOKI_DIR ]; then mkdir -p $LOKI_DIR fi - LOKI_DIR="-v $LOKI_DIR:/tmp/loki:z" + LOKI_DIR="- $LOKI_DIR:/tmp/loki:z" ;; :) printf "missing argument for -%s\n" "$OPTARG" >&2 echo "$usage" >&2 @@ -572,9 +572,19 @@ echo "LOKI_CONF_DIR=$LOKI_CONF_DIR">> .env echo "LOKI_DIR=$LOKI_DIR">> .env echo "LOKI_PORT=$LOKI_PORT">> .env echo "LOKI_WALL_DIR=$LOKI_WALL_DIR">> .env +if [ "$VICTORIA_METRICS" = "1" ]; then + sed -i 's&prom/prometheus:${PROMETHEUS_VERSION}&victoriametrics/victoria-metrics:${VICTORIA_METRICS_VERSION}&' docker-compose.yml + sed -i 's&./prometheus/build/prometheus.yml:/etc/prometheus/prometheus.yml&./prometheus/build/prometheus.yml:/etc/promscrape.config.yml:z&' docker-compose.yml + PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY+=( -promscrape.config=/etc/promscrape.config.yml -promscrape.config.strictParse=false -httpListenAddr=:9090) +else + PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY+=(--config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle) +fi +PROMETHEUS_COMMAND_LINE="" +if (( ${#PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]} )); then + PROMETHEUS_COMMAND_LINE=" command:\n"`add_param "${PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]}"` +fi -val=`add_param "${PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]}"` -sed -i "s/ *#PROMETHEUS_COMMAND_LINE/$val/" docker-compose.yml +sed -i "s& *#PROMETHEUS_COMMAND_LINE&$PROMETHEUS_COMMAND_LINE&" docker-compose.yml val=`add_param "${PROMETHEUS_PROMETHEUS_VOLUMES_ARRAY[@]}"` sed -i "s& *#PROMETHEUS_VOLUMES&$val&" docker-compose.yml