handle docker host in prometheus config

This commit is contained in:
Ludovic Cartier 2022-11-11 17:37:46 +01:00
parent 39d281a300
commit 213eb0639d

View File

@ -338,3 +338,20 @@ scrape_configs:
regex: '(.*):9150' regex: '(.*):9150'
replacement: '${1}' replacement: '${1}'
{% endif %} {% 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 %}