-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New PHP-FPM metricbeat module #3415
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
539f229
Metricbeat php-fpm module
7047806
PR review: refactor data structures
4f87ead
PR review: minor changes
3de7963
PR review: use HostParser.QueryString
a36196f
PR review: no need for "var address"
60bba3a
PR review: remove proc metricset (metrics does not seems really useful)
7294c40
PR review: reduced metric set to a bare minimum
9bc8a1a
Generate artifacts
28352de
Remove uneeded bool flag
f7ea5e6
PR review: add structures
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,65 @@ | ||
//// | ||
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 | ||
hosts: ["localhost"] | ||
|
||
---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-php_fpm-pool,pool>> | ||
|
||
* <<metricbeat-metricset-php_fpm-proc,proc>> | ||
|
||
include::php_fpm/pool.asciidoc[] | ||
|
||
include::php_fpm/proc.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
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-proc]] | ||
include::../../../module/php_fpm/proc/_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/proc/_meta/data.json[] | ||
---- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the default port the metrics are exposed? 80 or is it 9000 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
php-fpm default port is
9000
and default status endpoint is/status
. But these defaults does matter much since it'sfastcgi
protocol and can't be accessed directly. So there is a need to configure a proxy (withfastcgi
support) and that can be any port and path (no defaults)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, problem is with the above port 80 is the default. Not sure what we should set here best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use the "default non-default" 8080 (which is at least nginx's default, iirc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM