Skip to content

Commit

Permalink
app-metrics/unbound_exporter: add 9999
Browse files Browse the repository at this point in the history
  • Loading branch information
rcshell committed May 13, 2024
1 parent 70f9dd4 commit 8e8d0ec
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app-metrics/unbound_exporter/files/unbound_exporter.confd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
command_args=""

# Prometheus-unbound-exporter supports the following options:

# -web.listen-address
# Address to listen on for web interface and telemetry. (Default: ":9167")
# -web.telemetry-path
# Path under which to expose metrics. (Default: "/metrics")
# -unbound.host
# Unbound control socket hostname and port number. (Default: "localhost:8953")
# -unbound.ca
# Unbound server certificate. (Default "/etc/unbound/unbound_server.pem")
# -unbound.cert
# Unbound client certificate. (Default: "/etc/unbound/unbound_control.pem")
# -unbound.key
# Unbound client key. (Default: "/etc/unbound/unbound_control.key")
23 changes: 23 additions & 0 deletions app-metrics/unbound_exporter/files/unbound_exporter.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/sbin/openrc-run
# Copyright 2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="Prometheus unbound exporter"
pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
user=${user:-prometheus-exporter}

command="/usr/bin/${SVCNAME}"
command_args="${command_args}"
command_background="true"
start_stop_daemon_args="--user ${user} \
--stdout /var/log/prometheus/${SVCNAME}.log \
--stderr /var/log/prometheus/${SVCNAME}.log"

depend() {
need net
after net
}

start_pre() {
checkpath -d -m 0755 -o "${user}" "${pidfile%/*}"
}
17 changes: 17 additions & 0 deletions app-metrics/unbound_exporter/files/unbound_exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Prometheus unbound exporter
Documentation=https://github.com/kumina/unbound_exporter
After=network-online.target

[Service]
EnvironmentFile=/etc/default/%p
User=prometheus-exporter
Restart=on-failure
ExecStart=/usr/bin/%p $ARGS
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=20s
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

19 changes: 19 additions & 0 deletions app-metrics/unbound_exporter/files/unbound_exporter.service.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Service]
# Set the command-line arguments to pass to the server.
#Environment="ARGS="

# Prometheus-unbound-exporter supports the following options:

# -web.listen-address
# Address to listen on for web interface and telemetry. (Default: ":9167")
# -web.telemetry-path
# Path under which to expose metrics. (Default: "/metrics")
# -unbound.host
# Unbound control socket hostname and port number. (Default: "localhost:8953")
# -unbound.ca
# Unbound server certificate. (Default "/etc/unbound/unbound_server.pem")
# -unbound.cert
# Unbound client certificate. (Default: "/etc/unbound/unbound_control.pem")
# -unbound.key
# Unbound client key. (Default: "/etc/unbound/unbound_control.key")

11 changes: 11 additions & 0 deletions app-metrics/unbound_exporter/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>Vadim Misbakh-Soloviov</name>
</maintainer>
<upstream>
<remote-id type="github">letsencrypt/unbound_exporter</remote-id>
</upstream>
</pkgmetadata>
39 changes: 39 additions & 0 deletions app-metrics/unbound_exporter/unbound_exporter-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module systemd git-r3

DESCRIPTION="Prometheus exporter for PostgreSQL metrics"
HOMEPAGE="https://github.com/letsencrypt/unbound_exporter"
EGIT_REPO_URI="https://github.com/letsencrypt/unbound_exporter"
LICENSE="Apache-2.0"
SLOT="0"

RDEPEND="
acct-user/prometheus
acct-group/prometheus
"
DOCS=(README.md)

src_unpack() {
default
git-r3_src_unpack
go-module_live_vendor
}

src_compile() {
ego build -o "${PN}"
}

src_install() {
dobin "${PN}"

newinitd "${FILESDIR}/${PN}.initd" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_install_serviced "${FILESDIR}/${PN}.service.conf"

einstalldocs
}

0 comments on commit 8e8d0ec

Please sign in to comment.