telegraf/plugins/inputs/phpfpm
Paweł Żak c76f319b84
chore: Remove `revive:unhandled-error` - `errcheck` is more flexible (#13008)
2023-04-03 07:19:43 -06:00
..
README.md feat(tools/readme_linter): Check for global configuration section (#12426) 2023-01-12 16:55:21 +01:00
child.go chore: Remove `revive:unhandled-error` - `errcheck` is more flexible (#13008) 2023-04-03 07:19:43 -06:00
fcgi.go chore: Don't use all default exclude patterns for golangci-lint (#12969) 2023-03-29 09:50:00 +02:00
fcgi_client.go chore: Fix linter findings for errorlint (part6) (#12733) 2023-03-01 22:19:38 +01:00
fcgi_test.go chore: Fix linter findings for errorlint (part6) (#12733) 2023-03-01 22:19:38 +01:00
phpfpm.go chore: Fix linter findings for errorlint (part6) (#12733) 2023-03-01 22:19:38 +01:00
phpfpm_test.go chore: Fix linter findings for nolintlint (part2) (#12430) 2023-01-26 11:27:32 +01:00
sample.conf chore(inputs_m-z): migrate sample configs into separate files (#11133) 2022-05-18 11:31:34 -05:00

README.md

PHP-FPM Input Plugin

Get phpfpm stats using either HTTP status page or fpm socket.

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Read metrics of phpfpm, via HTTP status page or socket
[[inputs.phpfpm]]
  ## An array of addresses to gather stats about. Specify an ip or hostname
  ## with optional port and path
  ##
  ## Plugin can be configured in three modes (either can be used):
  ##   - http: the URL must start with http:// or https://, ie:
  ##       "http://localhost/status"
  ##       "http://192.168.130.1/status?full"
  ##
  ##   - unixsocket: path to fpm socket, ie:
  ##       "/var/run/php5-fpm.sock"
  ##      or using a custom fpm status path:
  ##       "/var/run/php5-fpm.sock:fpm-custom-status-path"
  ##      glob patterns are also supported:
  ##       "/var/run/php*.sock"
  ##
  ##   - fcgi: the URL must start with fcgi:// or cgi://, and port must be present, ie:
  ##       "fcgi://10.0.0.12:9000/status"
  ##       "cgi://10.0.10.12:9001/status"
  ##
  ## Example of multiple gathering from local socket and remote host
  ## urls = ["http://192.168.1.20/status", "/tmp/fpm.sock"]
  urls = ["http://localhost/status"]

  ## Duration allowed to complete HTTP requests.
  # timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

When using unixsocket, you have to ensure that telegraf runs on same host, and socket path is accessible to telegraf user.

Metrics

  • phpfpm
    • tags:
      • pool
      • url
    • fields:
      • accepted_conn
      • listen_queue
      • max_listen_queue
      • listen_queue_len
      • idle_processes
      • active_processes
      • total_processes
      • max_active_processes
      • max_children_reached
      • slow_requests

Example Output

phpfpm,pool=www accepted_conn=13i,active_processes=2i,idle_processes=1i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083331187
phpfpm,pool=www2 accepted_conn=12i,active_processes=1i,idle_processes=2i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083691422
phpfpm,pool=www3 accepted_conn=11i,active_processes=1i,idle_processes=2i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083691658