ceph-ansible/roles/ceph-prometheus/templates/prometheus.yml.j2

48 lines
1.4 KiB
Plaintext
Raw Normal View History

global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
- '/etc/prometheus/alerting/*'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:{{ prometheus_port }}']
- job_name: 'ceph'
honor_labels: true
static_configs:
{% for host in groups[mgr_group_name] | default(groups[mon_group_name]) %}
- targets: ['{{ host }}:9283']
labels:
instance: 'ceph_cluster'
{% endfor %}
- job_name: 'node'
static_configs:
{% for host in (groups['all'] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, [])))) %}
- targets: ['{{ host }}:{{ node_exporter_port }}']
labels:
instance: "{{ hostvars[host]['ansible_nodename'] }}"
{% endfor %}
- job_name: 'grafana'
static_configs:
{% for host in groups[monitoring_group_name] %}
- targets: ['{{ host }}:{{ node_exporter_port }}']
labels:
instance: "{{ hostvars[host]['ansible_nodename'] }}"
{% endfor %}
{% if iscsi_gw_group_name in groups %}
- job_name: 'iscsi-gws'
static_configs:
{% for host in groups[iscsi_gw_group_name] %}
- targets: ['{{ host }}:9287']
labels:
instance: "{{ hostvars[host]['ansible_nodename'] }}"
{% endfor %}
{% endif %}
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets: ['{{ grafana_server_addr }}:{{ alertmanager_port }}']