Skip to content

Commit 46bec6d

Browse files
ste93crybukka
authored andcommitted
Fix the OpenMetrics response format returned by the FPM status page
Closes GH-7843, closes GH-7842
1 parent 4ae7562 commit 46bec6d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ PHP NEWS
2323
- Filter:
2424
. Fixed FILTER_FLAG_NO_RES_RANGE flag. (Yifan Tong)
2525

26+
- FPM:
27+
. Fixed bug GH-7842 (Invalid OpenMetrics response format returned by FPM
28+
status page. (Stefano Arlandini)
29+
2630
- Hash:
2731
. Fixed bug GH-7759 (Incorrect return types for hash() and hash_hmac()).
2832
(cmb)

sapi/fpm/fpm/fpm_status.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ int fpm_status_handle_request(void) /* {{{ */
430430
"phpfpm_max_children_reached %u\n"
431431
"# HELP phpfpm_slow_requests The number of requests that exceeded your 'request_slowlog_timeout' value.\n"
432432
"# TYPE phpfpm_slow_requests counter\n"
433-
"phpfpm_slow_requests %lu\n";
433+
"phpfpm_slow_requests %lu\n"
434+
"# EOF\n";
434435

435436
has_start_time = 0;
436437
if (!full) {

sapi/fpm/tests/status.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ class Status
241241
"phpfpm_max_children_reached " . $fields['max children reached'] . "\n" .
242242
"# HELP phpfpm_slow_requests The number of requests that exceeded your 'request_slowlog_timeout' value\.\n" .
243243
"# TYPE phpfpm_slow_requests counter\n" .
244-
"phpfpm_slow_requests " . $fields['slow requests'] . ")";
244+
"phpfpm_slow_requests " . $fields['slow requests'] . "\n" .
245+
"# EOF)\n";
245246

246247
if (!preg_match($pattern, $body)) {
247248
echo "ERROR: Expected body does not match pattern\n";

0 commit comments

Comments
 (0)