summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-03-14 19:15:22 -0700
committerZac Medico <zmedico@gentoo.org>2018-03-14 19:22:35 -0700
commit91fa43ef348cec7e91751f4fe05dc3ec280750c5 (patch)
tree49f8059a6bb55d570bcfe042ecf9566b6094e272
parentsys-fs/eudev-3.2.5: arm64 stable (bug #645280) (diff)
downloadgentoo-91fa43ef.tar.gz
gentoo-91fa43ef.tar.bz2
gentoo-91fa43ef.zip
net-analyzer/prometheus-redis_exporter: new package
Package-Manager: Portage-2.3.24, Repoman-2.3.6
-rw-r--r--net-analyzer/prometheus-redis_exporter/Manifest1
-rw-r--r--net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.confd30
-rw-r--r--net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.initd19
-rw-r--r--net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.logrotated7
-rw-r--r--net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.service16
-rw-r--r--net-analyzer/prometheus-redis_exporter/metadata.xml11
-rw-r--r--net-analyzer/prometheus-redis_exporter/prometheus-redis_exporter-0.15.0.ebuild52
7 files changed, 136 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-redis_exporter/Manifest b/net-analyzer/prometheus-redis_exporter/Manifest
new file mode 100644
index 000000000000..1cdcc45ab031
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/Manifest
@@ -0,0 +1 @@
+DIST prometheus-redis_exporter-0.15.0.tar.gz 1232990 BLAKE2B ade899ef0f21594d3bb59c379f44d941e2a42f06a5c2ba5b304cc0b8b83def12eb036e6011a7d88abe7d97104ae663cb025ca60287ec9aba7be93a734d84c959 SHA512 8892306500943ec18d8fa5110fc6f4954ec886fca4d0023cdc2134ee2498c6f39ab06bec8f998ecde796cc2053b66103146503b76a185db3da5cbab81ebd9f2a
diff --git a/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.confd b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.confd
new file mode 100644
index 000000000000..8573aef35405
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.confd
@@ -0,0 +1,30 @@
+# -check-keys string
+# Comma separated list of keys to export value and length/size
+# -debug
+# Output verbose debug information
+# -log-format string
+# Log format, valid options are txt and json (default "txt")
+# -namespace string
+# Namespace for metrics (default "redis")
+# -redis-only-metrics
+# Whether to export go runtime metrics also
+# -redis.addr string
+# Address of one or more redis nodes, separated by separator
+# -redis.alias string
+# Redis instance alias for one or more redis nodes, separated by separator
+# -redis.file string
+# Path to file containing one or more redis nodes, separated by newline. NOTE: mutually exclusive with redis.addr
+# -redis.password string
+# Password for one or more redis nodes, separated by separator
+# -separator string
+# separator used to split redis.addr, redis.password and redis.alias into several elements. (default ",")
+# -use-cf-bindings
+# Use Cloud Foundry service bindings
+# -version
+# Show version information and exit
+# -web.listen-address string
+# Address to listen on for web interface and telemetry. (default ":9121")
+# -web.telemetry-path string
+# Path under which to expose metrics. (default "/metrics")
+
+#command_args="--web.listen-address=:9121 --redis.addr=localhost:6379"
diff --git a/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.initd b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.initd
new file mode 100644
index 000000000000..741a0b4e4682
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_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 Exporter for Redis Metrics"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/redis_exporter"
+command_args="${command_args:---web.listen-address=:9121 --redis.addr=localhost:6379}"
+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-redis_exporter/files/prometheus-redis_exporter.logrotated b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.logrotated
new file mode 100644
index 000000000000..b1252b3d13f4
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.logrotated
@@ -0,0 +1,7 @@
+/var/log/prometheus-redis_exporter/prometheus-redis_exporter.log {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.service b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.service
new file mode 100644
index 000000000000..9d2ba756a261
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/files/prometheus-redis_exporter.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Prometheus Exporter for Redis Metrics
+Documentation=https://github.com/oliver006/redis_exporter/
+After=network-online.target
+
+[Service]
+User=prometheus-redis_exporter
+Restart=on-failure
+Environment=REDIS_EXPORTER_ARGS="--web.listen-address=:9121 --redis.addr=localhost:6379"
+ExecStart=/usr/bin/redis_exporter $REDIS_EXPORTER_ARGS
+ExecReload=/bin/kill -HUP $MAINPID
+TimeoutStopSec=20s
+SendSIGKILL=no
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-analyzer/prometheus-redis_exporter/metadata.xml b/net-analyzer/prometheus-redis_exporter/metadata.xml
new file mode 100644
index 000000000000..ad438766d9bb
--- /dev/null
+++ b/net-analyzer/prometheus-redis_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">oliver006/redis_exporter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/prometheus-redis_exporter/prometheus-redis_exporter-0.15.0.ebuild b/net-analyzer/prometheus-redis_exporter/prometheus-redis_exporter-0.15.0.ebuild
new file mode 100644
index 000000000000..05ca8dce7104
--- /dev/null
+++ b/net-analyzer/prometheus-redis_exporter/prometheus-redis_exporter-0.15.0.ebuild
@@ -0,0 +1,52 @@
+# 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/oliver006/redis_exporter"
+EGIT_COMMIT="a0d9e4c704b4d35cd08544d395038f417716a03a"
+ARCHIVE_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x and 4.x"
+HOMEPAGE="https://github.com/oliver006/redis_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ sed -e "s|\(^[[:space:]]*VERSION[[:space:]]*=[[:space:]]*\).*|\1\"${PV}\"|" \
+ -e "s|\(^[[:space:]]*BUILD_DATE[[:space:]]*=[[:space:]]*\).*|\1\"$(LC_ALL=C date -u)\"|" \
+ -e "s|\(^[[:space:]]*COMMIT_SHA1[[:space:]]*=[[:space:]]*\).*|\1\"${EGIT_COMMIT}\"|" \
+ -i src/${EGO_PN}/main.go || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ GOPATH="${S}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
+ popd || die
+}
+
+src_install() {
+ dobin bin/redis_exporter
+ dodoc src/${EGO_PN}/README.md
+ 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"
+}