From 5a6cafa2102cdd6e9f25ae5a67ff5e9f01dec22c Mon Sep 17 00:00:00 2001 From: Piotr Parczewski Date: Mon, 22 Mar 2021 12:53:44 +0100 Subject: [PATCH] Add Alertmanger metric target(s) This commit enables scraping of Alertmanager metrics. Change-Id: I69f4ac7de0f95eff393d9658af396e3c04824c8f --- ansible/roles/prometheus/templates/prometheus.yml.j2 | 7 +++++++ .../notes/add-alertmanager-metrics-a8d87b0793f2255a.yaml | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 releasenotes/notes/add-alertmanager-metrics-a8d87b0793f2255a.yaml diff --git a/ansible/roles/prometheus/templates/prometheus.yml.j2 b/ansible/roles/prometheus/templates/prometheus.yml.j2 index fa0aabba02..27e7cac247 100644 --- a/ansible/roles/prometheus/templates/prometheus.yml.j2 +++ b/ansible/roles/prometheus/templates/prometheus.yml.j2 @@ -128,6 +128,13 @@ scrape_configs: {% endif %} {% if enable_prometheus_alertmanager | bool %} + - job_name: alertmanager + static_configs: + - targets: +{% for host in groups['prometheus-alertmanager'] %} + - '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['prometheus_alertmanager_port'] }}' +{% endfor %} + alerting: alertmanagers: - static_configs: diff --git a/releasenotes/notes/add-alertmanager-metrics-a8d87b0793f2255a.yaml b/releasenotes/notes/add-alertmanager-metrics-a8d87b0793f2255a.yaml new file mode 100644 index 0000000000..5a7854fb9f --- /dev/null +++ b/releasenotes/notes/add-alertmanager-metrics-a8d87b0793f2255a.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add support for Alertmanager metrics scraping in Prometheus.