From 1a7d06d83d41b343a48c181cb47c4c9974a5626a Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 22 Jun 2026 18:04:40 +0200 Subject: Refactor installing grafana dashboards using URL only Refactor prometheus extra scraping jobs --- roles/prometheus/templates/prometheus.yml.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'roles/prometheus/templates') diff --git a/roles/prometheus/templates/prometheus.yml.j2 b/roles/prometheus/templates/prometheus.yml.j2 index c43864ea..f7f2ae24 100644 --- a/roles/prometheus/templates/prometheus.yml.j2 +++ b/roles/prometheus/templates/prometheus.yml.j2 @@ -15,3 +15,11 @@ scrape_configs: - targets: {{ prometheus_node_exporter_targets | to_yaml }} scrape_interval: {{ prometheus_scrape_interval }} metrics_path: /metrics +{% for job in prometheus_extra_scrape_configs %} + + - job_name: '{{ job.name }}' + static_configs: + - targets: {{ job.targets | to_yaml }} + scrape_interval: {{ job.scrape_interval | default(prometheus_scrape_interval) }} + metrics_path: {{ job.metrics_path | default('/metrics') }} +{% endfor %} -- cgit v1.2.3