FreeBSD Bugzilla – Attachment 248382 Details for
Bug 276996
[NEW PORT] databases/postgres_exporter: PostgreSQL metric exporter for Prometheus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0001-NEW-PORT-databases-postgres_exporter-PostgreSQL-metr.patch (text/plain), 8.05 KB, created by
Lexi Winter
on 2024-02-12 01:36:53 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Lexi Winter
Created:
2024-02-12 01:36:53 UTC
Size:
8.05 KB
patch
obsolete
>From 02844b570ecd09245b698de9b773f8b8fbb0e8f2 Mon Sep 17 00:00:00 2001 >From: Lexi Winter <lexi@le-Fay.ORG> >Date: Mon, 12 Feb 2024 00:33:04 +0000 >Subject: [PATCH] [NEW PORT] databases/postgres_exporter: PostgreSQL metric > exporter for Prometheus > >--- > databases/postgres_exporter/Makefile | 25 +++++++ > databases/postgres_exporter/distinfo | 5 ++ > .../postgres_exporter/files/pkg-message.in | 29 ++++++++ > .../files/postgres_exporter.in | 73 +++++++++++++++++++ > .../files/postgres_exporter.yml.sample | 12 +++ > databases/postgres_exporter/pkg-descr | 3 + > databases/postgres_exporter/pkg-plist | 2 + > 7 files changed, 149 insertions(+) > create mode 100644 databases/postgres_exporter/Makefile > create mode 100644 databases/postgres_exporter/distinfo > create mode 100644 databases/postgres_exporter/files/pkg-message.in > create mode 100644 databases/postgres_exporter/files/postgres_exporter.in > create mode 100644 databases/postgres_exporter/files/postgres_exporter.yml.sample > create mode 100644 databases/postgres_exporter/pkg-descr > create mode 100644 databases/postgres_exporter/pkg-plist > >diff --git a/databases/postgres_exporter/Makefile b/databases/postgres_exporter/Makefile >new file mode 100644 >index 000000000000..d13d5c169e5f >--- /dev/null >+++ b/databases/postgres_exporter/Makefile >@@ -0,0 +1,25 @@ >+PORTNAME= postgres_exporter >+DISTVERSIONPREFIX= v >+DISTVERSION= 0.15.0 >+CATEGORIES= databases >+ >+MAINTAINER= lexi.freebsd@le-fay.org >+COMMENT= PostgreSQL metric exporter for Prometheus >+WWW= https://github.com/prometheus-community/postgres_exporter >+ >+LICENSE= APACHE20 >+LICENSE_FILE= ${WRKSRC}/LICENSE >+ >+USES= go:modules >+USE_RC_SUBR= postgres_exporter >+GO_MODULE= github.com/prometheus-community/postgres_exporter >+GO_TARGET= ./cmd/postgres_exporter:${PREFIX}/bin/postgres_exporter >+ >+SUB_FILES= pkg-message >+ >+post-install: >+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc >+ ${INSTALL_DATA} ${PATCHDIR}/postgres_exporter.yml.sample \ >+ ${STAGEDIR}${PREFIX}/etc/postgres_exporter.yml.sample >+ >+.include <bsd.port.mk> >diff --git a/databases/postgres_exporter/distinfo b/databases/postgres_exporter/distinfo >new file mode 100644 >index 000000000000..cb35142884af >--- /dev/null >+++ b/databases/postgres_exporter/distinfo >@@ -0,0 +1,5 @@ >+TIMESTAMP = 1707695831 >+SHA256 (go/databases_postgres_exporter/postgres_exporter-v0.15.0/v0.15.0.mod) = 2eca3234e2449a0b04bf99c4761b5b62e6ddd6be2b9083b89837a57087fb0a59 >+SIZE (go/databases_postgres_exporter/postgres_exporter-v0.15.0/v0.15.0.mod) = 1853 >+SHA256 (go/databases_postgres_exporter/postgres_exporter-v0.15.0/v0.15.0.zip) = cbe281e1764b5df206eafd0ae5e5fee0b569afb3883b1502d2b1793694a53dd5 >+SIZE (go/databases_postgres_exporter/postgres_exporter-v0.15.0/v0.15.0.zip) = 151785 >diff --git a/databases/postgres_exporter/files/pkg-message.in b/databases/postgres_exporter/files/pkg-message.in >new file mode 100644 >index 000000000000..8887b3fe3433 >--- /dev/null >+++ b/databases/postgres_exporter/files/pkg-message.in >@@ -0,0 +1,29 @@ >+[ >+{ type: install >+ message: <<EOM >+A sample configuration file has been installed in >+%%PREFIX%%/etc/postgres_exporter.yml.sample. >+ >+To use postgres_exporter, copy this config file to "postgres_exporter.yml" >+and edit as needed, then enable and start the service: >+ >+# service postgres_exporter enable >+# service postgres_exporter start >+ >+For rc(8) options which can be used to configure the service, refer to >+%%PREFIX%%/etc/rc.d/postgres_exporter. >+ >+For example, to log output to the 'local5' syslog facility instead of the >+default 'daemon': >+ >+# sysrc postgres_exporter_syslog_output_facility=local5 >+ >+By default, the exporter runs as the 'nobody' user and listens on >+localhost:9187. These defaults can be changed via rc(8). >+ >+For documentation on the configuration file format and how to integrate the >+exporter into Prometheus, refer to the documentation at: >+https://github.com/prometheus-community/postgres_exporter >+EOM >+} >+] >diff --git a/databases/postgres_exporter/files/postgres_exporter.in b/databases/postgres_exporter/files/postgres_exporter.in >new file mode 100644 >index 000000000000..e96e638fa152 >--- /dev/null >+++ b/databases/postgres_exporter/files/postgres_exporter.in >@@ -0,0 +1,73 @@ >+#!/bin/sh >+ >+# PROVIDE: postgres_exporter >+# REQUIRE: LOGIN >+# KEYWORD: shutdown >+# >+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf >+# to enable this service: >+# >+# postgres_exporter_enable (bool): Set to NO by default. >+# Set it to YES to enable postgres_exporter. >+# postgres_exporter_config_file (string): Set the configuration file. >+# Default is "%%PREFIX%%/etc/postgres_exporter.yml". >+# postgres_exporter_user (string): Set user that postgres_exporter will run under >+# Default is "nobody". >+# postgres_exporter_group (string): Set group that postgres_exporter will run under >+# Default is "nobody". >+# postgres_exporter_args (string): Set extra arguments to pass to postgres_exporter >+# Default is "". >+# postgres_exporter_listen_address (string):Set ip:port that postgres_exporter will listen on >+# Default is "localhost:9187". >+# postgres_exporter_syslog_output_tag (str): Set syslog tag. >+# Default is "postgres_exporter". See daemon(8). >+# postgres_exporter_syslog_output_priority (str): Set syslog priority. >+# Default is "notice". See daemon(8). >+# postgres_exporter_syslog_output_facility (str): Set syslog facility. >+# Default is "daemon". See daemon(8). >+ >+ >+. /etc/rc.subr >+ >+name=postgres_exporter >+rcvar=postgres_exporter_enable >+ >+load_rc_config $name >+ >+: ${postgres_exporter_enable:="NO"} >+: ${postgres_exporter_config_file:="%%PREFIX%%/etc/postgres_exporter.yml"} >+: ${postgres_exporter_user:="nobody"} >+: ${postgres_exporter_group:="nobody"} >+: ${postgres_exporter_args:=""} >+: ${postgres_exporter_listen_address:="localhost:9187"} >+: ${postgres_exporter_syslog_output_tag=${name}} >+: ${postgres_exporter_syslog_output_priority=notice} >+: ${postgres_exporter_syslog_output_facility=daemon} >+ >+pidfile=/var/run/postgres_exporter.pid >+command="/usr/sbin/daemon" >+procname="%%PREFIX%%/bin/postgres_exporter" >+command_args="-f -p ${pidfile} -t ${name} \ >+ -T ${postgres_exporter_syslog_output_tag} \ >+ -s ${postgres_exporter_syslog_output_priority} \ >+ -l ${postgres_exporter_syslog_output_facility} \ >+ /usr/bin/env ${procname} \ >+ --web.listen-address=${postgres_exporter_listen_address} \ >+ --config.file=${postgres_exporter_config_file} \ >+ ${postgres_exporter_args}" >+ >+start_precmd=postgres_exporter_startprecmd >+ >+postgres_exporter_startprecmd() >+{ >+ if [ ! -e ${pidfile} ]; then >+ install \ >+ -o ${postgres_exporter_user} \ >+ -g ${postgres_exporter_group} \ >+ /dev/null ${pidfile}; >+ fi >+} >+ >+load_rc_config $name >+run_rc_command "$1" >+ >diff --git a/databases/postgres_exporter/files/postgres_exporter.yml.sample b/databases/postgres_exporter/files/postgres_exporter.yml.sample >new file mode 100644 >index 000000000000..9bc8e9372c30 >--- /dev/null >+++ b/databases/postgres_exporter/files/postgres_exporter.yml.sample >@@ -0,0 +1,12 @@ >+ >+# use auth_modules to provide authentication data for connections: >+ >+#auth_modules: >+# my_module: >+# type: userpass >+# userpass: >+# username: prometheus >+# password: 'a-good-password' >+# options: >+# dbname: template1 >+# sslmode: verify-full >diff --git a/databases/postgres_exporter/pkg-descr b/databases/postgres_exporter/pkg-descr >new file mode 100644 >index 000000000000..7573260da8d9 >--- /dev/null >+++ b/databases/postgres_exporter/pkg-descr >@@ -0,0 +1,3 @@ >+postgres_exporter is a Prometheus exporter for the PostgreSQL database. It can >+connect to multiple PostgreSQL databases as configured in Prometheus, and >+reports system-level metrics. >diff --git a/databases/postgres_exporter/pkg-plist b/databases/postgres_exporter/pkg-plist >new file mode 100644 >index 000000000000..95ae83101c65 >--- /dev/null >+++ b/databases/postgres_exporter/pkg-plist >@@ -0,0 +1,2 @@ >+bin/postgres_exporter >+etc/postgres_exporter.yml.sample >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 276996
:
248382
|
248746
|
250016