diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index 7bfc860..187b3e7 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -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