summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2018-03-27 13:11:32 +0200
committerManuel Rüger <mrueg@gentoo.org>2018-03-27 13:11:32 +0200
commit69e46dc76012b866bc91bd92649abc27e53f9075 (patch)
treec799525a1841fbaf629b05ff81080611bf1c151e /app-metrics/nginx-vts-exporter
parentsys-cluster/kube-proxy: Remove old (diff)
downloadgentoo-69e46dc76012b866bc91bd92649abc27e53f9075.tar.gz
gentoo-69e46dc76012b866bc91bd92649abc27e53f9075.tar.bz2
gentoo-69e46dc76012b866bc91bd92649abc27e53f9075.zip
app-metrics/nginx-vts-exporter: Move package from app-admin/nginx-vts-exporter
Diffstat (limited to 'app-metrics/nginx-vts-exporter')
-rw-r--r--app-metrics/nginx-vts-exporter/Manifest1
-rw-r--r--app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.confd2
-rw-r--r--app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.initd19
-rw-r--r--app-metrics/nginx-vts-exporter/metadata.xml11
-rw-r--r--app-metrics/nginx-vts-exporter/nginx-vts-exporter-0.10.0.ebuild47
5 files changed, 80 insertions, 0 deletions
diff --git a/app-metrics/nginx-vts-exporter/Manifest b/app-metrics/nginx-vts-exporter/Manifest
new file mode 100644
index 000000000000..e6c23304897f
--- /dev/null
+++ b/app-metrics/nginx-vts-exporter/Manifest
@@ -0,0 +1 @@
+DIST nginx-vts-exporter-0.10.0.tar.gz 149620 BLAKE2B 6856240886d1a7082c901535954193798e8636ef744a5960441726cb12a5510706f7b8c1757e9f719c756d0beabc355cde8ec626c9bd4f14f7ff84894d0cc6da SHA512 bdd3993b3fee24d3332db720df2880493eeb0724cd5b099ccdd5fe6456df1b344132e4e585271999df355fb2042954cb3d452e6dc0b92dead288e94dd71f627c
diff --git a/app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.confd b/app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.confd
new file mode 100644
index 000000000000..ae134353a235
--- /dev/null
+++ b/app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.confd
@@ -0,0 +1,2 @@
+# arguments for prometheus nginx virtual host traffic stats exporter
+command_args="-nginx.scrape_uri=http://localhost/status/format/json"
diff --git a/app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.initd b/app-metrics/nginx-vts-exporter/files/nginx-vts-exporter.initd
new file mode 100644
index 000000000000..f61549b061d7
--- /dev/null
+++ b/app-metrics/nginx-vts-exporter/files/nginx-vts-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="Prometheus nginx virtual host traffic status exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/nginx-vts-exporter"
+command_args="${command_args:--nginx.scrape_uri=http://localhost/status/format/json}"
+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/nginx-vts-exporter/metadata.xml b/app-metrics/nginx-vts-exporter/metadata.xml
new file mode 100644
index 000000000000..0baff3eb9512
--- /dev/null
+++ b/app-metrics/nginx-vts-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>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">hnlq715/nginx-vts-exporter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-metrics/nginx-vts-exporter/nginx-vts-exporter-0.10.0.ebuild b/app-metrics/nginx-vts-exporter/nginx-vts-exporter-0.10.0.ebuild
new file mode 100644
index 000000000000..761f9630f63c
--- /dev/null
+++ b/app-metrics/nginx-vts-exporter/nginx-vts-exporter-0.10.0.ebuild
@@ -0,0 +1,47 @@
+# 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
+
+EGO_PN="github.com/hnlq715/nginx-vts-exporter"
+EXPORTER_COMMIT="f5b3491cd0a8cc2df7088470f2727b0ae39a2700"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Nginx virtual host traffic stats exporter for Prometheus"
+HOMEPAGE="https://github.com/hnlq715/nginx-vts-exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ sed -i -e "/-s$/d" -e "s/{{.Revision}}/${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/${PN}
+ dodoc README.md
+ popd || die
+ keepdir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}