Use builtin autodiscovery of alertmanager
Change-Id: I36bdb3a4e90687d32724e5e248d5862567c36f83 Depends-On: I91e23f17858deb2ef937fcd42948641eb371474b
This commit is contained in:
parent
abec256072
commit
e7de11cf46
2 changed files with 27 additions and 0 deletions
|
@ -5,6 +5,25 @@ global:
|
||||||
{{ server.config.global | yaml(False) | indent(2, true) }}
|
{{ server.config.global | yaml(False) | indent(2, true) }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if server.get('config', {}).get('alertmanager') %}
|
||||||
|
alerting:
|
||||||
|
alertmanagers:
|
||||||
|
{%- for name, alertmanager in server.config.alertmanager.iteritems() %}
|
||||||
|
{%- if alertmanager.get('enabled', True) %}
|
||||||
|
# {{ name }}
|
||||||
|
{%- if alertmanager.static_configs is defined %}
|
||||||
|
- static_configs:
|
||||||
|
- targets: {{ alertmanager.static_configs.get('target', [])|yaml }}
|
||||||
|
{%- elif alertmanager.dns_sd_configs is defined %}
|
||||||
|
- dns_sd_configs:
|
||||||
|
- names: {{ alertmanager.dns_sd_configs.get('domain', [])|yaml }}
|
||||||
|
type: {{ alertmanager.dns_sd_configs.type }}
|
||||||
|
port: {{ alertmanager.dns_sd_configs.port }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
rule_files:
|
rule_files:
|
||||||
- alerts.yml
|
- alerts.yml
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,14 @@ prometheus:
|
||||||
evaluation_interval: "1m"
|
evaluation_interval: "1m"
|
||||||
external_labels:
|
external_labels:
|
||||||
region: 'region1'
|
region: 'region1'
|
||||||
|
alertmanager:
|
||||||
|
docker_swarm_alertmanager:
|
||||||
|
enabled: true
|
||||||
|
dns_sd_configs:
|
||||||
|
domain:
|
||||||
|
- tasks.monitoring_alertmanager
|
||||||
|
type: A
|
||||||
|
port: 9093
|
||||||
docker:
|
docker:
|
||||||
host:
|
host:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
Loading…
Reference in a new issue