Bug 258916 - [NEW PORT] net-mgmt/php-fpm_exporter: export PHP-FPM metrics for Prometheus
Summary: [NEW PORT] net-mgmt/php-fpm_exporter: export PHP-FPM metrics for Prometheus
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: Vanilla I. Shu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-04 11:22 UTC by bgdnlp
Modified: 2021-10-06 07:18 UTC (History)
2 users (show)

See Also:


Attachments
new port, exposes php-fpm/staus metrics for Prometheus (12.73 KB, patch)
2021-10-04 11:22 UTC, bgdnlp
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bgdnlp 2021-10-04 11:22:46 UTC
Created attachment 228429 [details]
new port, exposes php-fpm/staus metrics for Prometheus

Exports php-fpm /status page into a format that Prometheus understands on port 9253. A build of https://github.com/hipages/php-fpm_exporter.

My first port. Copy&pasted and googled my way into something that seems to work as intended. Tested only on FreeBSD 12.2 on AMD64, but the releases page on GitHub has binaries for ARM64 too, so I assume that also works.

I'm not sure about PLIST_FILES, shouldn't it also list the rc.d script that it installs?

I am not a Go developer, I don't actually fully understand what I did. It builds and it works-on-my-machines, that's all I know.


'make test' output:

===>  Testing ./...
?   	github.com/hipages/php-fpm_exporter	[no test files]
?   	github.com/hipages/php-fpm_exporter/cmd	[no test files]
=== RUN   TestCountProcessState
--- PASS: TestCountProcessState (0.00s)
=== RUN   TestCannotUnmarshalNumberIssue10
--- PASS: TestCannotUnmarshalNumberIssue10 (0.00s)
=== RUN   TestInvalidCharacterIssue24
--- PASS: TestInvalidCharacterIssue24 (0.00s)
=== RUN   TestJsonResponseFixer
--- PASS: TestJsonResponseFixer (0.00s)
=== RUN   TestParseURL
--- PASS: TestParseURL (0.00s)
PASS
ok  	github.com/hipages/php-fpm_exporter/phpfpm	0.009s
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-10-06 07:15:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e20d99399a25bb2f5203e9251b408a1da431962d

commit e20d99399a25bb2f5203e9251b408a1da431962d
Author:     Vanilla I. Shu <vanilla@FreeBSD.org>
AuthorDate: 2021-10-06 06:44:13 +0000
Commit:     Vanilla I. Shu <vanilla@FreeBSD.org>
CommitDate: 2021-10-06 07:13:57 +0000

    net-mgmt/php-fpm_exporter: add port

    PR:             258916
    Reported by:    bgdnlp <freebsd.org at neant.ro>

 net-mgmt/Makefile                                  |  1 +
 net-mgmt/php-fpm_exporter/Makefile (new)           | 59 ++++++++++++++++
 net-mgmt/php-fpm_exporter/distinfo (new)           | 79 ++++++++++++++++++++++
 .../files/php_fpm_exporter.in (new)                | 66 ++++++++++++++++++
 net-mgmt/php-fpm_exporter/pkg-descr (new)          |  4 ++
 5 files changed, 209 insertions(+)
Comment 2 Vanilla I. Shu freebsd_committer freebsd_triage 2021-10-06 07:18:46 UTC
Committed, thanks.

BTW, I remove GO_MODULES from Makefile, it's invalid variable name (should be GO_MODULE, you can check /usr/ports/Mk/Uses/go.mk for more details.)