From ba9f48e1f9397e0bc5b82a8d52245f2412ec481e Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 21 Apr 2023 16:35:56 +0200 Subject: [PATCH] add relabel for mongo and postgres --- templates/conf/prometheus.yml.j2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index 2af5922..995d3cc 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -97,6 +97,11 @@ scrape_configs: - {{ target }}:9216 {% endfor %} {% endif %} + relabel_configs: + - source_labels: [ __address__ ] + target_label: instance + regex: '(.*):9216' + replacement: '${1}' {% endif %} {% if prometheus_postgres_exporter_targets is defined %} @@ -120,6 +125,11 @@ scrape_configs: - {{ target }}:9187 {% endfor %} {% endif %} + relabel_configs: + - source_labels: [ __address__ ] + target_label: instance + regex: '(.*):9187' + replacement: '${1}' {% endif %} {% if prometheus_phpfpm_exporter_targets is defined %}