-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New PHP-FPM metricbeat module (#3415)
- Loading branch information
Showing
23 changed files
with
615 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-module-php_fpm]] | ||
== PHP-FPM Module | ||
|
||
This module periodically fetches metrics from https://php-fpm.org[PHP-FPM] | ||
servers. | ||
|
||
[float] | ||
=== Module-Specific Configuration Notes | ||
|
||
You need to enable the PHP-FPM status page by properly configuring | ||
`pm.status_path`. | ||
|
||
Here is a sample nginx configuration to forward requests to the PHP-FPM status | ||
page (assuming `pm.status_path` is configured with default value `/status`): | ||
```nginx | ||
location ~ /status { | ||
allow 127.0.0.1; | ||
deny all; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass 127.0.0.1:9000; | ||
} | ||
``` | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The PHP-FPM metricsets were tested with PHP 5.6.29 and are expected to | ||
work with all versions >= 5. | ||
|
||
|
||
[float] | ||
=== Example Configuration | ||
|
||
The php_fpm module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
#- module: php_fpm | ||
#metricsets: ["pool"] | ||
#enabled: true | ||
#period: 10s | ||
#status_path: "/status" | ||
#hosts: ["localhost:8080"] | ||
---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-php_fpm-pool,pool>> | ||
|
||
include::php_fpm/pool.asciidoc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[[metricbeat-metricset-php_fpm-pool]] | ||
include::../../../module/php_fpm/pool/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-php_fpm,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/php_fpm/pool/_meta/data.json[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM richarvey/nginx-php-fpm | ||
|
||
RUN echo "pm.status_path = /status" >> /etc/php7/php-fpm.d/www.conf | ||
ADD ./php-fpm.conf /etc/nginx/sites-enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#- module: php_fpm | ||
#metricsets: ["pool"] | ||
#enabled: true | ||
#period: 10s | ||
#status_path: "/status" | ||
#hosts: ["localhost:8080"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
== PHP-FPM Module | ||
|
||
This module periodically fetches metrics from https://php-fpm.org[PHP-FPM] | ||
servers. | ||
|
||
[float] | ||
=== Module-Specific Configuration Notes | ||
|
||
You need to enable the PHP-FPM status page by properly configuring | ||
`pm.status_path`. | ||
|
||
Here is a sample nginx configuration to forward requests to the PHP-FPM status | ||
page (assuming `pm.status_path` is configured with default value `/status`): | ||
```nginx | ||
location ~ /status { | ||
allow 127.0.0.1; | ||
deny all; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass 127.0.0.1:9000; | ||
} | ||
``` | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
The PHP-FPM metricsets were tested with PHP 5.6.29 and are expected to | ||
work with all versions >= 5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- key: php_fpm | ||
title: "php_fpm" | ||
description: > | ||
PHP-FPM server status metrics collected from PHP-FPM. | ||
experimental[] | ||
short_config: false | ||
fields: | ||
- name: php_fpm | ||
type: group | ||
description: > | ||
`php_fpm` contains the metrics that were obtained from PHP-FPM status | ||
page call. | ||
fields: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
server { | ||
listen 81; ## listen for ipv4; this line is default and implied | ||
listen [::]:81 default ipv6only=on; ## listen for ipv6 | ||
|
||
# Make site accessible from http://localhost/ | ||
server_name _; | ||
|
||
error_log /dev/stdout info; | ||
access_log /dev/stdout; | ||
|
||
location ~ /status { | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_pass unix:/var/run/php-fpm.sock; | ||
include fastcgi_params; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
Package php_fpm is a Metricbeat module that contains MetricSets. | ||
*/ | ||
package php_fpm |
Oops, something went wrong.