opcache v2

This commit is contained in:
jean-yves.fournier 2022-01-05 16:00:23 +01:00
parent 14baee3d40
commit 024b001bea
7 changed files with 12 additions and 12 deletions

View File

@ -15,7 +15,7 @@ prometheus_mongodb_exporter_port: 27017
prometheus_phpfpm_sockets_directory: "/run/php/" prometheus_phpfpm_sockets_directory: "/run/php/"
prometheus_phpfpm_sockets_directory_additional: "/var/run/php*.sock" prometheus_phpfpm_sockets_directory_additional: "/var/run/php*.sock"
prometheus_php-opcache_exporter_fcgi-uri: "unix:///var/run/php-000-default.sock" prometheus_opcache_exporter_fcgi-uri: "unix:///var/run/php-000-default.sock"
prometheus_postgres_exporter_systemd_user: "postgres" prometheus_postgres_exporter_systemd_user: "postgres"
prometheus_postgres_exporter_host: "/var/run/postgresql/" prometheus_postgres_exporter_host: "/var/run/postgresql/"

View File

@ -40,9 +40,9 @@
enabled: yes enabled: yes
tags: ['prometheus'] tags: ['prometheus']
- name: 'prometheus | php-opcache exporter | restart service' - name: 'prometheus | opcache exporter | restart service'
systemd: systemd:
name: prometheus-php-opcache-exporter.service name: prometheus-opcache-exporter.service
state: restarted state: restarted
enabled: yes enabled: yes
tags: ['prometheus'] tags: ['prometheus']

View File

@ -36,9 +36,9 @@
- "'phpfpm' in prometheus_exporter_packages" - "'phpfpm' in prometheus_exporter_packages"
- name: 'prometheus | PHP opcache exporter' - name: 'prometheus | PHP opcache exporter'
include_tasks: 'php-opcache_exporter.yml' include_tasks: 'opcache_exporter.yml'
when: when:
- "'php-opcache' in prometheus_exporter_packages" - "'opcache' in prometheus_exporter_packages"
- name: 'prometheus | Apache exporter' - name: 'prometheus | Apache exporter'
include_tasks: 'apache_exporter.yml' include_tasks: 'apache_exporter.yml'

View File

@ -1,4 +1,4 @@
# {{ ansible_managed }} # {{ ansible_managed }}
{% if (prometheus_php-opcache_exporter_fcgi-uri is defined) %} {% if (prometheus_opcache_exporter_fcgi-uri is defined) %}
ARGS='"--opcache.fcgi-uri="{{ prometheus_php-opcache_exporter_fcgi-uri }}"' ARGS='"--opcache.fcgi-uri="{{ prometheus_opcache_exporter_fcgi-uri }}"'
{% endif %} {% endif %}

View File

@ -124,14 +124,14 @@ scrape_configs:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if prometheus_php-opcache_exporter_targets is defined %} {% if prometheus_opcache_exporter_targets is defined %}
# PHP-FPM exporter # # PHP-FPM exporter #
- job_name: php-opcache - job_name: opcache
scrape_interval: 30s scrape_interval: 30s
scrape_timeout: 10s scrape_timeout: 10s
static_configs: static_configs:
- targets: - targets:
{% for target in prometheus_php-opcache_exporter_targets %} {% for target in prometheus_opcache_exporter_targets %}
- {{ target }}:9101 - {{ target }}:9101
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -4,8 +4,8 @@ After=network.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/local/bin/prometheus-php-opcache-exporter ExecStart=/usr/local/bin/prometheus-opcache-exporter
EnvironmentFile=/etc/default/prometheus-php-opcache-exporter EnvironmentFile=/etc/default/prometheus-opcache-exporter
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target