diff options
| author | Pavel Timofeev <timp87@gmail.com> | 2024-07-11 13:28:19 +0000 |
|---|---|---|
| committer | Emanuel Haupt <ehaupt@FreeBSD.org> | 2024-07-11 13:29:12 +0000 |
| commit | 0de56f2a1c1746ae4bc96674b8e0ce57bbb9eb43 (patch) | |
| tree | 1b2b98055284180863bb49e2afcf717566f37ece | |
| parent | fb8f1c4acf0a9598e07ec521a4ad9408fa6fd28a (diff) | |
net-mgmt/promxy: Add new port
Promxy is a prometheus proxy that makes many shards of prometheus appear
as a single API endpoint to the user. This significantly simplifies
operations and use of prometheus at scale (when you have more than one
prometheus host). Promxy delivers this unified access endpoint without
requiring any sidecars, custom-builds, or other changes to your
prometheus infrastructure.
PR: 269195
| -rw-r--r-- | GIDs | 2 | ||||
| -rw-r--r-- | UIDs | 2 | ||||
| -rw-r--r-- | net-mgmt/Makefile | 1 | ||||
| -rw-r--r-- | net-mgmt/promxy/Makefile | 39 | ||||
| -rw-r--r-- | net-mgmt/promxy/distinfo | 5 | ||||
| -rw-r--r-- | net-mgmt/promxy/files/promxy.in | 77 | ||||
| -rw-r--r-- | net-mgmt/promxy/pkg-descr | 5 | ||||
| -rw-r--r-- | net-mgmt/promxy/pkg-plist | 4 |
8 files changed, 133 insertions, 2 deletions
@@ -421,7 +421,7 @@ fiche:*:477: prometheus:*:478: alertmanager:*:479: datadog:*:480: -# free: 481 +promxy:*:481: # free: 482 # free: 483 # free: 484 @@ -426,7 +426,7 @@ fiche:*:477:477::0:0:fiche Daemon:/usr/local/www/fiche:/usr/sbin/nologin prometheus:*:478:478::0:0:Prometheus Daemon:/var/tmp/prometheus:/usr/sbin/nologin alertmanager:*:479:479::0:0:Alertmanager Daemon:/var/tmp/alertmanager:/usr/sbin/nologin datadog:*:480:480::0:0:DataDog Agent:/var/db/datadog:/usr/sbin/nologin -# free: 481 +promxy:*:481:481::0:0:Promxy Daemon:/nonexistent:/usr/sbin/nologin # free: 482 # free: 483 # free: 484 diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index e23838498843..4d7709d01515 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -307,6 +307,7 @@ SUBDIR += prometheus1 SUBDIR += prometheus2 SUBDIR += promscale + SUBDIR += promxy SUBDIR += pushgateway SUBDIR += py-adal SUBDIR += py-aggregate6 diff --git a/net-mgmt/promxy/Makefile b/net-mgmt/promxy/Makefile new file mode 100644 index 000000000000..a94801d0d2e1 --- /dev/null +++ b/net-mgmt/promxy/Makefile @@ -0,0 +1,39 @@ +PORTNAME= promxy +DISTVERSIONPREFIX= v +DISTVERSION= 0.0.86 +CATEGORIES= net-mgmt + +MAINTAINER= timp87@gmail.com +COMMENT= Aggregating proxy to enable HA prometheus +WWW= https://github.com/jacksontj/promxy + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go:modules +USE_RC_SUBR= promxy +GO_MODULE= github.com/jacksontj/promxy +GO_TARGET= ./cmd/promxy +GO_BUILDFLAGS= -ldflags=" \ + -X github.com/prometheus/common/version.Version=v${DISTVERSION} \ + -X github.com/prometheus/common/version.Revision=${PORTREVISION} \ + -X github.com/prometheus/common/version.Branch=release-${PORTVERSION:R} \ + -X github.com/prometheus/common/version.BuildUser=${USER} \ + -X github.com/prometheus/common/version.BuildDate=$$(date +'%Y%m%d-%T')" + +SUB_LIST= GROUPS=${GROUPS} \ + USERS=${USERS} + +USERS= promxy +GROUPS= promxy + +post-patch: + @${REINPLACE_CMD} 's|"\*rule"|"${ETCDIR}/*rule"|' ${WRKSRC}/cmd/promxy/config.yaml + +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} +.for f in alert_example.rule config.yaml + ${INSTALL_DATA} ${WRKSRC}/cmd/promxy/${f} ${STAGEDIR}${ETCDIR}/${f}.sample +.endfor + +.include <bsd.port.mk> diff --git a/net-mgmt/promxy/distinfo b/net-mgmt/promxy/distinfo new file mode 100644 index 000000000000..19483626b293 --- /dev/null +++ b/net-mgmt/promxy/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1717380682 +SHA256 (go/net-mgmt_promxy/promxy-v0.0.86/v0.0.86.mod) = eb2034fcead52a7deb94942379564c5590fee7720f4eb735b5a363f7477b7f67 +SIZE (go/net-mgmt_promxy/promxy-v0.0.86/v0.0.86.mod) = 8436 +SHA256 (go/net-mgmt_promxy/promxy-v0.0.86/v0.0.86.zip) = ccc9b18c573ab0ec3adfacabec5048beda9b93f8d5dd250098189212f6e5e8ba +SIZE (go/net-mgmt_promxy/promxy-v0.0.86/v0.0.86.zip) = 226317 diff --git a/net-mgmt/promxy/files/promxy.in b/net-mgmt/promxy/files/promxy.in new file mode 100644 index 000000000000..b9adc225918c --- /dev/null +++ b/net-mgmt/promxy/files/promxy.in @@ -0,0 +1,77 @@ +#!/bin/sh + +# PROVIDE: promxy +# REQUIRE: NETWORKING SERVERS DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf or /etc/rc.conf.local +# to enable this service: +# +# promxy_enable: Enable Promxy +# Default: NO +# promxy_user: Username to run Promxy +# Default: %%USERS%% +# promxy_config: Configuration file to run Promxy +# Default: %%ETCDIR%%/config.yaml +# promxy_pidfile: Full path of the Promxy process PID file +# Default: /var/run/promxy.pid +# promxy_remediate_enable: Enable auto-restart if Promxy's been terminated +# Default: NO +# promxy_remediate_delay: Auto-restart delay if auto-restart enabled +# Default: 5 +# promxy_syslog_output_enable: Enable syslog output. +# Default: YES +# promxy_syslog_output_tag: Syslog tag if syslog output enabled. +# Default: promxy +# promxy_syslog_output_priority: Syslog priority if syslog output enabled. +# Default: info +# promxy_syslog_output_facility: Syslog facility if syslog output enabled. +# Default: daemon + +. /etc/rc.subr + +name=promxy +rcvar=promxy_enable + +load_rc_config "${name}" + +: ${promxy_enable:="NO"} +: ${promxy_user:="%%USERS%%"} +: ${promxy_config:="%%ETCDIR%%/config.yaml"} +: ${promxy_pidfile:=/var/run/promxy.pid} +: ${promxy_remediate_enable:="NO"} +: ${promxy_remediate_delay="5"} +: ${promxy_syslog_output_enable:="YES"} +: ${promxy_syslog_output_tag:="${name}"} +: ${promxy_syslog_output_priority:="info"} +: ${promxy_syslog_output_facility:="daemon"} + +if checkyesno promxy_syslog_output_enable; then + if [ -n "${promxy_syslog_output_tag}" ]; then + promxy_syslog_output_flags="-T ${promxy_syslog_output_tag}" + fi + if [ -n "${promxy_syslog_output_priority}" ]; then + promxy_syslog_output_flags="${promxy_syslog_output_flags} -s ${promxy_syslog_output_priority}" + fi + if [ -n "${promxy_syslog_output_facility}" ]; then + promxy_syslog_output_flags="${promxy_syslog_output_flags} -l ${promxy_syslog_output_facility}" + fi +fi + +if checkyesno promxy_remediate_enable; then + if [ -n "${promxy_remediate_delay}" ]; then + promxy_remediate_flags="-R ${promxy_remediate_delay}" + fi +fi + +pidfile="${promxy_pidfile}" +required_files="${promxy_config}" + +promxy_bin="%%PREFIX%%/bin/promxy" +command="/usr/sbin/daemon" +command_args="-u ${promxy_user} ${promxy_remediate_flags} -f ${promxy_syslog_output_flags} -P ${pidfile} ${promxy_bin} --config=${promxy_config}" + +# Run daemon(8) as root +unset promxy_user + +run_rc_command "$1" diff --git a/net-mgmt/promxy/pkg-descr b/net-mgmt/promxy/pkg-descr new file mode 100644 index 000000000000..8a15049bfbb3 --- /dev/null +++ b/net-mgmt/promxy/pkg-descr @@ -0,0 +1,5 @@ +Promxy is a prometheus proxy that makes many shards of prometheus appear as +a single API endpoint to the user. This significantly simplifies operations +and use of prometheus at scale (when you have more than one prometheus host). +Promxy delivers this unified access endpoint without requiring any sidecars, +custom-builds, or other changes to your prometheus infrastructure. diff --git a/net-mgmt/promxy/pkg-plist b/net-mgmt/promxy/pkg-plist new file mode 100644 index 000000000000..41552c1b70ab --- /dev/null +++ b/net-mgmt/promxy/pkg-plist @@ -0,0 +1,4 @@ +bin/promxy +@dir %%ETCDIR%% +@sample %%ETCDIR%%/alert_example.rule.sample +@sample %%ETCDIR%%/config.yaml.sample |
