summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-06-24 22:29:26 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-06-24 22:29:26 +0200
commit6c990fd148f8813dcbafbf2e27fa5ecbe88af5dc (patch)
tree5e1d71a45610f4c29c3679edc817b5f0aa1aed7d /roles/monitoring/prometheus/server/templates/prometheus.yml.j2
parentprometheus: connect server to alertmanager if configured (diff)
move monitoring web interfaces into common nginx vhost
Diffstat (limited to 'roles/monitoring/prometheus/server/templates/prometheus.yml.j2')
-rw-r--r--roles/monitoring/prometheus/server/templates/prometheus.yml.j29
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
index c76990f4..69d5bcdc 100644
--- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
@@ -12,10 +12,16 @@ alerting:
alertmanagers:
- static_configs:
- targets: ['{{ prometheus_server_alertmanager.url }}']
+{% if 'path_prefix' in prometheus_server_alertmanager %}
+ path_prefix: '{{ prometheus_server_alertmanager.path_prefix }}'
+{% endif %}
{% endif %}
scrape_configs:
- job_name: 'prometheus'
+{% if prometheus_server_web_external_url is defined %}
+ metrics_path: '{{ (prometheus_server_web_external_url | urlsplit('path'), 'metrics') | path_join }}'
+{% endif %}
static_configs:
- targets: ['localhost:9090']
labels:
@@ -23,6 +29,9 @@ scrape_configs:
{% if prometheus_server_alertmanager is defined %}
- job_name: 'alertmanager'
+{% if 'path_prefix' in prometheus_server_alertmanager %}
+ metrics_path: '{{ (prometheus_server_alertmanager.path_prefix, 'metrics') | path_join }}'
+{% endif %}
static_configs:
- targets: ['{{ prometheus_server_alertmanager.url }}']
{% endif %}