Remove port from node hosts

Add a relabel rule to the "node" job to hide the port number from instances names.
This commit is contained in:
Tom 2022-06-01 15:25:02 +02:00 committed by GitHub
parent 7551f42e0c
commit 2ec46198ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,11 @@ scrape_configs:
{% for target in prometheus_node_exporter_targets %} {% for target in prometheus_node_exporter_targets %}
- {{ target }}:9100 - {{ target }}:9100
{% endfor %} {% endfor %}
relabel_configs:
- source_labels: [ __address__ ]
target_label: instance
regex: '(.*):9100'
replacement: '${1}'
{% endif %} {% endif %}
{% if prometheus_mysqld_exporter_targets is defined %} {% if prometheus_mysqld_exporter_targets is defined %}