From 1c0bd2ae111b57ba9366587d1c4542655b215d14 Mon Sep 17 00:00:00 2001 From: Marcus Klein Date: Mon, 18 Dec 2023 09:50:24 +0100 Subject: [PATCH] Add Prometheus Mysqld exporter Change-Id: I670597179b701aab1ca8e433be2f3abf1e78650a --- prometheus/README.rst | 23 +++++++++++++++++++++++ prometheus/installMysqldExporter.yml | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 prometheus/installMysqldExporter.yml diff --git a/prometheus/README.rst b/prometheus/README.rst index 49f8c238..cc47da19 100644 --- a/prometheus/README.rst +++ b/prometheus/README.rst @@ -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 diff --git a/prometheus/installMysqldExporter.yml b/prometheus/installMysqldExporter.yml new file mode 100644 index 00000000..7f80405d --- /dev/null +++ b/prometheus/installMysqldExporter.yml @@ -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"