Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151631466
D44888.id139150.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D44888.id139150.diff
View Options
diff --git a/databases/Makefile b/databases/Makefile
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -706,6 +706,7 @@
SUBDIR += proftpd-mod_sql_sqlite
SUBDIR += proftpd-mod_sql_tds
SUBDIR += prometheus-postgresql-adapter
+ SUBDIR += prometheus-postgres-exporter
SUBDIR += proxysql
SUBDIR += pspg
SUBDIR += puppetdb-terminus7
diff --git a/databases/prometheus-postgres-exporter/Makefile b/databases/prometheus-postgres-exporter/Makefile
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-postgres-exporter/Makefile
@@ -0,0 +1,28 @@
+PORTNAME= prometheus-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
+
+PLIST_FILES= bin/postgres_exporter \
+ etc/postgres_exporter.yml.sample
+
+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/prometheus-postgres-exporter/distinfo b/databases/prometheus-postgres-exporter/distinfo
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-postgres-exporter/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1708907285
+SHA256 (go/databases_prometheus-postgres-exporter/prometheus-postgres-exporter-v0.15.0/v0.15.0.mod) = 2eca3234e2449a0b04bf99c4761b5b62e6ddd6be2b9083b89837a57087fb0a59
+SIZE (go/databases_prometheus-postgres-exporter/prometheus-postgres-exporter-v0.15.0/v0.15.0.mod) = 1853
+SHA256 (go/databases_prometheus-postgres-exporter/prometheus-postgres-exporter-v0.15.0/v0.15.0.zip) = cbe281e1764b5df206eafd0ae5e5fee0b569afb3883b1502d2b1793694a53dd5
+SIZE (go/databases_prometheus-postgres-exporter/prometheus-postgres-exporter-v0.15.0/v0.15.0.zip) = 151785
diff --git a/databases/prometheus-postgres-exporter/files/pkg-message.in b/databases/prometheus-postgres-exporter/files/pkg-message.in
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-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/prometheus-postgres-exporter/files/postgres_exporter.in b/databases/prometheus-postgres-exporter/files/postgres_exporter.in
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-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/prometheus-postgres-exporter/files/postgres_exporter.yml.sample b/databases/prometheus-postgres-exporter/files/postgres_exporter.yml.sample
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-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/prometheus-postgres-exporter/pkg-descr b/databases/prometheus-postgres-exporter/pkg-descr
new file mode 100644
--- /dev/null
+++ b/databases/prometheus-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.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 3:34 PM (1 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31233502
Default Alt Text
D44888.id139150.diff (7 KB)
Attached To
Mode
D44888: databases/postgres_exporter: New port
Attached
Detach File
Event Timeline
Log In to Comment