Add Prometheus Mysqld exporter

Change-Id: I670597179b701aab1ca8e433be2f3abf1e78650a
This commit is contained in:
Marcus Klein 2023-12-18 09:50:24 +01:00
parent 322d014d04
commit 1c0bd2ae11
2 changed files with 40 additions and 0 deletions

View File

@ -34,3 +34,26 @@ Install node_exporter
cd /opt/openstack-ansible-ops/prometheus
openstack-ansible installNodeExporter.yml
If you want to deploy the mysqld_exporter, you need to create the Galera user for it first
.. code-block:: yaml
galera_additional_users:
- name: "exporter"
host: '%'
password: "{{ prometheus_mysqld_exporter_galera_password }}"
priv: '*.*:PROCESS,REPLICATION CLIENT,SELECT,SLAVE MONITOR'
resource_limits:
MAX_USER_CONNECTIONS: 3
check_hostname: false
state: present
Then install the mysqld_exporter
.. code-block:: bash
cd /opt/openstack-ansible-ops/prometheus
openstack-ansible installMysqldExporter.yml

View File

@ -0,0 +1,17 @@
---
- name: Refresh local facts
hosts: galera_all
tasks:
- name: refresh local facts
setup:
- name: mysqld_exporter
hosts: galera_all
roles:
- role: prometheus.prometheus.mysqld_exporter
vars:
mysqld_exporter_host: "{{ ansible_host }}"
mysqld_exporter_password: "{{ prometheus_mysqld_exporter_galera_password }}"
mysqld_exporter_web_listen_address: "{{ ansible_host }}:9104"