mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
app-metrics/prometheus: fix service script
Introduce the prometheus_args variable. Allow the continued use of command_args in the script for now to avoid breaking systems, but document that people should move to prometheus_args. Also, sync most of the defaults with the systemd service. Signed-off-by: William Hubbs <williamh@gentoo.org>
This commit is contained in:
@@ -1,2 +1,26 @@
|
||||
# arguments for Prometheus
|
||||
command_args=""
|
||||
# additional arguments for Prometheus
|
||||
#
|
||||
# command_args should not be set in this file. Instead, you should set
|
||||
# prometheus_args.
|
||||
#
|
||||
# The default settings are listed below.
|
||||
# If you are not changing these settings, you do
|
||||
# not need to include them in prometheus_args.
|
||||
#
|
||||
# To migrate from using command_args to prometheus_args, drop any of the
|
||||
# default settings below that you have set the same way then switch to
|
||||
# prometheus_args.
|
||||
#
|
||||
# The new behavior is that prometheus_args will be appended to these
|
||||
# defaults allowing anything you add to override them.
|
||||
#
|
||||
#The default settings are:
|
||||
#
|
||||
# --web.enable-lifecycle
|
||||
# --config.file=/etc/prometheus/prometheus.yml
|
||||
# --storage.tsdb.path=/var/lib/prometheus/data
|
||||
# --web.console.templates=/etc/prometheus/consoles
|
||||
# --web.console.libraries=/etc/prometheus/console_libraries
|
||||
# --web.enable-admin-api
|
||||
#
|
||||
prometheus_args=""
|
||||
|
||||
@@ -9,7 +9,19 @@ group=${group:-${RC_SVCNAME}}
|
||||
command_user=${user}:${group}
|
||||
|
||||
command="/usr/bin/prometheus"
|
||||
if [ -z "${command_args}" ]; then
|
||||
command_args="
|
||||
--web.enable-lifecycle
|
||||
--config.file=/etc/prometheus/prometheus.yml
|
||||
--storage.tsdb.path=/var/lib/prometheus/data
|
||||
--web.console.templates=/etc/prometheus/consoles
|
||||
--web.console.libraries=/etc/prometheus/console_libraries
|
||||
--web.listen-address=0.0.0.0:9090
|
||||
--web.enable-admin-api
|
||||
${prometheus_args}"
|
||||
else
|
||||
command_args="${command_args:---config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data}"
|
||||
fi
|
||||
command_background="true"
|
||||
error_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log
|
||||
output_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log
|
||||
|
||||
Reference in New Issue
Block a user