diff --git a/prometheus/defaults/main.yml b/prometheus/defaults/main.yml index 9e759d360515811b33461ebb1be71d26b54d9c40..d47a22c02ea69378139d38ab79a2d5f3afa066ef 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 a6e70959f6dcfaa6be95886310b922f9d078b741..d8f11923d028b7b64b3843cef2ec48a0d41dd6a5 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'