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:
|
|
|
|
{% for host in groups['mgrs'] | default(groups['mons']) %}
|
|
|
|
- targets: ['{{ host }}:9283']
|
|
|
|
labels:
|
|
|
|
instance: 'ceph_cluster'
|
|
|
|
{% endfor %}
|
|
|
|
- job_name: 'node'
|
|
|
|
static_configs:
|
2019-05-23 22:21:08 +08:00
|
|
|
{% if grafana_server_group_name in groups %}
|
|
|
|
{% for host in (groups['all'] | difference(groups[grafana_server_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:
|
2019-05-23 22:21:08 +08:00
|
|
|
{% for host in groups[grafana_server_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 %}
|
2019-05-23 22:21:08 +08:00
|
|
|
{% else %}
|
|
|
|
{% for host in groups['all'] %}
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
2019-05-23 22:21:08 +08:00
|
|
|
labels:
|
|
|
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2018-12-06 02:59:47 +08:00
|
|
|
{% 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:
|
2019-07-11 05:15:45 +08:00
|
|
|
- targets: ['{{ grafana_server_addr | default(_current_monitor_address) }}:{{ alertmanager_port }}']
|