summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Helmert III <ajak@gentoo.org>2022-10-14 12:18:28 -0500
committerWilliam Hubbs <williamh@gentoo.org>2022-10-14 12:19:49 -0500
commit57815e3bae0ad8bb6658fd2754732cc51f52a430 (patch)
treea5c157a2f3bcf1bb92d844e7081bbd49d2b7db3a /app-metrics
parentdev-python/xarray: enable python3_11 (diff)
downloadgentoo-57815e3bae0ad8bb6658fd2754732cc51f52a430.tar.gz
gentoo-57815e3bae0ad8bb6658fd2754732cc51f52a430.tar.bz2
gentoo-57815e3bae0ad8bb6658fd2754732cc51f52a430.zip
app-metrics/node_exporter: add 1.4.0
Closes: https://bugs.gentoo.org/876241 Closes: https://github.com/gentoo/gentoo/27701 Signed-off-by: John Helmert III <ajak@gentoo.org> Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/node_exporter/Manifest2
-rw-r--r--app-metrics/node_exporter/files/node_exporter.initd-123
-rw-r--r--app-metrics/node_exporter/files/node_exporter.service-113
-rw-r--r--app-metrics/node_exporter/node_exporter-1.4.0.ebuild45
4 files changed, 83 insertions, 0 deletions
diff --git a/app-metrics/node_exporter/Manifest b/app-metrics/node_exporter/Manifest
index d0c9cfabf358..b5b086e2a012 100644
--- a/app-metrics/node_exporter/Manifest
+++ b/app-metrics/node_exporter/Manifest
@@ -1,2 +1,4 @@
DIST node_exporter-1.3.1-deps.tar.xz 110247608 BLAKE2B 0c3cbea40927a2f780aea4113846a95fb24e79a03f53d880ec0cb4ad805e94dd2cd48402ad08673835e4bce2f06548a452dfb3a9f6f53b5d2d7b0a24048de5be SHA512 d7f7976f8ca3825876f8d246c58dccb6973edcb2e7a572c690b9ca8c8d7935bc0f225ab0285eacbaa93767b6f4181324b168338765a35a7e3112c32f926a3c8a
DIST node_exporter-1.3.1.tar.gz 299038 BLAKE2B 8c4b562fab36632f6a4bcfc0c7bc65484bd9d44b16691a3d531c3e163ab17bf0fe81712d5ea3115460144be246599fc3430a80dd2244981333f0e1e5b2384c80 SHA512 cd73ca3551b0b52307d8b76aff29bf497609a1729203da9898270d1441d3358e8d9ba907bb8a75b5934ed64a8cf6b360385b1b2d0a3de55e0e149e0f819e0a1f
+DIST node_exporter-1.4.0-deps.tar.xz 24623388 BLAKE2B 76ea5392f3f4ee2d76706d77625a0b1708f0a09d11dde1fc7511f62625cf7d2e26117eb8ed77c495d4e1d7aa98c62dfbaffc7310c415d831a670360705789975 SHA512 9e64c1d51bd47cb6a8caa5fd6f22846c266ebb86c79e5f8ab363e847c614fca4044e7c388691870e61a8f017f08c2b5bcada56c8390bdf9877e71ccdbd646ad9
+DIST node_exporter-1.4.0.tar.gz 325743 BLAKE2B df6af555035c70930a610790e8d5eee87ca12cd27308ed95edf875da8615b61dde805d960d6262587322abecb721695bd42b1c078a7bcc40b24053cfce86015d SHA512 ebb4f9662ba995130b96e108050571119da368a8195e50896a19aab04d7cb40d60f9ae81052a0de08f571886cfb4150bf006a7b67a3d3683f2d04b5f43d61e7a
diff --git a/app-metrics/node_exporter/files/node_exporter.initd-1 b/app-metrics/node_exporter/files/node_exporter.initd-1
new file mode 100644
index 000000000000..6e9de80da590
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.initd-1
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 2016-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus machine metrics exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/sbin/node_exporter"
+command_args="${command_args:---collector.textfile.directory=/var/lib/node_exporter/}"
+command_background="true"
+command_user="${user}:${group}"
+output_log="/var/log/node_exporter/${RC_SVCNAME}.log"
+error_log="/var/log/node_exporter/${RC_SVCNAME}.log"
+
+depend() {
+ after net
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 -o ${user}:${group} /var/log/node_exporter
+}
diff --git a/app-metrics/node_exporter/files/node_exporter.service-1 b/app-metrics/node_exporter/files/node_exporter.service-1
new file mode 100644
index 000000000000..81909b962b87
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.service-1
@@ -0,0 +1,13 @@
+[Unit]
+Description=Node Exporter
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+User=node_exporter
+Group=node_exporter
+Type=simple
+ExecStart=/usr/sbin/node_exporter --collector.textfile.directory=/var/lib/node_exporter/
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-metrics/node_exporter/node_exporter-1.4.0.ebuild b/app-metrics/node_exporter/node_exporter-1.4.0.ebuild
new file mode 100644
index 000000000000..91cb5773c610
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-1.4.0.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit go-module systemd
+MY_PV="v${PV/_rc/-rc.}"
+NODE_EXPORTER_COMMIT=7da1321761b3b8dfc9e496e1a60e6a476fec6018
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+SRC_URI="https://github.com/prometheus/node_exporter/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz"
+
+LICENSE="Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+
+COMMON_DEPEND="acct-group/node_exporter
+ acct-user/node_exporter"
+DEPEND=">=dev-util/promu-0.3.0
+ ${COMMON_DEPEND}"
+RDEPEND="${COMMON_DEPEND}"
+
+S="${WORKDIR}/${PN}-${PV/_rc/-rc.}"
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" .promu.yml || die
+ sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" .promu-cgo.yml || die
+}
+
+src_compile() {
+ mkdir -p bin || die
+ promu build -v --prefix node_exporter || die
+}
+
+src_install() {
+ dosbin node_exporter/node_exporter
+ dodoc {README,CHANGELOG,CONTRIBUTING}.md
+ systemd_newunit "${FILESDIR}"/node_exporter.service-1 node_exporter.service
+ newinitd "${FILESDIR}"/${PN}.initd-1 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/lib/node_exporter /var/log/node_exporter
+ fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+}