add cadvisor to prometheus server config

This commit is contained in:
Ludovic Cartier 2022-11-16 11:42:58 +01:00
parent 901f850093
commit dab6c43169

View File

@ -355,3 +355,19 @@ scrape_configs:
regex: '(.*):9323'
replacement: '${1}'
{% endif %}
{% if prometheus_cadvisor_exporter_targets is defined %}
# cadvisor #
- job_name: cadvisor
scrape_interval: 30s
static_configs:
- targets:
{% for target in prometheus_cadvisor_exporter_targets %}
- {{ target }}:8080
{% endfor %}
relabel_configs:
- source_labels: [ __address__ ]
target_label: instance
regex: '(.*):8080'
replacement: '${1}'
{% endif %}