diff options
Diffstat (limited to 'app-metrics/uwsgi_exporter/files')
4 files changed, 58 insertions, 0 deletions
diff --git a/app-metrics/uwsgi_exporter/files/uwsgi_exporter.confd b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.confd new file mode 100644 index 000000000000..6db54fb3cc0e --- /dev/null +++ b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.confd @@ -0,0 +1,16 @@ +# --web.listen-address=":9117" +# Address on which to expose metrics and web interfaces. +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --stats.uri="" URI for accessing uwsgi stats. +# --stats.timeout=5s Timeout for trying to get stats from uwsgi. +# --collect.cores Collect cores information per uwsgi worker. +# --log.level="info" Only log messages with the given severity or above. +# Valid levels: [debug, info, warn, error, fatal] +# --log.format="logger:stderr" +# Set the log target and format. Example: +# "logger:syslog?appname=bob&local=7" or +# "logger:stdout?json=true" +# --version Show application version. + +#command_args="--web.listen-address=:9117 --stats.uri=http://localhost:1717" diff --git a/app-metrics/uwsgi_exporter/files/uwsgi_exporter.initd b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.initd new file mode 100644 index 000000000000..b456a0b10505 --- /dev/null +++ b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2016-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="uWSGI metrics exporter for prometheus.io" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/uwsgi_exporter" +command_args="${command_args:---web.listen-address=:9117 --stats.uri=http://localhost:1717}" +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() { + after net +} diff --git a/app-metrics/uwsgi_exporter/files/uwsgi_exporter.logrotated b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.logrotated new file mode 100644 index 000000000000..ea6820d6ca4a --- /dev/null +++ b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.logrotated @@ -0,0 +1,7 @@ +/var/log/uwsgi_exporter/uwsgi_exporter.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-metrics/uwsgi_exporter/files/uwsgi_exporter.service b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.service new file mode 100644 index 000000000000..229a1f397fe5 --- /dev/null +++ b/app-metrics/uwsgi_exporter/files/uwsgi_exporter.service @@ -0,0 +1,16 @@ +[Unit] +Description=uWSGI metrics exporter for prometheus.io +Documentation=https://github.com/timonwong/uwsgi_exporter/ +After=network-online.target + +[Service] +User=uwsgi_exporter +Restart=on-failure +Environment=UWSGI_EXPORTER_ARGS="--web.listen-address=:9117 --stats.uri=http://localhost:1717" +ExecStart=/usr/bin/uwsgi_exporter $UWSGI_EXPORTER_ARGS +ExecReload=/bin/kill -HUP $MAINPID +TimeoutStopSec=20s +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target |