From nobody Thu Jul 11 13:29:25 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKbDP4w96z5QfNf; Thu, 11 Jul 2024 13:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WKbDP4Mxfz4s6b; Thu, 11 Jul 2024 13:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720704565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J1NacJgV46YqTcc9Itr3kVFSmhZidW4EkM+vQ4Kr2R8=; b=Z2DIOTaiV4z4MmCodJ+6bLr/uIlNKzGYN80BM5BoZvFcvA807bMlDCPWGMhGcqXxvCDJDo EEG7n4se1QhcJQcL79WflhCcshScM3mThOlk59rbCIJ7BlqbC1MfOUpVXpnp3nPx2O4QIX 3r3e5D3EKerKsqTNklXKpkLBbsYMChJfOAz3AhNRsdu69ySNgFOBB+sBQ2IeWsa8TMDLQW pTJ6s3zE0GjD/JwDbyNc4ebfESW7Aa0b4QEIn7IeNY9/wJ77wge3N7PxpQXUbhFnvxG/N8 rchXO/EuE/5QM9+0R4TgjrKqB61DkCgkCgD5BpBsTJzX4czpC0/8u/yoN8DuPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720704565; a=rsa-sha256; cv=none; b=u9BWRo2e9DnUubr/RN8Q66TKDlDL8Ad9+bv+T7u41LzTCi35g/cVigRP/ReYs4NCAiHBn4 jlEY3QtFU4HwYuHXjMAyjddTOuyPr+E4pBX0Q3y5PakI2kIQJ/gr/4n6SyCYHX9Mqq0OEU Xe0OtNM9hPRAle+R3NAVYFo/7kA5GG6uvfdhSWFGY7mKjbYHiNo0v3ux9M2q0KjmKE408O uDkhNhu1jQISu1ta9wzOZjq8thFy/0QAxd0RfL2ZqXUOmIeCvqaRWhfdBO6W0ApD1lnV8b IymJCbvJyu/R0RR2kjwr/MDdVV4rJZaLusLCXLAkWZMvCiW6kq8tw4wfsv/+eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720704565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J1NacJgV46YqTcc9Itr3kVFSmhZidW4EkM+vQ4Kr2R8=; b=YdG71uQdg8DUh5l5YPQ9v22oI3MoCxMjZUinwVMkIixi8jyCV8gskCcUidQ8FUL3+1dH8t DyeFlDM6tk0H0aBgy8xqhXEQAoK8g3Y52DaEjmBqQzZ4rTq43byqnMNG423uzRs/5saDHg V3VEB6XZlaLMwPalcRzULAf+Nxciy5GO/qffSFGNVQOuBUxmRQ6IZllcy83AzmpTjsKTe9 sg8HUqemC+PIj+6cCCfA2hey0Rxc0D1sYBW2jYK4DAH/5B78g8SAsP/UoJ4ev5Zz9y/xnE e4NBOa9kh98HXyPrRJd4MRyXg254bTkThiWHG1hS/ggPPKbtWWs0SIpRAdJPnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WKbDP3vMcz12Xg; Thu, 11 Jul 2024 13:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46BDTPc9045716; Thu, 11 Jul 2024 13:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46BDTP8W045713; Thu, 11 Jul 2024 13:29:25 GMT (envelope-from git) Date: Thu, 11 Jul 2024 13:29:25 GMT Message-Id: <202407111329.46BDTP8W045713@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Emanuel Haupt Subject: git: 0de56f2a1c17 - main - net-mgmt/promxy: Add new port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ehaupt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0de56f2a1c1746ae4bc96674b8e0ce57bbb9eb43 Auto-Submitted: auto-generated The branch main has been updated by ehaupt: URL: https://cgit.FreeBSD.org/ports/commit/?id=0de56f2a1c1746ae4bc96674b8e0ce57bbb9eb43 commit 0de56f2a1c1746ae4bc96674b8e0ce57bbb9eb43 Author: Pavel Timofeev AuthorDate: 2024-07-11 13:28:19 +0000 Commit: Emanuel Haupt CommitDate: 2024-07-11 13:29:12 +0000 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 --- GIDs | 2 +- UIDs | 2 +- net-mgmt/Makefile | 1 + net-mgmt/promxy/Makefile | 39 +++++++++++++++++++++ net-mgmt/promxy/distinfo | 5 +++ net-mgmt/promxy/files/promxy.in | 77 +++++++++++++++++++++++++++++++++++++++++ net-mgmt/promxy/pkg-descr | 5 +++ net-mgmt/promxy/pkg-plist | 4 +++ 8 files changed, 133 insertions(+), 2 deletions(-) diff --git a/GIDs b/GIDs index 2fe7c6905e41..d9db9223af8d 100644 --- a/GIDs +++ b/GIDs @@ -421,7 +421,7 @@ fiche:*:477: prometheus:*:478: alertmanager:*:479: datadog:*:480: -# free: 481 +promxy:*:481: # free: 482 # free: 483 # free: 484 diff --git a/UIDs b/UIDs index c4f31fcd8949..7bb85ead9f11 100644 --- a/UIDs +++ b/UIDs @@ -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 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