Enable mysqld_exporter for prometheus hosts

This commit is contained in:
Timo Makinen 2024-02-17 17:59:16 +00:00
parent 8bc5793d70
commit 1f3e76e4f6
3 changed files with 22 additions and 0 deletions

View file

@ -96,6 +96,8 @@ print:
prometheus:
hosts:
prometheus02.home.foo.sh:
vars:
mysqld_exporter_version: "0.15.1"
proxy:
hosts:
proxy01.home.foo.sh:

View file

@ -26,3 +26,4 @@
roles:
- base
- prometheus
- mysqld_exporter

View file

@ -10,6 +10,25 @@ scrape_configs:
- targets:
- "127.0.0.1:9090"
- job_name: mysqld
scheme: https
tls_config:
ca_file: "{{ tls_certs }}/ca.crt"
key_file: "{{ tls_private }}/{{ inventory_hostname }}.key"
cert_file: "{{ tls_certs }}/{{ inventory_hostname }}.crt"
static_configs:
- targets:
{% for host in groups['sqldb'] %}
- {{ host }}:3306
{% endfor %}
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: {{ inventory_hostname }}:9104
- job_name: snmp
scheme: https
tls_config: