summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2023-03-26 14:56:34 -0500
committerWilliam Hubbs <williamh@gentoo.org>2023-03-26 14:56:34 -0500
commitdeaa246528cb25b6ffbbea25849d9fb3ab3c03b7 (patch)
treee5f60a0364e23d45b28a5ad8338893ff0863b0f4 /app-metrics/prometheus
parentapp-metrics/prometheus: drop 2.37.5 (diff)
downloadgentoo-deaa246528cb25b6ffbbea25849d9fb3ab3c03b7.tar.gz
gentoo-deaa246528cb25b6ffbbea25849d9fb3ab3c03b7.tar.bz2
gentoo-deaa246528cb25b6ffbbea25849d9fb3ab3c03b7.zip
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>
Diffstat (limited to 'app-metrics/prometheus')
-rw-r--r--app-metrics/prometheus/files/prometheus.confd28
-rw-r--r--app-metrics/prometheus/files/prometheus.initd12
-rw-r--r--app-metrics/prometheus/prometheus-2.43.0-r1.ebuild (renamed from app-metrics/prometheus/prometheus-2.43.0.ebuild)0
3 files changed, 38 insertions, 2 deletions
diff --git a/app-metrics/prometheus/files/prometheus.confd b/app-metrics/prometheus/files/prometheus.confd
index 93b41b31624c..19a286f5677a 100644
--- a/app-metrics/prometheus/files/prometheus.confd
+++ b/app-metrics/prometheus/files/prometheus.confd
@@ -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=""
diff --git a/app-metrics/prometheus/files/prometheus.initd b/app-metrics/prometheus/files/prometheus.initd
index f7371f8ca060..dc5db03ad5ea 100644
--- a/app-metrics/prometheus/files/prometheus.initd
+++ b/app-metrics/prometheus/files/prometheus.initd
@@ -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
diff --git a/app-metrics/prometheus/prometheus-2.43.0.ebuild b/app-metrics/prometheus/prometheus-2.43.0-r1.ebuild
index db5a914685b6..db5a914685b6 100644
--- a/app-metrics/prometheus/prometheus-2.43.0.ebuild
+++ b/app-metrics/prometheus/prometheus-2.43.0-r1.ebuild