public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-metrics/node_exporter/files/, app-metrics/node_exporter/
@ 2020-03-15 19:57 Matthew Thode
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Thode @ 2020-03-15 19:57 UTC (permalink / raw
  To: gentoo-commits

commit:     3d4fcf4411a9e35f8bb2a9e6072c58ff1452eb0b
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 15 19:43:19 2020 +0000
Commit:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Sun Mar 15 19:57:28 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d4fcf44

app-metrics/node_exporter: update to 1.0.0-rc0

also migrate to acct packages

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>

 app-metrics/node_exporter/Manifest                 |  1 +
 .../node_exporter/files/node_exporter.service      | 10 ++++
 .../node_exporter/node_exporter-1.0.0_rc0.ebuild   | 53 ++++++++++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/app-metrics/node_exporter/Manifest b/app-metrics/node_exporter/Manifest
index be1e49b6836..f0bd23b02a7 100644
--- a/app-metrics/node_exporter/Manifest
+++ b/app-metrics/node_exporter/Manifest
@@ -1 +1,2 @@
 DIST node_exporter-0.18.1.tar.gz 2110072 BLAKE2B 48c73d00cba892e34e95d40bd29c9ca70bc5748590f00cb7f8adcd25d8a9504f669d887b1273cc65316ca55b06c36d97a3e19a66382f35d5768db7c315981a13 SHA512 cf2b854fbec1ba39b18432cdc11ab507ebc5b2828e6b34b4f49af9b949fcd365cb3e5eb1e265d0825783810c6b1572a8b3512ec27a46e5c83f89a505590159c0
+DIST node_exporter-1.0.0_rc0.tar.gz 2753717 BLAKE2B 2e1984d080ce2a16ca710a3da882b311510b2741836d615075281f5fce2641be35084090d9bcedcb8bf4f6a18333c5fcd53eb98817d1efed4c1a26261a02bffd SHA512 ec1d79367c69a7ccdacc9482a38625ffc9adab6d781b789cc226eed0bd893deca5cfc420a096f790ccd57834492551d36e2f307ad27a6c67585c8ef31887b50f

diff --git a/app-metrics/node_exporter/files/node_exporter.service b/app-metrics/node_exporter/files/node_exporter.service
new file mode 100644
index 00000000000..3235924f785
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Node Exporter
+
+[Service]
+User=node_exporter
+EnvironmentFile=/etc/sysconfig/node_exporter
+ExecStart=/usr/bin/node_exporter $OPTIONS
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild b/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild
new file mode 100644
index 00000000000..9eae734e4ac
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-1.0.0_rc0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit golang-build golang-vcs-snapshot systemd
+
+EGO_PN="github.com/prometheus/node_exporter"
+EGIT_COMMIT="v${PV/_rc/-rc.}"
+NODE_EXPORTER_COMMIT="ef7c058"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+IUSE=""
+
+CDEPEND="acct-group/node_exporter
+	acct-user/node_exporter"
+DEPEND=">=dev-lang/go-1.12
+	>=dev-util/promu-0.3.0
+	${CDEPEND}"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+	default
+	sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+	pushd src/${EGO_PN} || die
+	mkdir -p bin || die
+	GO111MODULE=on GOPATH="${S}" GOCACHE="${T}"/go-cache promu build -v --prefix node_exporter || die
+	popd || die
+}
+
+src_install() {
+	# binary and docs
+	dobin src/"${EGO_PN}"/node_exporter/node_exporter
+	dodoc src/"${EGO_PN}"/{README,CHANGELOG,CONTRIBUTING}.md
+	# systemd
+	systemd_dounit "${FILESDIR}/${PN}.service"
+	insinto /etc/sysconfig
+	newins src/"${EGO_PN}"/examples/systemd/sysconfig.node_exporter node_exporter
+	# openrc
+	newinitd "${FILESDIR}"/${PN}-1.initd ${PN}
+	newconfd "${FILESDIR}"/${PN}.confd ${PN}
+	# maintence
+	keepdir /var/lib/node_exporter /var/log/node_exporter
+	fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-metrics/node_exporter/files/, app-metrics/node_exporter/
@ 2020-03-15 23:11 William Hubbs
  0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2020-03-15 23:11 UTC (permalink / raw
  To: gentoo-commits

commit:     22ae5af892bcbe16a39954537a55b5940f8dcd81
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 15 23:07:27 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Mar 15 23:11:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22ae5af8

app-metrics/node_exporter: revbump for install location and go migration

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 .../node_exporter/files/node_exporter.initd        | 23 +++++++++++
 .../node_exporter-1.0.0_rc0-r1.ebuild              | 45 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git a/app-metrics/node_exporter/files/node_exporter.initd b/app-metrics/node_exporter/files/node_exporter.initd
new file mode 100644
index 00000000000..3ccddf757a8
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.initd
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 2016-2017 Gentoo Foundation
+# 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"
+start_stop_daemon_args="--user ${user} --group ${group} \
+	--stdout /var/log/node_exporter/${RC_SVCNAME}.log \
+	--stderr /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/node_exporter-1.0.0_rc0-r1.ebuild b/app-metrics/node_exporter/node_exporter-1.0.0_rc0-r1.ebuild
new file mode 100644
index 00000000000..43ee1e033e0
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-1.0.0_rc0-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit go-module systemd
+MY_PV="v${PV/_rc/-rc.}"
+NODE_EXPORTER_COMMIT=ef7c058
+
+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"
+
+LICENSE="Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+CDEPEND="acct-group/node_exporter
+	acct-user/node_exporter"
+DEPEND=">=dev-util/promu-0.3.0
+	${CDEPEND}"
+RDEPEND="${CDEPEND}"
+
+S="${WORKDIR}/${PN}-${PV/_rc/-rc.}"
+
+src_prepare() {
+	default
+	sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" .promu.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_dounit examples/systemd/node_exporter.service
+	insinto /etc/sysconfig
+	newins examples/systemd/sysconfig.node_exporter node_exporter
+	newinitd "${FILESDIR}"/${PN}.initd ${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
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-metrics/node_exporter/files/, app-metrics/node_exporter/
@ 2021-04-07  8:59 Mikle Kolyada
  0 siblings, 0 replies; 4+ messages in thread
From: Mikle Kolyada @ 2021-04-07  8:59 UTC (permalink / raw
  To: gentoo-commits

commit:     13ace9cf0a40ff74547390ee0976ada47bd1c2bf
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  7 08:27:59 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Apr  7 08:59:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13ace9cf

app-metrics/node_exporter: fix broken systemd support

Closes: https://bugs.gentoo.org/679312

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 app-metrics/node_exporter/files/node_exporter.service             | 7 +++++--
 .../{node_exporter-1.1.2.ebuild => node_exporter-1.1.2-r1.ebuild} | 8 +++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/app-metrics/node_exporter/files/node_exporter.service b/app-metrics/node_exporter/files/node_exporter.service
index 3235924f785..20eac483fc8 100644
--- a/app-metrics/node_exporter/files/node_exporter.service
+++ b/app-metrics/node_exporter/files/node_exporter.service
@@ -1,10 +1,13 @@
 [Unit]
 Description=Node Exporter
+Wants=network-online.target
+After=network-online.target
 
 [Service]
 User=node_exporter
-EnvironmentFile=/etc/sysconfig/node_exporter
-ExecStart=/usr/bin/node_exporter $OPTIONS
+Group=node_exporter
+Type=simple
+ExecStart=/usr/sbin/node_exporter
 
 [Install]
 WantedBy=multi-user.target

diff --git a/app-metrics/node_exporter/node_exporter-1.1.2.ebuild b/app-metrics/node_exporter/node_exporter-1.1.2-r1.ebuild
similarity index 99%
rename from app-metrics/node_exporter/node_exporter-1.1.2.ebuild
rename to app-metrics/node_exporter/node_exporter-1.1.2-r1.ebuild
index dc94a55d0c6..d3c63f4c958 100644
--- a/app-metrics/node_exporter/node_exporter-1.1.2.ebuild
+++ b/app-metrics/node_exporter/node_exporter-1.1.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -578,7 +578,7 @@ SRC_URI="https://github.com/prometheus/node_exporter/archive/${MY_PV}.tar.gz ->
 
 LICENSE="Apache-2.0 BSD BSD-2 MIT"
 SLOT="0"
-KEYWORDS="~amd64"
+KEYWORDS="amd64"
 
 CDEPEND="acct-group/node_exporter
 	acct-user/node_exporter"
@@ -602,9 +602,7 @@ src_compile() {
 src_install() {
 	dosbin node_exporter/node_exporter
 	dodoc {README,CHANGELOG,CONTRIBUTING}.md
-	systemd_dounit examples/systemd/node_exporter.service
-	insinto /etc/sysconfig
-	newins examples/systemd/sysconfig.node_exporter node_exporter
+	systemd_dounit "${FILESDIR}"/node_exporter.service
 	newinitd "${FILESDIR}"/${PN}.initd ${PN}
 	newconfd "${FILESDIR}"/${PN}.confd ${PN}
 	keepdir /var/lib/node_exporter /var/log/node_exporter


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-metrics/node_exporter/files/, app-metrics/node_exporter/
@ 2023-11-23 12:39 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-11-23 12:39 UTC (permalink / raw
  To: gentoo-commits

commit:     e08275b72c23fd6ab1b4c4a9960a4e8b46105301
Author:     Rahil Bhimjiani <rahil3108 <AT> gmail <DOT> com>
AuthorDate: Sun Oct  1 16:39:42 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 23 12:38:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e08275b7

app-metrics/node_exporter: add 1.7.0 and live

1. Added a patch from debian which removes deprecated legacy pre-1.0
era stuff
2. Added logrotate config
3. added systemd unit file with improvements
4. new use flag - systemd. When enabled it enables systemd collector by
default
5. install manpage (which was not the case before)
6. Add essential docs and examples
7. split LICENSE
8. follow skel.ebuild for {R,,B}DEPEND

[sam: Maintainer timeout after pings on IRC and in the bug.]

Closes: https://bugs.gentoo.org/915505
Signed-off-by: Rahil Bhimjiani <rahil3108 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-metrics/node_exporter/Manifest                 |   2 +
 .../files/01-default-settings-1.7.0.patch          | 133 +++++++++++++++++++++
 .../files/node_exporter-1.7.0.logrotate            |   9 ++
 .../files/node_exporter-1.7.0.service              |  21 ++++
 app-metrics/node_exporter/metadata.xml             |  15 +++
 .../node_exporter/node_exporter-1.7.0.ebuild       |  74 ++++++++++++
 .../node_exporter/node_exporter-9999.ebuild        |  74 ++++++++++++
 7 files changed, 328 insertions(+)

diff --git a/app-metrics/node_exporter/Manifest b/app-metrics/node_exporter/Manifest
index 50ef50db5892..147b0122a53c 100644
--- a/app-metrics/node_exporter/Manifest
+++ b/app-metrics/node_exporter/Manifest
@@ -4,3 +4,5 @@ DIST node_exporter-1.4.0-deps.tar.xz 24623388 BLAKE2B 76ea5392f3f4ee2d76706d7762
 DIST node_exporter-1.4.0.tar.gz 325743 BLAKE2B df6af555035c70930a610790e8d5eee87ca12cd27308ed95edf875da8615b61dde805d960d6262587322abecb721695bd42b1c078a7bcc40b24053cfce86015d SHA512 ebb4f9662ba995130b96e108050571119da368a8195e50896a19aab04d7cb40d60f9ae81052a0de08f571886cfb4150bf006a7b67a3d3683f2d04b5f43d61e7a
 DIST node_exporter-1.5.0-deps.tar.xz 25558844 BLAKE2B fd862394c4e9456af395af4a1a8fb5c9504b96fcfa5170027903edadcf29935ffa389a945a8306e59e8d373b238481090e61dca4d9b037d890e8df05a5c8ede7 SHA512 5141beabd6f6af57014d2095271ea7c9a7e6087d9939cf6fc4a89908df0a5b87267f469987d47b20a48411d5a01a1317c53bfad8138dcfa6aa80c0a9f3822aa7
 DIST node_exporter-1.5.0.tar.gz 329004 BLAKE2B 650e176ce15be980f9a3534f3246b577390d6d557b0ac7aa5341f3c91390bed829c4c3c3f60a4c108c814945134dc83639e12a13f416471e9c791ec88ed8a7bd SHA512 5b6d1da70a3458a1de270bcaf6ab177bd41c8b7031e67a4691b0b79931d15f0e22dbe1533f1ff0474496fcf4433bbd4b3473b8c0063f8891456960d7b6f56e15
+DIST node_exporter-1.7.0-deps.tar.xz 26490120 BLAKE2B 3177aa96a50eefaeafad73b293144772443428b8c1b90210230e3e508a678f5515aebec1c51661d47a1e021cd03c8febe9aa948cc3d955eff2b2f272a539b6af SHA512 9fe19ad0fc375f4846fddb7618de5b34ddad583b5c6b09d896c099c3218976fd337c11765699a713c66bbaa834b6cfcaee960b1b1d4014be263b99b897fb1e1c
+DIST node_exporter-1.7.0.tar.gz 328830 BLAKE2B 5f6b8101637bc0df605ea84446f905fcf8abeb68d0f2eda1e172b12aae4cffcfef54996f8725ad458671947c72a48fbbd73d4d401d8fd001e9e9d75f248230fc SHA512 4cd38b81cb54ca620a57c642a88b89d6d1ae36a752fff5f065c8848ea02066a211c6feb955bea4e311f7baafffee30a74670efe1cf4dac113c9bf7d154a1067b

diff --git a/app-metrics/node_exporter/files/01-default-settings-1.7.0.patch b/app-metrics/node_exporter/files/01-default-settings-1.7.0.patch
new file mode 100644
index 000000000000..114c6d23423e
--- /dev/null
+++ b/app-metrics/node_exporter/files/01-default-settings-1.7.0.patch
@@ -0,0 +1,133 @@
+Grabbed from https://salsa.debian.org/go-team/packages/prometheus-node-exporter/-/tree/debian/sid/debian/patches
+Only thing changed is textFileDirectory default path adapted for Gentoo
+##############
+Description: Set defaults that make sense for Debian systems.
+ We remove the deprecated options completely because they were introduced in
+ 1.0.0 and were never part of a stable release, and are causing issues with
+ the default value setting as it then makes the code consider it a usage and
+ errors out when the legacy option is used.
+Forwarded: not-needed
+---
+ collector/filesystem_linux.go |  2 +-
+ collector/netdev_common.go    | 22 +---------------------
+ collector/systemd_linux.go    | 23 ++---------------------
+ collector/textfile.go         |  2 +-
+ 4 files changed, 5 insertions(+), 44 deletions(-)
+
+--- a/collector/filesystem_linux.go
++++ b/collector/filesystem_linux.go
+@@ -33,7 +33,7 @@ import (
+ )
+ 
+ const (
+-	defMountPointsExcluded = "^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)"
++	defMountPointsExcluded = "^/(dev|proc|run|sys|mnt|media|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)"
+ 	defFSTypesExcluded     = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"
+ )
+ 
+--- a/collector/netdev_common.go
++++ b/collector/netdev_common.go
+@@ -32,9 +32,7 @@ import (
+ 
+ var (
+ 	netdevDeviceInclude    = kingpin.Flag("collector.netdev.device-include", "Regexp of net devices to include (mutually exclusive to device-exclude).").String()
+-	oldNetdevDeviceInclude = kingpin.Flag("collector.netdev.device-whitelist", "DEPRECATED: Use collector.netdev.device-include").Hidden().String()
+-	netdevDeviceExclude    = kingpin.Flag("collector.netdev.device-exclude", "Regexp of net devices to exclude (mutually exclusive to device-include).").String()
+-	oldNetdevDeviceExclude = kingpin.Flag("collector.netdev.device-blacklist", "DEPRECATED: Use collector.netdev.device-exclude").Hidden().String()
++	netdevDeviceExclude    = kingpin.Flag("collector.netdev.device-exclude", "Regexp of net devices to exclude (mutually exclusive to device-include).").Default("^lo$").String()
+ 	netdevAddressInfo      = kingpin.Flag("collector.netdev.address-info", "Collect address-info for every device").Bool()
+ 	netdevDetailedMetrics  = kingpin.Flag("collector.netdev.enable-detailed-metrics", "Use (incompatible) metric names that provide more detailed stats on Linux").Bool()
+ )
+@@ -55,24 +53,6 @@ func init() {
+ 
+ // NewNetDevCollector returns a new Collector exposing network device stats.
+ func NewNetDevCollector(logger log.Logger) (Collector, error) {
+-	if *oldNetdevDeviceInclude != "" {
+-		if *netdevDeviceInclude == "" {
+-			level.Warn(logger).Log("msg", "--collector.netdev.device-whitelist is DEPRECATED and will be removed in 2.0.0, use --collector.netdev.device-include")
+-			*netdevDeviceInclude = *oldNetdevDeviceInclude
+-		} else {
+-			return nil, errors.New("--collector.netdev.device-whitelist and --collector.netdev.device-include are mutually exclusive")
+-		}
+-	}
+-
+-	if *oldNetdevDeviceExclude != "" {
+-		if *netdevDeviceExclude == "" {
+-			level.Warn(logger).Log("msg", "--collector.netdev.device-blacklist is DEPRECATED and will be removed in 2.0.0, use --collector.netdev.device-exclude")
+-			*netdevDeviceExclude = *oldNetdevDeviceExclude
+-		} else {
+-			return nil, errors.New("--collector.netdev.device-blacklist and --collector.netdev.device-exclude are mutually exclusive")
+-		}
+-	}
+-
+ 	if *netdevDeviceExclude != "" && *netdevDeviceInclude != "" {
+ 		return nil, errors.New("device-exclude & device-include are mutually exclusive")
+ 	}
+--- a/collector/systemd_linux.go
++++ b/collector/systemd_linux.go
+@@ -18,7 +18,6 @@ package collector
+ 
+ import (
+ 	"context"
+-	"errors"
+ 	"fmt"
+ 	"math"
+ 	"regexp"
+@@ -47,13 +46,11 @@ var (
+ 		systemdUnitIncludeSet = true
+ 		return nil
+ 	}).String()
+-	oldSystemdUnitInclude = kingpin.Flag("collector.systemd.unit-whitelist", "DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
+ 	systemdUnitExcludeSet bool
+-	systemdUnitExclude    = kingpin.Flag("collector.systemd.unit-exclude", "Regexp of systemd units to exclude. Units must both match include and not match exclude to be included.").Default(".+\\.(automount|device|mount|scope|slice)").PreAction(func(c *kingpin.ParseContext) error {
++	systemdUnitExclude    = kingpin.Flag("collector.systemd.unit-exclude", "Regexp of systemd units to exclude. Units must both match include and not match exclude to be included.").Default(".+\\.(automount|device|mount|scope|slice|target)").PreAction(func(c *kingpin.ParseContext) error {
+ 		systemdUnitExcludeSet = true
+ 		return nil
+ 	}).String()
+-	oldSystemdUnitExclude  = kingpin.Flag("collector.systemd.unit-blacklist", "DEPRECATED: Use collector.systemd.unit-exclude").Hidden().String()
+ 	systemdPrivate         = kingpin.Flag("collector.systemd.private", "Establish a private, direct connection to systemd without dbus (Strongly discouraged since it requires root. For testing purposes only).").Hidden().Bool()
+ 	enableTaskMetrics      = kingpin.Flag("collector.systemd.enable-task-metrics", "Enables service unit tasks metrics unit_tasks_current and unit_tasks_max").Bool()
+ 	enableRestartsMetrics  = kingpin.Flag("collector.systemd.enable-restarts-metrics", "Enables service unit metric service_restart_total").Bool()
+@@ -83,7 +80,7 @@ type systemdCollector struct {
+ var unitStatesName = []string{"active", "activating", "deactivating", "inactive", "failed"}
+ 
+ func init() {
+-	registerCollector("systemd", defaultDisabled, NewSystemdCollector)
++	registerCollector("systemd", defaultEnabled, NewSystemdCollector)
+ }
+ 
+ // NewSystemdCollector returns a new Collector exposing systemd statistics.
+@@ -133,22 +130,6 @@ func NewSystemdCollector(logger log.Logg
+ 		prometheus.BuildFQName(namespace, subsystem, "version"),
+ 		"Detected systemd version", []string{"version"}, nil)
+ 
+-	if *oldSystemdUnitExclude != "" {
+-		if !systemdUnitExcludeSet {
+-			level.Warn(logger).Log("msg", "--collector.systemd.unit-blacklist is DEPRECATED and will be removed in 2.0.0, use --collector.systemd.unit-exclude")
+-			*systemdUnitExclude = *oldSystemdUnitExclude
+-		} else {
+-			return nil, errors.New("--collector.systemd.unit-blacklist and --collector.systemd.unit-exclude are mutually exclusive")
+-		}
+-	}
+-	if *oldSystemdUnitInclude != "" {
+-		if !systemdUnitIncludeSet {
+-			level.Warn(logger).Log("msg", "--collector.systemd.unit-whitelist is DEPRECATED and will be removed in 2.0.0, use --collector.systemd.unit-include")
+-			*systemdUnitInclude = *oldSystemdUnitInclude
+-		} else {
+-			return nil, errors.New("--collector.systemd.unit-whitelist and --collector.systemd.unit-include are mutually exclusive")
+-		}
+-	}
+ 	level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-include", "flag", *systemdUnitInclude)
+ 	systemdUnitIncludePattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *systemdUnitInclude))
+ 	level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-exclude", "flag", *systemdUnitExclude)
+--- a/collector/textfile.go
++++ b/collector/textfile.go
+@@ -33,7 +33,7 @@ import (
+ )
+ 
+ var (
+-	textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String()
++	textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("/var/lib/node_exporter").String()
+ 	mtimeDesc         = prometheus.NewDesc(
+ 		"node_textfile_mtime_seconds",
+ 		"Unixtime mtime of textfiles successfully read.",

diff --git a/app-metrics/node_exporter/files/node_exporter-1.7.0.logrotate b/app-metrics/node_exporter/files/node_exporter-1.7.0.logrotate
new file mode 100644
index 000000000000..82cad3ace322
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter-1.7.0.logrotate
@@ -0,0 +1,9 @@
+/var/log/node_exporter/node_exporter.log {
+    weekly
+    rotate 10
+    copytruncate
+    compress
+    delaycompress
+    notifempty
+    missingok
+}

diff --git a/app-metrics/node_exporter/files/node_exporter-1.7.0.service b/app-metrics/node_exporter/files/node_exporter-1.7.0.service
new file mode 100644
index 000000000000..e704c809b8e5
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter-1.7.0.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Prometheus exporter for machine metrics
+Documentation=https://github.com/prometheus/node_exporter
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+User=node_exporter
+Group=node_exporter
+Restart=on-failure
+Type=exec
+ExecStart=/usr/sbin/node_exporter
+ExecReload=/usr/bin/kill -HUP $MAINPID
+TimeoutStopSec=20s
+SendSIGKILL=no
+NoNewPrivileges=true
+ProtectHome=read-only
+ProtectSystem=strict
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-metrics/node_exporter/metadata.xml b/app-metrics/node_exporter/metadata.xml
index 080050c2eb9d..e4512038e885 100644
--- a/app-metrics/node_exporter/metadata.xml
+++ b/app-metrics/node_exporter/metadata.xml
@@ -5,7 +5,22 @@
 		<email>williamh@gentoo.org</email>
 		<name>William Hubbs</name>
 	</maintainer>
+	<maintainer type="person" proxied="yes">
+		<email>rahil3108@gmail.com</email>
+		<name>Rahil Bhimjiani</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<use>
+		<flag name="systemd">
+			Enables systemd collector by default
+		</flag>
+	</use>
 	<upstream>
 		<remote-id type="github">prometheus/node_exporter</remote-id>
+		<bugs-to>https://github.com/prometheus/node_exporter/issues</bugs-to>
+		<doc>https://github.com/prometheus/node_exporter/blob/master/README.md</doc>
 	</upstream>
 </pkgmetadata>

diff --git a/app-metrics/node_exporter/node_exporter-1.7.0.ebuild b/app-metrics/node_exporter/node_exporter-1.7.0.ebuild
new file mode 100644
index 000000000000..e02032dc5f61
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-1.7.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/prometheus/node_exporter.git"
+else
+	SRC_URI="https://github.com/prometheus/node_exporter/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	SRC_URI+=" https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz"
+	KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
+fi
+
+# main pkg
+LICENSE="Apache-2.0"
+# deps
+LICENSE+=" BSD BSD-2 MIT"
+SLOT="0"
+IUSE="selinux systemd"
+
+RDEPEND="
+	acct-group/node_exporter
+	acct-user/node_exporter
+	selinux? ( sec-policy/selinux-node_exporter )
+	systemd? ( sys-apps/systemd )
+"
+DEPEND="${RDEPEND}"
+BDEPEND=">=dev-util/promu-0.3.0"
+PATCHES=(
+	 "${FILESDIR}"/01-default-settings-1.7.0.patch
+)
+
+src_prepare() {
+	default
+	use !systemd && { sed -i -e "s|defaultEnabled|defaultDisabled|g;" collector/systemd_linux.go || die; }
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999* ]]; then
+		git-r3_src_unpack
+		go-module_live_vendor
+	else
+		go-module_src_unpack
+	fi
+}
+
+src_compile() {
+	promu build -v || die
+	./"${PN}" --help-man > "${PN}".1 || die
+}
+
+src_test() {
+	emake test-flags= test
+}
+
+src_install() {
+	dosbin "${PN}"
+	systemd_newunit "${FILESDIR}"/node_exporter-1.7.0.service node_exporter.service
+	newinitd "${FILESDIR}"/${PN}.initd-1 ${PN}
+	newconfd "${FILESDIR}"/${PN}.confd ${PN}
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/node_exporter-1.7.0.logrotate "${PN}"
+	keepdir /var/lib/node_exporter /var/log/node_exporter
+	fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+
+	doman "${PN}".1
+	dodoc example-rules.yml *.md
+}

diff --git a/app-metrics/node_exporter/node_exporter-9999.ebuild b/app-metrics/node_exporter/node_exporter-9999.ebuild
new file mode 100644
index 000000000000..e02032dc5f61
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/prometheus/node_exporter.git"
+else
+	SRC_URI="https://github.com/prometheus/node_exporter/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	SRC_URI+=" https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz"
+	KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
+fi
+
+# main pkg
+LICENSE="Apache-2.0"
+# deps
+LICENSE+=" BSD BSD-2 MIT"
+SLOT="0"
+IUSE="selinux systemd"
+
+RDEPEND="
+	acct-group/node_exporter
+	acct-user/node_exporter
+	selinux? ( sec-policy/selinux-node_exporter )
+	systemd? ( sys-apps/systemd )
+"
+DEPEND="${RDEPEND}"
+BDEPEND=">=dev-util/promu-0.3.0"
+PATCHES=(
+	 "${FILESDIR}"/01-default-settings-1.7.0.patch
+)
+
+src_prepare() {
+	default
+	use !systemd && { sed -i -e "s|defaultEnabled|defaultDisabled|g;" collector/systemd_linux.go || die; }
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999* ]]; then
+		git-r3_src_unpack
+		go-module_live_vendor
+	else
+		go-module_src_unpack
+	fi
+}
+
+src_compile() {
+	promu build -v || die
+	./"${PN}" --help-man > "${PN}".1 || die
+}
+
+src_test() {
+	emake test-flags= test
+}
+
+src_install() {
+	dosbin "${PN}"
+	systemd_newunit "${FILESDIR}"/node_exporter-1.7.0.service node_exporter.service
+	newinitd "${FILESDIR}"/${PN}.initd-1 ${PN}
+	newconfd "${FILESDIR}"/${PN}.confd ${PN}
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/node_exporter-1.7.0.logrotate "${PN}"
+	keepdir /var/lib/node_exporter /var/log/node_exporter
+	fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+
+	doman "${PN}".1
+	dodoc example-rules.yml *.md
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-23 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-15 19:57 [gentoo-commits] repo/gentoo:master commit in: app-metrics/node_exporter/files/, app-metrics/node_exporter/ Matthew Thode
  -- strict thread matches above, loose matches on Subject: below --
2020-03-15 23:11 William Hubbs
2021-04-07  8:59 Mikle Kolyada
2023-11-23 12:39 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox