Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2017 21:39:37 +0000 (UTC)
From:      Boris Samorodov <bsam@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r446118 - in head/net-mgmt: . pushgateway pushgateway/files
Message-ID:  <201707172139.v6HLdbI3068669@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bsam
Date: Mon Jul 17 21:39:37 2017
New Revision: 446118
URL: https://svnweb.freebsd.org/changeset/ports/446118

Log:
  The Prometheus Pushgateway exists to allow ephemeral and batch jobs to
  expose their metrics to Prometheus. Since these kinds of jobs may not
  exist long enough to be scraped, they can instead push their metrics to
  a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.
  
  WWW: https://github.com/prometheus/pushgateway
  
  PR:		216882
  Submitted by:	Athanasios Douitsis <aduitsis@cpan.org>

Added:
  head/net-mgmt/pushgateway/
  head/net-mgmt/pushgateway/Makefile   (contents, props changed)
  head/net-mgmt/pushgateway/distinfo   (contents, props changed)
  head/net-mgmt/pushgateway/files/
  head/net-mgmt/pushgateway/files/pushgateway.in   (contents, props changed)
  head/net-mgmt/pushgateway/pkg-descr   (contents, props changed)
  head/net-mgmt/pushgateway/pkg-plist   (contents, props changed)
Modified:
  head/net-mgmt/Makefile

Modified: head/net-mgmt/Makefile
==============================================================================
--- head/net-mgmt/Makefile	Mon Jul 17 21:19:40 2017	(r446117)
+++ head/net-mgmt/Makefile	Mon Jul 17 21:39:37 2017	(r446118)
@@ -286,6 +286,7 @@
     SUBDIR += pnp-icinga2
     SUBDIR += portmon
     SUBDIR += prometheus
+    SUBDIR += pushgateway
     SUBDIR += py-ipcalc
     SUBDIR += py-ipy
     SUBDIR += py-pyang

Added: head/net-mgmt/pushgateway/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/pushgateway/Makefile	Mon Jul 17 21:39:37 2017	(r446118)
@@ -0,0 +1,34 @@
+# Created by: Athanasios Douitsis <aduitsis@cpan.org>
+# $FreeBSD$
+
+PORTNAME=	pushgateway
+PORTVERSION=	0.3.1
+DISTVERSIONPREFIX=v
+CATEGORIES=	net-mgmt
+
+MAINTAINER=	aduitsis@cpan.org
+COMMENT=	Prometheus push acceptor for ephemeral and batch jobs
+
+LICENSE=	APACHE20
+
+USES=		go gmake
+GH_ACCOUNT=	prometheus
+USE_GITHUB=	yes
+
+GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
+
+USE_RC_SUBR=	pushgateway
+
+USERS=		prometheus
+GROUPS=		prometheus
+
+STRIP=		# stripping can break go binaries
+
+do-build:
+	(cd ${GO_WRKSRC} ; ${SETENV} ${GO_ENV} go install)
+
+do-install:
+	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/pushgateway ${STAGEDIR}${PREFIX}/bin
+	${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/${PORTNAME}
+
+.include <bsd.port.mk>

Added: head/net-mgmt/pushgateway/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/pushgateway/distinfo	Mon Jul 17 21:39:37 2017	(r446118)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1486461319
+SHA256 (prometheus-pushgateway-v0.3.1_GH0.tar.gz) = 6b0fffd0ffd05babbcfd8838027e4bad8ee4d91aeaca705aa83d7ddf1f8bb6c6
+SIZE (prometheus-pushgateway-v0.3.1_GH0.tar.gz) = 1140371

Added: head/net-mgmt/pushgateway/files/pushgateway.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/pushgateway/files/pushgateway.in	Mon Jul 17 21:39:37 2017	(r446118)
@@ -0,0 +1,66 @@
+#!/bin/sh
+# 
+# $FreeBSD$
+
+# PROVIDE: pushgateway
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# pushgateway_enable (bool):	 Set to NO by default
+#							   Set it to YES to enable pushgateway
+# pushgateway_user (string):	 Set user to run pushgateway
+#							   Default is "prometheus"
+# pushgateway_group (string):	Set group to run pushgateway
+#							   Default is "prometheus"
+# pushgateway_data_dir (string): Set dir to run pushgateway in
+#							   Default is "/var/db/pushgateway"
+# pushgateway_persistence_file (string): Set file in which the pushed
+#				metrics will be persisted
+#							   Default is "${pushgateway_data_dir}/persistent.data"
+# pushgateway_log_file (string): Set file that pushgateway will log to
+#							   Default is "/var/log/pushgateway.log"
+# pushgateway_args (string):	 Set additional command line arguments
+#							   Default is ""
+
+. /etc/rc.subr
+
+name=pushgateway
+rcvar=pushgateway_enable
+
+load_rc_config $name
+
+: ${pushgateway_enable:=NO}
+: ${pushgateway_user:=prometheus}
+: ${pushgateway_group:=prometheus}
+: ${pushgateway_data_dir=/var/db/pushgateway}
+: ${pushgateway_persistence_file=${pushgateway_data_dir}/persistent.data}
+: ${pushgateway_log_file=/var/log/pushgateway.log}
+
+pidfile=/var/run/pushgateway.pid
+command=/usr/sbin/daemon
+procname="%%PREFIX%%/bin/pushgateway"
+sig_reload=HUP
+extra_commands=reload
+command_args="-p ${pidfile} /usr/bin/env ${procname} \
+				-persistence.file=${pushgateway_persistence_file} \
+				${pushgateway_args} > ${pushgateway_log_file} 2>&1"
+
+start_precmd=pushgateway_startprecmd
+
+pushgateway_startprecmd()
+{
+	if [ ! -e ${pidfile} ]; then
+		install -o ${pushgateway_user} -g ${pushgateway_group} /dev/null ${pidfile};
+	fi
+	if [ ! -f "${pushgateway_log_file}" ]; then
+		install -o ${pushgateway_user} -g ${pushgateway_group} -m 640 /dev/null ${pushgateway_log_file};
+	fi
+	if [ ! -d ${pushgateway_data_dir} ]; then
+		install -d -o ${pushgateway_user} -g ${pushgateway_group} -m 750 ${pushgateway_data_dir}
+	fi
+}
+
+run_rc_command "$1"

Added: head/net-mgmt/pushgateway/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/pushgateway/pkg-descr	Mon Jul 17 21:39:37 2017	(r446118)
@@ -0,0 +1,6 @@
+The Prometheus Pushgateway exists to allow ephemeral and batch jobs to
+expose their metrics to Prometheus. Since these kinds of jobs may not
+exist long enough to be scraped, they can instead push their metrics to
+a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.
+
+WWW: https://github.com/prometheus/pushgateway

Added: head/net-mgmt/pushgateway/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/pushgateway/pkg-plist	Mon Jul 17 21:39:37 2017	(r446118)
@@ -0,0 +1,2 @@
+bin/pushgateway
+@dir(prometheus,prometheus) /var/db/pushgateway



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707172139.v6HLdbI3068669>