Created attachment 248382 [details] patch i'm rather surprised this wasn't already ported, but here's a Prometheus metric exporter for PostgreSQL databases. i've tested on 15.0/amd64, but should work anywhere as it's just ordinary Go stuff. includes rc.d script and basic setup instructions in pkg-message. portlint and testport passed.
i've named this 'postgres_exporter' after the pattern of existing ports like 'blackbox_exporter'. i think something like 'prometheus-postgres-exporter' would be nicer, following the example of e.g. net-mgmt/prometheus-collectd-exporter, but i'm not sure if there's any policy about this or a strong reason to prefer one of the other.
Discussed this with my mentors and was given the permission/directive to call the shot on PORTNAME myself: Let's go with prometheus-postgres-exporter.
sounds good; do you want a new patch or will you change that yourself?
I'd prefer if you can update the patch accordingly (and performing the usual QA).
Created attachment 248746 [details] patch new patch: renamed to prometheus-postgres-exporter testport, runtime tested on 13.2, 14.0, 15.0: service postgres_exporter enable; service postgres_exporter start; service returns an HTTP response. okay to commit.
Created attachment 250016 [details] patch same patch as before, rebase on current ports main to resolve conflicts.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d387fce6b513cdb86d73cf8b7ab3e7ce6a3c3a97 commit d387fce6b513cdb86d73cf8b7ab3e7ce6a3c3a97 Author: Lexi Winter <lexi.freebsd@le-fay.org> AuthorDate: 2024-04-20 21:51:03 +0000 Commit: Joel Bodenmann <jbo@FreeBSD.org> CommitDate: 2024-05-27 16:04:11 +0000 databases/prometheus-postgres-exporter: New port PostgreSQL metric exporter for Prometheus. PR: 276996 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D44888 databases/Makefile | 1 + .../prometheus-postgres-exporter/Makefile (new) | 28 +++++++++ .../prometheus-postgres-exporter/distinfo (new) | 5 ++ .../files/pkg-message.in (new) | 29 +++++++++ .../files/postgres_exporter.in (new) | 73 ++++++++++++++++++++++ .../files/postgres_exporter.yml.sample (new) | 12 ++++ .../prometheus-postgres-exporter/pkg-descr (new) | 3 + 7 files changed, 151 insertions(+)
Committed - Thanks!