global: scrape_interval: 15s evaluation_interval: 15s rule_files: - '/etc/prometheus/alerting/*' scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['localhost:9090'] - job_name: 'ceph' honor_labels: true static_configs: {% for host in groups['mgrs'] | default(groups['mons']) %} - targets: ['{{ host }}:9283'] labels: instance: 'ceph_cluster' {% endfor %} - job_name: 'node' static_configs: {% if grafana_server_group_name in groups %} {% for host in (groups['all'] | difference(groups[grafana_server_group_name])) %} - targets: ['{{ host }}:9100'] labels: instance: "{{ hostvars[host]['ansible_nodename'] }}" {% endfor %} - job_name: 'grafana' static_configs: {% for host in groups[grafana_server_group_name] %} - targets: ['{{ host }}:9100'] labels: instance: "{{ hostvars[host]['ansible_nodename'] }}" {% endfor %} {% else %} {% for host in groups['all'] %} - targets: ['{{ host }}:9100'] labels: instance: "{{ hostvars[host]['ansible_nodename'] }}" {% endfor %} {% endif %} {% if 'iscsigws' in groups %} - job_name: 'iscsi-gws' static_configs: {% for host in groups['iscsigws'] %} - targets: ['{{ host }}:9287'] labels: instance: "{{ hostvars[host]['ansible_nodename'] }}" {% endfor %} {% endif %} alerting: alertmanagers: - scheme: http static_configs: - targets: ['{{ grafana_server_addr | default(_current_monitor_address) }}:9093']