31 lines
850 B
YAML
31 lines
850 B
YAML
global:
|
|
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
|
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
|
# scrape_timeout is set to the global default (10s).
|
|
|
|
alerting:
|
|
alertmanagers:
|
|
- static_configs:
|
|
- targets: ['localhost:9093']
|
|
|
|
rule_files:
|
|
# - "first_rules.yml"
|
|
|
|
scrape_configs:
|
|
- job_name: 'prometheus'
|
|
scrape_interval: 5s
|
|
scrape_timeout: 5s
|
|
static_configs:
|
|
- targets: ['localhost:9090']
|
|
|
|
{% for group in groups.keys() | reject('all') | reject('ungrouped') %}
|
|
- job_name: {{ group }}
|
|
static_configs:
|
|
{% for host in groups[group] %}
|
|
- targets: ["{{ hostvars[host]['monitoring_ip'] | default(hostvars[host]['ip']) }}:9100"]
|
|
labels:
|
|
instance: "{{ host }}:9100"
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|