summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2018-03-30 19:02:16 +0200
committerManuel Rüger <mrueg@gentoo.org>2018-03-30 19:02:16 +0200
commitb161af0782fba4250a93e74cd580bd0fc582c0bc (patch)
tree4d2ffc0e66c6b6a0ba0782a0138441155c460a42 /app-metrics/uwsgi_exporter
parentapp-metrics/redis_exporter: Move package from net-analyzer/prometheus-redis_e... (diff)
downloadgentoo-b161af0782fba4250a93e74cd580bd0fc582c0bc.tar.gz
gentoo-b161af0782fba4250a93e74cd580bd0fc582c0bc.tar.bz2
gentoo-b161af0782fba4250a93e74cd580bd0fc582c0bc.zip
app-metrics/uwsgi_exporter: Move package from net-analyzer/prometheus-uwsgi_exporter
Diffstat (limited to 'app-metrics/uwsgi_exporter')
-rw-r--r--app-metrics/uwsgi_exporter/Manifest1
-rw-r--r--app-metrics/uwsgi_exporter/files/uwsgi_exporter.confd16
-rw-r--r--app-metrics/uwsgi_exporter/files/uwsgi_exporter.initd19
-rw-r--r--app-metrics/uwsgi_exporter/files/uwsgi_exporter.logrotated7
-rw-r--r--app-metrics/uwsgi_exporter/files/uwsgi_exporter.service16
-rw-r--r--app-metrics/uwsgi_exporter/metadata.xml11
-rw-r--r--app-metrics/uwsgi_exporter/uwsgi_exporter-0.7.0.ebuild54
7 files changed, 124 insertions, 0 deletions
diff --git a/app-metrics/uwsgi_exporter/Manifest b/app-metrics/uwsgi_exporter/Manifest
new file mode 100644
index 000000000000..b4a5124da24d
--- /dev/null
+++ b/app-metrics/uwsgi_exporter/Manifest
@@ -0,0 +1 @@
+DIST uwsgi_exporter-0.7.0.tar.gz 3039893 BLAKE2B a6efdae7f9a19ad21a283b586b5667bd99456274ed419d1b64aaf4cdb4df1e1c4fb2a08edf6df2b15813d21311fe54c2f2394f0bf25ac11c49db8a924596da05 SHA512 380ef4515eaa81d4dee853682efa7a5e82af2ec00c096e7471028c9932d46e0a7406b75cb40f0f8efec15cd77b06c5477a07919d0b44720e3e194b5bb023b593
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
diff --git a/app-metrics/uwsgi_exporter/metadata.xml b/app-metrics/uwsgi_exporter/metadata.xml
new file mode 100644
index 000000000000..ba98a1a69cd7
--- /dev/null
+++ b/app-metrics/uwsgi_exporter/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zmedico@gentoo.org</email>
+ <name>Zac Medico</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">timonwong/uwsgi_exporter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-metrics/uwsgi_exporter/uwsgi_exporter-0.7.0.ebuild b/app-metrics/uwsgi_exporter/uwsgi_exporter-0.7.0.ebuild
new file mode 100644
index 000000000000..7c5dd6280d85
--- /dev/null
+++ b/app-metrics/uwsgi_exporter/uwsgi_exporter-0.7.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot systemd
+
+EGO_PN="github.com/timonwong/uwsgi_exporter"
+EGIT_COMMIT="v${PV/_rc/-rc.}"
+UWSGI_EXPORTER_COMMIT="20e35a9"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="uWSGI metrics exporter for prometheus.io"
+HOMEPAGE="https://github.com/timonwong/uwsgi_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${UWSGI_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ mkdir -p bin || die
+ GOPATH="${S}" promu build -v --prefix bin || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin bin/uwsgi_exporter
+ dodoc README.md
+ popd || die
+ local dir
+ for dir in /var/{lib,log}/${PN}; do
+ keepdir "${dir}"
+ fowners ${PN}:${PN} "${dir}"
+ done
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotated" "${PN}"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}