2018-12-06 02:59:47 +08:00
|
|
|
global:
|
|
|
|
scrape_interval: 15s
|
|
|
|
evaluation_interval: 15s
|
|
|
|
|
|
|
|
rule_files:
|
2019-02-16 03:27:15 +08:00
|
|
|
- '/etc/prometheus/alerting/*'
|
2018-12-06 02:59:47 +08:00
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: 'prometheus'
|
|
|
|
static_configs:
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['localhost:{{ prometheus_port }}']
|
2018-12-06 02:59:47 +08:00
|
|
|
- job_name: 'ceph'
|
|
|
|
honor_labels: true
|
|
|
|
static_configs:
|
2020-09-11 23:25:57 +08:00
|
|
|
{% for host in groups[mgr_group_name] | default(groups[mon_group_name]) %}
|
2018-12-06 02:59:47 +08:00
|
|
|
- targets: ['{{ host }}:9283']
|
|
|
|
labels:
|
|
|
|
instance: 'ceph_cluster'
|
|
|
|
{% endfor %}
|
|
|
|
- job_name: 'node'
|
|
|
|
static_configs:
|
2020-07-25 06:05:41 +08:00
|
|
|
{% for host in (groups['all'] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, [])))) %}
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
2018-12-06 02:59:47 +08:00
|
|
|
labels:
|
|
|
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
|
|
|
{% endfor %}
|
|
|
|
- job_name: 'grafana'
|
|
|
|
static_configs:
|
2020-07-25 06:05:41 +08:00
|
|
|
{% for host in groups[monitoring_group_name] %}
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
2018-12-06 02:59:47 +08:00
|
|
|
labels:
|
|
|
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
|
|
|
{% endfor %}
|
2020-09-11 23:25:57 +08:00
|
|
|
{% if iscsi_gw_group_name in groups %}
|
2018-12-06 02:59:47 +08:00
|
|
|
- job_name: 'iscsi-gws'
|
|
|
|
static_configs:
|
2020-09-11 23:25:57 +08:00
|
|
|
{% for host in groups[iscsi_gw_group_name] %}
|
2018-12-06 02:59:47 +08:00
|
|
|
- targets: ['{{ host }}:9287']
|
|
|
|
labels:
|
|
|
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
alerting:
|
|
|
|
alertmanagers:
|
|
|
|
- scheme: http
|
|
|
|
static_configs:
|
2019-08-23 16:00:30 +08:00
|
|
|
- targets: ['{{ grafana_server_addr }}:{{ alertmanager_port }}']
|