Skip to content
Snippets Groups Projects
Verified Commit 22aee436 authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

prometheus: restrict vhost handling to http_prometheus

Makes prometheus.yml less noisy and doesn't break when non-vhost
mappings are added to blackbox_targets.
parent a1cc586d
No related branches found
No related tags found
No related merge requests found
Pipeline #17493 passed
......@@ -155,6 +155,7 @@ scrape_configs:
{% for target in blackbox_targets[module] | select('string') %}
- {{ target }}
{% endfor %}
{% if module == 'http_prometheus' %}
{% for vhost in blackbox_targets[module] | select('mapping') %}
- targets:
{% for target in vhost.targets %}
......@@ -163,6 +164,7 @@ scrape_configs:
labels:
vhost: {{ vhost.hostname }}
{% endfor %}
{% endif %}
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
......@@ -170,8 +172,10 @@ scrape_configs:
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115
{% if module == 'http_prometheus' %}
- source_labels: [vhost]
target_label: __param_hostname
{% endif %}
{% endfor %}
{% for endpoint in matrix_metrics_endpoints %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment