Bug 276996 - [NEW PORT] databases/postgres_exporter: PostgreSQL metric exporter for Prometheus
Summary: [NEW PORT] databases/postgres_exporter: PostgreSQL metric exporter for Promet...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joel Bodenmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-12 01:36 UTC by Lexi Winter
Modified: 2024-05-27 16:07 UTC (History)
1 user (show)

See Also:


Attachments
patch (8.05 KB, patch)
2024-02-12 01:36 UTC, Lexi Winter
no flags Details | Diff
patch (8.90 KB, patch)
2024-02-26 00:57 UTC, Lexi Winter
no flags Details | Diff
patch (7.62 KB, patch)
2024-04-17 01:11 UTC, Lexi Winter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lexi Winter 2024-02-12 01:36:53 UTC
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.
Comment 1 Lexi Winter 2024-02-12 01:38:56 UTC
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.
Comment 2 Joel Bodenmann freebsd_committer freebsd_triage 2024-02-14 15:21:20 UTC
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.
Comment 3 Lexi Winter 2024-02-16 00:45:04 UTC
sounds good; do you want a new patch or will you change that yourself?
Comment 4 Joel Bodenmann freebsd_committer freebsd_triage 2024-02-16 00:50:26 UTC
I'd prefer if you can update the patch accordingly (and performing the usual QA).
Comment 5 Lexi Winter 2024-02-26 00:57:32 UTC
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.
Comment 6 Lexi Winter 2024-04-17 01:11:33 UTC
Created attachment 250016 [details]
patch

same patch as before, rebase on current ports main to resolve conflicts.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-05-27 16:06:27 UTC
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(+)
Comment 8 Joel Bodenmann freebsd_committer freebsd_triage 2024-05-27 16:07:07 UTC
Committed - Thanks!