app-metrics/apache_exporter: new package

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson
2026-08-09 12:36:01 -07:00
parent 8937adf4fb
commit 3c158de878
12 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-group
DESCRIPTION="Group used for the apache_exporter prometheus plugin"
KEYWORDS="~amd64 ~x86"
# If you want this to persist across multiple machines, pick a real number!
ACCT_GROUP_ID="-1"

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
</pkgmetadata>

View File

@@ -0,0 +1,14 @@
# Copyright 2019-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-user
DESCRIPTION="User for the apache_exporter prometheus plugin"
KEYWORDS="~amd64 ~x86"
ACCT_USER_ID=-1
ACCT_USER_GROUPS=( apache_exporter )
acct-user_add_deps

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
</pkgmetadata>

View File

@@ -0,0 +1,2 @@
DIST apache_exporter-1.1.1-vendor.tar.xz 1271956 BLAKE2B fb448db688988873254495e94b82641829355dcce8803880e555cc77289702783bb184fa44bd37d975ead9bcbf5455d8c6c20ba2c7cd645af7d1836e07e1ff17 SHA512 9289197ff39e0cd3e00c89b81158d88a58dbc5608ac8471c2e37950ede4507018dc14165216744f07bfe95c043d0f1e92aedb37f6111ecea382f2ba6fcf16e01
DIST apache_exporter-1.1.1.tar.gz 21711 BLAKE2B 1b4d3568e4203105be4710c1df7c7184760580dcab41dce60c511ae5e0e617112827df378906b4e01ba4e73cf386c73cae60fdf8ce2ec16a25f6921ae84d2ef1 SHA512 c4b163e2c9f686c1ab58f0357b4c4e52b1c2ed6827969fe81b74b409efd97355b6de3a0dfb483067b809f81f7870b8a1c90111cf16d2c3e67f797315083a5109

View File

@@ -0,0 +1,46 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd
DESCRIPTION="Prometheus exporter for apache metrics"
HOMEPAGE="https://github.com/Lusitaniae/apache_exporter"
SRC_URI="https://github.com/Lusitaniae/apache_exporter/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/gentoo-golang-dist/${PN}/releases/download/v${PV}/${P}-vendor.tar.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
COMMON_DEPEND="
acct-group/apache_exporter
acct-user/apache_exporter"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}"
BDEPEND="
>=dev-lang/go-1.25.0
dev-util/promu
"
src_compile() {
promu build -v --prefix bin || die
}
src_install() {
newbin bin/${P} ${PN}
dodoc {README,CHANGELOG}.md
newinitd "${FILESDIR}"/apache_exporter.initd apache_exporter
newconfd "${FILESDIR}"/apache_exporter.confd apache_exporter
systemd_dounit "${FILESDIR}"/apache_exporter.service
insinto /etc/sysconfig
newins "${FILESDIR}/sysconfig.apache_exporter" apache_exporter
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
keepdir /var/log/apache_exporter
fowners -R ${PN}:${PN} /var/log/apache_exporter
}

View File

@@ -0,0 +1,2 @@
# arguments for prometheus apache exporter
command_args=""

View File

@@ -0,0 +1,23 @@
#!/sbin/openrc-run
# Copyright 2016-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Prometheus apache metrics exporter"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-${RC_SVCNAME}}
group=${group:-${RC_SVCNAME}}
command="/usr/bin/apache_exporter"
command_args="${command_args:-}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/apache_exporter/${RC_SVCNAME}.log \
--stderr /var/log/apache_exporter/${RC_SVCNAME}.log"
depend() {
after net
}
start_pre() {
checkpath -q -d -m 0755 -o ${user}:${group} /var/log/apache_exporter
}

View File

@@ -0,0 +1,8 @@
/var/log/apache_exporter/apache_exporter.log {
missingok
size 5M
rotate 3
compress
copytruncate
}

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Apache Exporter
[Service]
User=apache_exporter
EnvironmentFile=/etc/sysconfig/apache_exporter
ExecStart=/usr/bin/apache_exporter $OPTIONS
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1 @@
OPTIONS=""

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">Lusitaniae/apache_exporter</remote-id>
</upstream>
<maintainer type="person">
<email>robbat2@gentoo.org</email>
<name>Robin H. Johnson</name>
</maintainer>
</pkgmetadata>