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:
|
2021-07-02 21:13:43 +08:00
|
|
|
- targets: ['{{ grafana_server_addr }}:{{ 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:
|
2021-05-25 15:26:28 +08:00
|
|
|
{% for host in (groups['all'] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, []))) | union(groups.get(osd_group_name, []))) %}
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
2018-12-06 02:59:47 +08:00
|
|
|
labels:
|
2021-03-03 22:43:50 +08:00
|
|
|
instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
{% 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:
|
2021-03-03 22:43:50 +08:00
|
|
|
instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
{% endfor %}
|
|
|
|
alerting:
|
|
|
|
alertmanagers:
|
|
|
|
- scheme: http
|
|
|
|
static_configs:
|
2019-08-23 16:00:30 +08:00
|
|
|
- targets: ['{{ grafana_server_addr }}:{{ alertmanager_port }}']
|