eRadical.php_fpm_exporter
php-fpm-exporter
PHP-FPM exporter for Prometheus from https://github.com/bakins/php-fpm-exporter
Role Variables
php_fpm_exporter_version: The version of the exporter to download from the above repository.
php_fpm_exporter_system_group: The group under which the executable will be saved and run. Defaults to
php_fpm_exporter
.php_fpm_exporter_system_user: The user under which the executable will be saved and run.
php_fpm_exporter_export_ip: The IP address that the exporter will use. Defaults to
ansible_eth0.ipv4.address
.php_fpm_pools: You can define multiple exporters for each PHP-FPM pool or each docker container running PHP-FPM. The playbook will create a systemd service for each pool.
For each pool, you need to provide:
- name: (required) The name of the pool, used in the systemd service name.
- export_port: (required) The port that the exporter will use; necessary for scraping from Prometheus.
You also need to specify one of the following:
- fastcgi_endpoint: Connects directly to the PHP-FPM process to get statistics.
- http_endpoint: Connects through the local web server. Remember, you must configure the web server to expose this.
You can use php_fpm_pools
in your Prometheus server to specify what to scrape.
Example Playbook
Add the following to your playbook:
- hosts: servers
roles:
- role: eRadical.php-fpm-exporter
Example of pools:
php_fpm_pools:
- name: www
export_port: 8080
fastcgi_endpoint: tcp://127.0.0.1:9000/status
- name: another_pool
export_port: 8081
http_endpoint: http://127.0.0.1:9000/status
License
- GPLv3
- Based mostly on https://github.com/cloudalchemy/ansible-node-exporter
ansible-galaxy install eRadical.php_fpm_exporter