prometheus: add a new variable to add arbitrary options to the command line.

This commit is contained in:
Andrea Dell'Amico 2018-01-11 18:45:09 +01:00
parent ea729161be
commit b2ae79e61f
3 changed files with 4 additions and 1 deletions

View File

@ -11,3 +11,4 @@ prometheus_confdir: '/opt/prometheus/conf'
prometheus_cmd: '{{ prometheus_dist_dir }}/{{ prometheus_dir }}/prometheus'
prometheus_loglevel: info
prometheus_http_port: 9090
prometheus_opts: '--storage.tsdb.retention=120d'

View File

@ -15,6 +15,7 @@ script
export PROMETHEUS_DATADIR
export PROMETHEUS_LOGLEVEL
export PROMETHEUS_CONF
exec $PROMETHEUS_CMD --config.file=$PROMETHEUS_CONF --storage.tsdb.path="$PROMETHEUS_DATADIR" --log.level=$PROMETHEUS_LOGLEVEL > $PROMETHEUS_LOGDIR/prometheus.log 2>&1
export PROMETHEUS_OPTS
exec $PROMETHEUS_CMD --config.file=$PROMETHEUS_CONF --storage.tsdb.path="$PROMETHEUS_DATADIR" --log.level=$PROMETHEUS_LOGLEVEL $PROMETHEUS_OPTS > $PROMETHEUS_LOGDIR/prometheus.log 2>&1
end script

View File

@ -4,5 +4,6 @@ PROMETHEUS_LOGDIR={{ prometheus_home }}/logs
PROMETHEUS_DATADIR={{ prometheus_home }}/data
PROMETHEUS_LOGLEVEL={{ prometheus_loglevel }}
PROMETHEUS_CONF={{ prometheus_confdir }}/prometheus.yml
PROMETHEUS_OPTS="{{ prometheus_opts }}"