summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-03-14 17:51:34 -0700
committerZac Medico <zmedico@gentoo.org>2018-03-14 17:55:00 -0700
commitbf56188b53f889093ae3c99cb0a43a0a0ddae3f9 (patch)
treea3808234d19d8cf1b724382cae815fe5af329e63 /net-analyzer
parentdev-perl/Test-UseAllModules: EAPI6 + tests (diff)
downloadgentoo-bf56188b53f889093ae3c99cb0a43a0a0ddae3f9.tar.gz
gentoo-bf56188b53f889093ae3c99cb0a43a0a0ddae3f9.tar.bz2
gentoo-bf56188b53f889093ae3c99cb0a43a0a0ddae3f9.zip
net-analyzer/prometheus-uwsgi_exporter: new package
Package-Manager: Portage-2.3.24, Repoman-2.3.6
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/Manifest1
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.confd16
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.initd19
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.logrotated7
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.service16
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/metadata.xml11
-rw-r--r--net-analyzer/prometheus-uwsgi_exporter/prometheus-uwsgi_exporter-0.7.0.ebuild54
7 files changed, 124 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-uwsgi_exporter/Manifest b/net-analyzer/prometheus-uwsgi_exporter/Manifest
new file mode 100644
index 00000000000..63942cda2bb
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/Manifest
@@ -0,0 +1 @@
+DIST prometheus-uwsgi_exporter-0.7.0.tar.gz 3039893 BLAKE2B a6efdae7f9a19ad21a283b586b5667bd99456274ed419d1b64aaf4cdb4df1e1c4fb2a08edf6df2b15813d21311fe54c2f2394f0bf25ac11c49db8a924596da05 SHA512 380ef4515eaa81d4dee853682efa7a5e82af2ec00c096e7471028c9932d46e0a7406b75cb40f0f8efec15cd77b06c5477a07919d0b44720e3e194b5bb023b593
diff --git a/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.confd b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.confd
new file mode 100644
index 00000000000..6db54fb3cc0
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-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/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.initd b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.initd
new file mode 100644
index 00000000000..b456a0b1050
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-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/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.logrotated b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.logrotated
new file mode 100644
index 00000000000..8703cb2be38
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.logrotated
@@ -0,0 +1,7 @@
+/var/log/prometheus-uwsgi_exporter/prometheus-uwsgi_exporter.log {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.service b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-uwsgi_exporter.service
new file mode 100644
index 00000000000..39824c7efe7
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/files/prometheus-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=prometheus-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/net-analyzer/prometheus-uwsgi_exporter/metadata.xml b/net-analyzer/prometheus-uwsgi_exporter/metadata.xml
new file mode 100644
index 00000000000..ba98a1a69cd
--- /dev/null
+++ b/net-analyzer/prometheus-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/net-analyzer/prometheus-uwsgi_exporter/prometheus-uwsgi_exporter-0.7.0.ebuild b/net-analyzer/prometheus-uwsgi_exporter/prometheus-uwsgi_exporter-0.7.0.ebuild
new file mode 100644
index 00000000000..26946cce453
--- /dev/null
+++ b/net-analyzer/prometheus-uwsgi_exporter/prometheus-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 uwsgi_exporter || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin uwsgi_exporter/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"
+}