-
Notifications
You must be signed in to change notification settings - Fork 1
/
prometheus.yml
55 lines (47 loc) · 1.38 KB
/
prometheus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
global:
scrape_interval: 5s
# Alerting section
{% if groups['prometheus_alertmanager'] | length == 1 and deploy_prometheus_alertmanager %}
alerting:
alertmanagers:
- static_configs:
- targets:
{% for host in groups['prometheus_alertmanager'] -%}
- {{ host }}:{{prometheus_alertmanager_port}}
{% endfor %}
{% endif %}
rule_files:
- /etc/prometheus/rules/*.yaml
scrape_configs:
# Please uncomment this section if you need metrics from prometheus itself
# - job_name: prometheus
# static_configs:
# - targets:
# - {% for host in groups['prometheus_server'] -%}{{ host }}{% endfor %}:{{prometheus_port}}
{% for host_group in groups -%}
{% if host_group.startswith('agents') %}
- job_name: {{ host_group }}
static_configs:
{% for host in groups[host_group] -%}
{% if hostvars[host]['deploy_node_exporter'] %}
- targets:
- {{ host }}:{{node_exporter_port}}
labels:
inventory_hostname: {{ host }}
{% endif -%}
{% if hostvars[host]['deploy_pcm'] %}
- targets:
- {{ host }}:{{pcm_port}}
labels:
inventory_hostname: {{ host }}
{% endif -%}
{% if hostvars[host]['deploy_collectd'] %}
- targets:
- {{ host }}:{{collectd_port}}
labels:
inventory_hostname: {{ host }}
{% endif -%}
{% endfor %}
{% endif %}
{% endfor %}
# Please put you extra exporter configuration here: