summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2018-03-30 18:58:06 +0200
committerManuel Rüger <mrueg@gentoo.org>2018-03-30 18:58:35 +0200
commit54feaa3e14b1fd1672a34addcabec757b75f9b80 (patch)
tree87eed94a0029bf43d679aec4eaa0e427f3257faa /app-metrics
parentdev-lang/php: Version bump for 7.1.16 (diff)
downloadgentoo-54feaa3e14b1fd1672a34addcabec757b75f9b80.tar.gz
gentoo-54feaa3e14b1fd1672a34addcabec757b75f9b80.tar.bz2
gentoo-54feaa3e14b1fd1672a34addcabec757b75f9b80.zip
app-metrics/redis_exporter: Move package from net-analyzer/prometheus-redis_exporter
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/redis_exporter/Manifest1
-rw-r--r--app-metrics/redis_exporter/files/redis_exporter.confd30
-rw-r--r--app-metrics/redis_exporter/files/redis_exporter.initd19
-rw-r--r--app-metrics/redis_exporter/files/redis_exporter.logrotated7
-rw-r--r--app-metrics/redis_exporter/files/redis_exporter.service16
-rw-r--r--app-metrics/redis_exporter/metadata.xml11
-rw-r--r--app-metrics/redis_exporter/redis_exporter-0.15.0.ebuild52
7 files changed, 136 insertions, 0 deletions
diff --git a/app-metrics/redis_exporter/Manifest b/app-metrics/redis_exporter/Manifest
new file mode 100644
index 000000000000..4e92a043cb3b
--- /dev/null
+++ b/app-metrics/redis_exporter/Manifest
@@ -0,0 +1 @@
+DIST redis_exporter-0.15.0.tar.gz 1232990 BLAKE2B ade899ef0f21594d3bb59c379f44d941e2a42f06a5c2ba5b304cc0b8b83def12eb036e6011a7d88abe7d97104ae663cb025ca60287ec9aba7be93a734d84c959 SHA512 8892306500943ec18d8fa5110fc6f4954ec886fca4d0023cdc2134ee2498c6f39ab06bec8f998ecde796cc2053b66103146503b76a185db3da5cbab81ebd9f2a
diff --git a/app-metrics/redis_exporter/files/redis_exporter.confd b/app-metrics/redis_exporter/files/redis_exporter.confd
new file mode 100644
index 000000000000..8573aef35405
--- /dev/null
+++ b/app-metrics/redis_exporter/files/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/app-metrics/redis_exporter/files/redis_exporter.initd b/app-metrics/redis_exporter/files/redis_exporter.initd
new file mode 100644
index 000000000000..741a0b4e4682
--- /dev/null
+++ b/app-metrics/redis_exporter/files/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/app-metrics/redis_exporter/files/redis_exporter.logrotated b/app-metrics/redis_exporter/files/redis_exporter.logrotated
new file mode 100644
index 000000000000..e83de5eb6436
--- /dev/null
+++ b/app-metrics/redis_exporter/files/redis_exporter.logrotated
@@ -0,0 +1,7 @@
+/var/log/redis_exporter/redis_exporter.log {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/app-metrics/redis_exporter/files/redis_exporter.service b/app-metrics/redis_exporter/files/redis_exporter.service
new file mode 100644
index 000000000000..4dbb09d7b641
--- /dev/null
+++ b/app-metrics/redis_exporter/files/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=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/app-metrics/redis_exporter/metadata.xml b/app-metrics/redis_exporter/metadata.xml
new file mode 100644
index 000000000000..ad438766d9bb
--- /dev/null
+++ b/app-metrics/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/app-metrics/redis_exporter/redis_exporter-0.15.0.ebuild b/app-metrics/redis_exporter/redis_exporter-0.15.0.ebuild
new file mode 100644
index 000000000000..3e3d871df3c8
--- /dev/null
+++ b/app-metrics/redis_exporter/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/v${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"
+}