From dbe4f3eb8816d4e0542e79bbbc05b21d30e0633c Mon Sep 17 00:00:00 2001 From: Thomas Schneider <tschneider@asta.rwth-aachen.de> Date: Sun, 12 Apr 2020 19:01:31 +0200 Subject: [PATCH] =?UTF-8?q?prometheus:=20Fix=20scraping=20prometheus?= =?UTF-8?q?=E2=80=99=20own=20metrics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prometheus/defaults/main.yml | 1 + prometheus/templates/prometheus.yml.j2 | 1 + 2 files changed, 2 insertions(+) diff --git a/prometheus/defaults/main.yml b/prometheus/defaults/main.yml index 9e759d3..d47a22c 100644 --- a/prometheus/defaults/main.yml +++ b/prometheus/defaults/main.yml @@ -1,5 +1,6 @@ --- prometheus_args: "" +prometheus_metrics_path: /metrics # This variable intentionally left null. They need to exist, so that the # template works, but they need to have a value (empty string does not work). prometheus_rules: null diff --git a/prometheus/templates/prometheus.yml.j2 b/prometheus/templates/prometheus.yml.j2 index a6e7095..d8f1192 100644 --- a/prometheus/templates/prometheus.yml.j2 +++ b/prometheus/templates/prometheus.yml.j2 @@ -18,6 +18,7 @@ scrape_configs: # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s scrape_timeout: 5s + metrics_path: '{{ prometheus_metrics_path }}' static_configs: - targets: - 'localhost:9090' -- GitLab