prometheus: install alertmanager
This commit is contained in:
@@ -5,3 +5,7 @@ prometheus_evaluation_interval: 15s
|
|||||||
prometheus_storage_retention: 3650d
|
prometheus_storage_retention: 3650d
|
||||||
prometheus_install_grafana: false
|
prometheus_install_grafana: false
|
||||||
prometheus_hcloud_relabel_configs: []
|
prometheus_hcloud_relabel_configs: []
|
||||||
|
|
||||||
|
prometheus_install_alertmanager: true
|
||||||
|
|
||||||
|
alertmanager_storage_retention: "{{ prometheus_storage_retention }}"
|
||||||
|
|||||||
@@ -40,11 +40,24 @@ argument_specs:
|
|||||||
replacement:
|
replacement:
|
||||||
type: str
|
type: str
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
prometheus_install_grafana:
|
prometheus_install_grafana:
|
||||||
description: If true, installs grafana in the same docker network as prometheus and configures it with prometheus as data source
|
description: If true, installs grafana in the same docker network as prometheus and configures it with prometheus as data source
|
||||||
type: bool
|
type: bool
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
prometheus_install_alertmanager:
|
||||||
|
description: If true, installs alertmanager in the same docker network as prometheus and configures it
|
||||||
|
type: bool
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
|
||||||
|
alertmanager_storage_retention:
|
||||||
|
description: Period of time for which alertmanager data is stored for. A number followed by unit (s, m, h, d, w, y). Passed directly to alertmanager role
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
|
default: "{{ prometheus_storage_retention | default('3650d') }}"
|
||||||
|
|
||||||
|
|
||||||
# All options after this will be passed directly to the container role
|
# All options after this will be passed directly to the container role
|
||||||
docker_service_suffix:
|
docker_service_suffix:
|
||||||
|
|||||||
@@ -23,6 +23,14 @@
|
|||||||
- copypath: alerting
|
- copypath: alerting
|
||||||
path: /etc/prometheus/alerting
|
path: /etc/prometheus/alerting
|
||||||
|
|
||||||
|
- name: Alertmanager container for prometheus
|
||||||
|
include_role:
|
||||||
|
name: alertmanager
|
||||||
|
vars:
|
||||||
|
docker_networks:
|
||||||
|
- name: prometheus
|
||||||
|
when: prometheus_install_alertmanager
|
||||||
|
|
||||||
- name: Grafana container for prometheus
|
- name: Grafana container for prometheus
|
||||||
include_role:
|
include_role:
|
||||||
name: grafana
|
name: grafana
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ alerting:
|
|||||||
alertmanagers:
|
alertmanagers:
|
||||||
- static_configs:
|
- static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
# - alertmanager:9093
|
{% if prometheus_install_alertmanager %}
|
||||||
|
- alertmanager:9093
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||||
rule_files:
|
rule_files:
|
||||||
|
|||||||
Reference in New Issue
Block a user