github.com/netdata/go.d.plugin@v0.58.1/modules/phpfpm/integrations/php-fpm.md (about)

     1  <!--startmeta
     2  custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/phpfpm/README.md"
     3  meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/phpfpm/metadata.yaml"
     4  sidebar_label: "PHP-FPM"
     5  learn_status: "Published"
     6  learn_rel_path: "Data Collection/Web Servers and Web Proxies"
     7  most_popular: False
     8  message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
     9  endmeta-->
    10  
    11  # PHP-FPM
    12  
    13  
    14  <img src="https://netdata.cloud/img/php.svg" width="150"/>
    15  
    16  
    17  Plugin: go.d.plugin
    18  Module: phpfpm
    19  
    20  <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
    21  
    22  ## Overview
    23  
    24  This collector monitors PHP-FPM instances.
    25  
    26  
    27  
    28  
    29  This collector is supported on all platforms.
    30  
    31  This collector supports collecting metrics from multiple instances of this integration, including remote instances.
    32  
    33  
    34  ### Default Behavior
    35  
    36  #### Auto-Detection
    37  
    38  This integration doesn't support auto-detection.
    39  
    40  #### Limits
    41  
    42  The default configuration for this integration does not impose any limits on data collection.
    43  
    44  #### Performance Impact
    45  
    46  The default configuration for this integration is not expected to impose a significant performance impact on the system.
    47  
    48  
    49  ## Metrics
    50  
    51  Metrics grouped by *scope*.
    52  
    53  The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
    54  
    55  
    56  
    57  ### Per PHP-FPM instance
    58  
    59  These metrics refer to the entire monitored application.
    60  
    61  This scope has no labels.
    62  
    63  Metrics:
    64  
    65  | Metric | Dimensions | Unit |
    66  |:------|:----------|:----|
    67  | phpfpm.connections | active, max_active, idle | connections |
    68  | phpfpm.requests | requests | requests/s |
    69  | phpfpm.performance | max_children_reached, slow_requests | status |
    70  | phpfpm.request_duration | min, max, avg | milliseconds |
    71  | phpfpm.request_cpu | min, max, avg | percentage |
    72  | phpfpm.request_mem | min, max, avg | KB |
    73  
    74  
    75  
    76  ## Alerts
    77  
    78  There are no alerts configured by default for this integration.
    79  
    80  
    81  ## Setup
    82  
    83  ### Prerequisites
    84  
    85  #### Enable status page
    86  
    87  Uncomment the `pm.status_path = /status` variable in the `php-fpm` config file.
    88  
    89  
    90  
    91  ### Configuration
    92  
    93  #### File
    94  
    95  The configuration file name for this integration is `go.d/phpfpm.conf`.
    96  
    97  
    98  You can edit the configuration file using the `edit-config` script from the
    99  Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
   100  
   101  ```bash
   102  cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
   103  sudo ./edit-config go.d/phpfpm.conf
   104  ```
   105  #### Options
   106  
   107  The following options can be defined globally: update_every, autodetection_retry.
   108  
   109  
   110  <details><summary>Config options</summary>
   111  
   112  | Name | Description | Default | Required |
   113  |:----|:-----------|:-------|:--------:|
   114  | update_every | Data collection frequency. | 1 | no |
   115  | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
   116  | url | Server URL. | http://127.0.0.1/status?full&json | yes |
   117  | socket | Server Unix socket. |  | no |
   118  | address | Server address in IP:PORT format. |  | no |
   119  | fcgi_path | Status path. | /status | no |
   120  | timeout | HTTP request timeout. | 1 | no |
   121  | username | Username for basic HTTP authentication. |  | no |
   122  | password | Password for basic HTTP authentication. |  | no |
   123  | proxy_url | Proxy URL. |  | no |
   124  | proxy_username | Username for proxy basic HTTP authentication. |  | no |
   125  | proxy_password | Password for proxy basic HTTP authentication. |  | no |
   126  | method | HTTP request method. | GET | no |
   127  | body | HTTP request body. |  | no |
   128  | headers | HTTP request headers. |  | no |
   129  | not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no |
   130  | tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
   131  | tls_ca | Certification authority that the client uses when verifying the server's certificates. |  | no |
   132  | tls_cert | Client TLS certificate. |  | no |
   133  | tls_key | Client TLS key. |  | no |
   134  
   135  </details>
   136  
   137  #### Examples
   138  
   139  ##### HTTP
   140  
   141  Collecting data from a local instance over HTTP.
   142  
   143  <details><summary>Config</summary>
   144  
   145  ```yaml
   146  jobs:
   147    - name: local
   148      url: http://localhost/status?full&json
   149  
   150  ```
   151  </details>
   152  
   153  ##### Unix socket
   154  
   155  Collecting data from a local instance over Unix socket.
   156  
   157  <details><summary>Config</summary>
   158  
   159  ```yaml
   160  jobs:
   161    - name: local
   162      socket: '/tmp/php-fpm.sock'
   163  
   164  ```
   165  </details>
   166  
   167  ##### TCP socket
   168  
   169  Collecting data from a local instance over TCP socket.
   170  
   171  <details><summary>Config</summary>
   172  
   173  ```yaml
   174  jobs:
   175    - name: local
   176      address: 127.0.0.1:9000
   177  
   178  ```
   179  </details>
   180  
   181  ##### Multi-instance
   182  
   183  > **Note**: When you define multiple jobs, their names must be unique.
   184  
   185  Collecting metrics from local and remote instances.
   186  
   187  
   188  <details><summary>Config</summary>
   189  
   190  ```yaml
   191  jobs:
   192      - name: local
   193        url: http://localhost/status?full&json
   194  
   195      - name: remote
   196        url: http://203.0.113.10/status?full&json
   197  
   198  ```
   199  </details>
   200  
   201  
   202  
   203  ## Troubleshooting
   204  
   205  ### Debug Mode
   206  
   207  To troubleshoot issues with the `phpfpm` collector, run the `go.d.plugin` with the debug option enabled. The output
   208  should give you clues as to why the collector isn't working.
   209  
   210  - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
   211    your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
   212  
   213    ```bash
   214    cd /usr/libexec/netdata/plugins.d/
   215    ```
   216  
   217  - Switch to the `netdata` user.
   218  
   219    ```bash
   220    sudo -u netdata -s
   221    ```
   222  
   223  - Run the `go.d.plugin` to debug the collector:
   224  
   225    ```bash
   226    ./go.d.plugin -d -m phpfpm
   227    ```
   228  
   229