diff options
Diffstat (limited to 'net-analyzer/prometheus-pushgateway')
7 files changed, 129 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-pushgateway/Manifest b/net-analyzer/prometheus-pushgateway/Manifest new file mode 100644 index 000000000000..24152e1786d9 --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/Manifest @@ -0,0 +1,7 @@ +AUX prometheus-pushgateway.confd 819 BLAKE2B 9c42a6d012f70a2ac03d4b90999d94683bc62f6d203ef8d2bf59019e30aea59c3beceae34f2579a2958acfaf882c275453aa5e46e488c5afebaebfc3f17b896b SHA512 c941bc2350bbda14d49effbc0a7988869fc38ccf2236951a88721bd15397c9e5b5d5a98d58285610b33eedc7a26f6cca51e3ec6f4909bdabf0658afd51b99feb +AUX prometheus-pushgateway.initd 662 BLAKE2B 652c58309ce31f7a37cb92beb128848ef28118b9b05278e79765b8c6555b6020266c062ef58463488dd39389f6bf0e2d1e0a9b5371ec4b5c26b821d6fac8877e SHA512 7bb32a7848607d939f3343c8d3fc88454b9ffc9d8d89f2af992d9f6f9fafe266c965b068cc466adbcf0ab014f1e5ca9214b567feacce09b73c8c2212e12aab00 +AUX prometheus-pushgateway.logrotated 117 BLAKE2B b296783f46625672ed7ada814a11b0fd763f6bbbe28b7750e33c7d0a3a1f9f6698776562c5ccc0e1210c5e72c40caadc65dc915d427a9c96267cf7b28396fd4c SHA512 4b104316bf512f9a59181b1db14a7d21e0771213553681b5575f3c637897c0c3ee649a8972b3ab5bb3159275eb501fcc2f9b9bbafa4855bb0c5382fbd3c46f5a +AUX prometheus-pushgateway.service 498 BLAKE2B 59d1f49d39ed86057cef678216487a4181baa002874cf61d67ccbe090dd8c3cfbb0b38f169cae232d8a8f833010c3d2759e5aee3e49d126b96b2eb16655f7df3 SHA512 a631057a3aad30957c2f41ff674bc9c3449758b75455e9f95a73d1114056be574300f99a5bd1c4c76a876e79cd1b36bc6cae32206d5520878a4e7b139fa43977 +DIST prometheus-pushgateway-0.4.0.tar.gz 1140644 BLAKE2B ea82e2e7f6fd817de02044e5aafde724a4089e4f2961f0b581f90df7e04e65af5a3c3e044ef94bd600a92468a8aed791c838a8fdc64b05b7a91d6288e7e96fb3 SHA512 67f25e5f7fdc54143c5d10720f27bd256f22695ced93088cf2b72fe3197e45324d4353357ae40d7d3e92019480c0bec009e38ed3f583724d46411d76adbdc927 +EBUILD prometheus-pushgateway-0.4.0.ebuild 1317 BLAKE2B bd02c4ce881a2d09342d65b1356447157a4f3a2150dfd0082d3c3b212f92ea9afc3e28434ea94bbd60f885dd4714e73db25fbd49bdee2c8228b19590bd6c2fd3 SHA512 d0f3e4fe75c870a4e329503673bdf5f3db9f30f9e6b26544ae13b69839c4c272da719e9ad7d6d71a7cb764493438f819d4b5c5dbbbe983c16909b363c071a093 +MISC metadata.xml 437 BLAKE2B 904f35ea9287d25e5708e450715f8719004a5349ea871e9730fe36a98257cd0ba2417ec572f0d26a8d5d2de5629bca2d1b81f3e344bb8e4a52653175e8df2f3e SHA512 09284843912bc08aef77485911289fe1050f7d42e726e555650ad73b3ca51bcb62af90ccd69c3529bbdb7373b9ec317e0afd74687b84b123ac4fbbf2a3de9d7f diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd new file mode 100644 index 000000000000..de9ef483723f --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.confd @@ -0,0 +1,14 @@ +# -log.format value +# If set use a syslog logger or JSON logging. Example: logger:syslog?appname=bob&local=7 or logger:stdout?json=true. Defaults to stderr. +# -log.level value +# Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]. +# -persistence.file string +# File to persist metrics. If empty, metrics are only kept in memory. +# -persistence.interval duration +# The minimum interval at which to write out the persistence file. (default 5m0s) +# -web.listen-address string +# Address to listen on for the web interface, API, and telemetry. (default ":9091") +# -web.telemetry-path string +# Path under which to expose metrics. (default "/metrics") + +#command_args="-web.listen-address localhost:9091 -persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob" diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd new file mode 100644 index 000000000000..a187e57897ed --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Prometheus push acceptor for ephemeral and batch jobs" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/pushgateway" +command_args="${command_args:--web.listen-address localhost:9091 -persistence.file=/var/lib/${RC_SVCNAME}/persistence.gob}" +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() { + need net +} diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated new file mode 100644 index 000000000000..3645c9be1762 --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.logrotated @@ -0,0 +1,7 @@ +/var/log/prometheus-pushgateway/prometheus-pushgateway.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service new file mode 100644 index 000000000000..4377850f2c5c --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/files/prometheus-pushgateway.service @@ -0,0 +1,16 @@ +[Unit] +Description=Prometheus exporter for ephemereal jobs +Documentation=https://prometheus.io/docs/instrumenting/pushing/ +After=network-online.target + +[Service] +User=prometheus-pushgateway +Restart=on-failure +Environment=PUSHGATEWAY_ARGS="-web.listen-address localhost:9091 --persistence.file=/var/lib/prometheus-pushgateway/persistence.gob" +ExecStart=/usr/bin/pushgateway $PUSHGATEWAY_ARGS +ExecReload=/bin/kill -HUP $MAINPID +TimeoutStopSec=20s +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target diff --git a/net-analyzer/prometheus-pushgateway/metadata.xml b/net-analyzer/prometheus-pushgateway/metadata.xml new file mode 100644 index 000000000000..f233ac35e254 --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/metadata.xml @@ -0,0 +1,15 @@ +<?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> + <maintainer type="person"> + <email>mrueg@gentoo.org</email> + <name>Manuel RĂ¼ger</name> + </maintainer> + <upstream> + <remote-id type="github">prometheus/pushgateway</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-analyzer/prometheus-pushgateway/prometheus-pushgateway-0.4.0.ebuild b/net-analyzer/prometheus-pushgateway/prometheus-pushgateway-0.4.0.ebuild new file mode 100644 index 000000000000..848c8d3c334e --- /dev/null +++ b/net-analyzer/prometheus-pushgateway/prometheus-pushgateway-0.4.0.ebuild @@ -0,0 +1,51 @@ +# 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/prometheus/pushgateway" +EGIT_COMMIT="v${PV/_rc/-rc.}" +pushgateway_COMMIT="6ceb4a1" +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Prometheus push acceptor for ephemeral and batch jobs" +HOMEPAGE="https://github.com/prometheus/pushgateway" +SRC_URI="${ARCHIVE_URI}" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND="dev-util/promu" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} +} + +src_prepare() { + default + sed -i -e "s/{{.Revision}}/${pushgateway_COMMIT}/" src/${EGO_PN}/.promu.yml || die +} + +src_compile() { + pushd src/${EGO_PN} || die + mkdir -p bin || die + GOPATH="${S}" promu build -v --prefix pushgateway || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin pushgateway/pushgateway + dodoc {README,CHANGELOG,CONTRIBUTING}.md + popd || die + keepdir /var/lib/${PN} /var/log/${PN} + fowners ${PN}:${PN} /var/lib/${PN} /var/log/${PN} + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" + systemd_dounit "${FILESDIR}/${PN}.service" +} |