~xenrox/ansible

301baebc9d7cd8682ab179a3c35685468cecd84b — Thorben Günther 2 years ago ad7b407
prometheus: Improve instance labelling

Removed ports and changed localhost to xenrox.net for better
readability.
2 files changed, 10 insertions(+), 3 deletions(-)

M roles/prometheus/templates/prometheus.yml.j2
M roles/prometheus/vars/main.yml
M roles/prometheus/templates/prometheus.yml.j2 => roles/prometheus/templates/prometheus.yml.j2 +10 -2
@@ 2,8 2,8 @@
alerting:
  alertmanagers:
    - static_configs:
      - targets:
        - localhost:9093
        - targets:
            - localhost:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:


@@ 13,5 13,13 @@ scrape_configs:
  - job_name: "node_exporter"
    static_configs:
      {% for server in prometheus_clients %}

      - targets: ["{{ server }}:9100"]
        labels:
          instance: "{{ server }}"

      {% endfor %}

      - targets: ["localhost:9100"]
        labels:
          instance: "xenrox.net"

M roles/prometheus/vars/main.yml => roles/prometheus/vars/main.yml +0 -1
@@ 7,4 7,3 @@ prometheus_packages:

prometheus_clients:
  - fenrir.xenrox.net
  - localhost