From bd79baa0eb7f52301877e2306ac00c7dd691ea2b Mon Sep 17 00:00:00 2001 From: "tom.chivert" Date: Thu, 27 Oct 2022 11:16:50 +0200 Subject: [PATCH] Add a relabel config for mysqld exporter targets port --- templates/conf/prometheus.yml.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index b785439..0176e91 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -69,6 +69,11 @@ scrape_configs: - {{ target }}:9104 {% endfor %} {% endif %} + relabel_configs: + - source_labels: [ __address__ ] + target_label: instance + regex: '(.*):9104' + replacement: '${1}' {% endif %} {% if prometheus_mongodb_exporter_targets is defined %}