summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-09-23 16:50:24 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-09-23 16:50:24 +0200
commitef4432c51bacb5b92c03a42cb1ea7f9d837ec8b6 (patch)
treeffd0fc43be052f9c4b6848f2c7bccd3e0b1aa71f /roles/monitoring/prometheus/server/templates/prometheus.yml.j2
parentmove exporter_exporter configuration into canonical config dir (diff)
use / as spereator for jobs formerly known as special
Diffstat (limited to 'roles/monitoring/prometheus/server/templates/prometheus.yml.j2')
-rw-r--r--roles/monitoring/prometheus/server/templates/prometheus.yml.j25
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
index 4a079896..8156341d 100644
--- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
@@ -6,6 +6,9 @@ global:
rule_files:
- /etc/prometheus/rules/*.yml
+{% for subdir in (prometheus_server_jobs | select('match', '.*/.*') | map('dirname') | unique) %}
+ - /etc/prometheus/rules/{{ subdir }}/*.yml
+{% endfor %}
{% if prometheus_server_alertmanager is defined %}
alerting:
@@ -37,7 +40,7 @@ scrape_configs:
{% endif %}
{% for job in (prometheus_server_jobs) %}
-{% include 'job-snippets/' + (lookup('first_found', {'paths': ['templates/job-snippets'], 'files': [job + '.j2', 'generic.j2']}) | basename) %}{{ '' }}
+{% include lookup('first_found', {'paths': ['templates/job-snippets'], 'files': [job + '.j2', 'generic.j2']}) | relpath(template_fullpath | dirname) %}{{ '' }}
{% endfor %}
{% if prometheus_server_jobs_extra is defined %}