Skip to content

FPM status: full OpenMetrics support with per-worker metrics - #23808

Open
1ma wants to merge 8 commits into
php:masterfrom
1ma:fpm-status-openmetrics-full
Open

1ma wants to merge 8 commits into
php:masterfrom
1ma:fpm-status-openmetrics-full

Conversation

@1ma

@1ma 1ma commented Sep 20, 2026

Copy link
Copy Markdown

Closes #9494, alternative to #12759

The former logic was quite a mess and I saw no way to fit the OpenMetrics per-worker stats into the existing control flow, so I extracted each format handling into its own static function and fpm_status_handle_request() became a simple dispatcher to the specialized handler. For text/html/xml/json these functions are a bit repetitive, but for OpenMetrics this design allows the flexibility to have a different control flow that doesn't interfere with the other formats.

The new metrics try to follow those of php-fpm_exporter as close as possible with only very minor differences (the scrape_uri label is not present, and the state "Getting request informations" is now "Getting request information" as per the existing constants in FPM. phpfpm_scrape_failures is also not present).

I tried to organize the commits to ease review, each one does a logical step and compiles and passes the tests.

I also fixed a subtle bug in the existing OpenMetrics output, for phpfpm_listen_queue_length the HELP and TYPE annotations were swapped, that's why I had to amend fpm/tests/status.inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FPM status with OpenMetrics format and FULL parameter

1 participant