From 213eb0639d6a46e3fa71ddb067e264f39e32e081 Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 11 Nov 2022 17:37:46 +0100 Subject: [PATCH] handle docker host in prometheus config --- templates/conf/prometheus.yml.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index dd57e88..c58ba69 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -338,3 +338,20 @@ scrape_configs: regex: '(.*):9150' replacement: '${1}' {% endif %} + +{% if prometheus_docker_exporter_targets is defined %} + # Docker exporter # + - job_name: docker + scrape_interval: 30s + scrape_timeout: 10s + static_configs: + - targets: +{% for target in prometheus_memcached_exporter_targets %} + - {{ target }}:9323 +{% endfor %} + relabel_configs: + - source_labels: [ __address__ ] + target_label: instance + regex: '(.*):9323' + replacement: '${1}' +{% endif %}