# -*- coding: utf-8 -*- # vim: ft=yaml --- chaos-role: - prometheus-master - prometheus-node_exporter prometheus: wanted: - prometheus - node_exporter service: prometheus: args: storage.tsdb.retention.time: 90d web.listen-address: 0.0.0.0:9090 log.level: warn config: prometheus: global: external_labels: monitor: '.chaos' scrape_configs: - job_name: 'prometheus' static_configs: - targets: - prometheus.chaos:9090 - job_name: mysqld static_configs: - targets: - mariadb.lan:9104 - job_name: mqtt.mosquitto static_configs: - targets: - mqtt.chaos:9234 - job_name: haproxy static_configs: - targets: - drucki.wks:9101 - riot01.chaos:9101 - auto:9101 - job_name: klipper static_configs: - targets: - drucki.wks:3903 - job_name: octoprint metrics_path: '/plugin/prometheus_exporter/metrics' params: apikey: ['30E8B01BFD674E5BBD446D08C4730DF4'] static_configs: - targets: - drucki.wks:80 - job_name: openhab2 metrics_path: '/' static_configs: - targets: - auto.chaos:9999 - job_name: 'node' static_configs: - targets: - dumont.chaos:9100 - dumont.wks:9100 #- dumont2.chaos:9100 {% set roles = salt.saltutil.runner('mine.get', tgt='*', fun='chaos_roles', tgt_type='glob' ) %} {% for host,role in roles.items() %} {% if 'prometheus-node_exporter' in role %} - {{ host }}{{ salt['pillar.get']('prometheus:service:node_exporter:args:web.listen-address', ':9100') }} {% endif %} {% endfor %}