summaryrefslogtreecommitdiff
path: root/net-analyzer/prometheus-pushgateway/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/prometheus-pushgateway/files')
-rw-r--r--net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd14
-rw-r--r--net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd19
-rw-r--r--net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated7
-rw-r--r--net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service16
4 files changed, 56 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd
new file mode 100644
index 000000000000..de9ef483723f
--- /dev/null
+++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd
@@ -0,0 +1,14 @@
+# -log.format value
+# If set use a syslog logger or JSON logging. Example: logger:syslog?appname=bob&local=7 or logger:stdout?json=true. Defaults to stderr.
+# -log.level value
+# Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal].
+# -persistence.file string
+# File to persist metrics. If empty, metrics are only kept in memory.
+# -persistence.interval duration
+# The minimum interval at which to write out the persistence file. (default 5m0s)
+# -web.listen-address string
+# Address to listen on for the web interface, API, and telemetry. (default ":9091")
+# -web.telemetry-path string
+# Path under which to expose metrics. (default "/metrics")
+
+#command_args="-web.listen-address localhost:9091 -persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob"
diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd
new file mode 100644
index 000000000000..a187e57897ed
--- /dev/null
+++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus push acceptor for ephemeral and batch jobs"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/pushgateway"
+command_args="${command_args:--web.listen-address localhost:9091 -persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
+ --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+
+depend() {
+ need net
+}
diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated
new file mode 100644
index 000000000000..3645c9be1762
--- /dev/null
+++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated
@@ -0,0 +1,7 @@
+/var/log/prometheus-pushgateway/prometheus-pushgateway.log {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service
new file mode 100644
index 000000000000..4377850f2c5c
--- /dev/null
+++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Prometheus exporter for ephemereal jobs
+Documentation=https://prometheus.io/docs/instrumenting/pushing/
+After=network-online.target
+
+[Service]
+User=prometheus-pushgateway
+Restart=on-failure
+Environment=PUSHGATEWAY_ARGS="-web.listen-address localhost:9091 --persistence.file=/var/lib/prometheus-pushgateway/persistence.gob"
+ExecStart=/usr/bin/pushgateway $PUSHGATEWAY_ARGS
+ExecReload=/bin/kill -HUP $MAINPID
+TimeoutStopSec=20s
+SendSIGKILL=no
+
+[Install]
+WantedBy=multi-user.target