add custom labels for mysqld

This commit is contained in:
Ludovic Cartier 2021-10-29 17:40:18 +02:00
parent 7366735a89
commit 97a4f54b40

View File

@ -47,11 +47,22 @@ scrape_configs:
scrape_interval: 30s
scrape_timeout: 10s
static_configs:
{% if prometheus_mysqld_exporter_custom is defined %}
{% for target in prometheus_mysqld_exporter_custom.values() %}
- targets: ['{{ target.node_name }}:9104']
labels:
environment: '{{ target.environment }}'
node_name: '{{ target.node_name }}'
service_name: '{{ target.service_name }}'
cluster: '{{ target.cluster }}'
{% endfor %}
{% else %}
- targets:
{% for target in prometheus_mysqld_exporter_targets %}
- {{ target }}:9104
{% endfor %}
{% endif %}
{% endif %}
{% if prometheus_mongodb_exporter_targets is defined %}
- job_name: mongodb