summaryrefslogtreecommitdiff
path: root/roles/monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring')
-rw-r--r--roles/monitoring/prometheus/server/defaults/main/main.yml5
-rw-r--r--roles/monitoring/prometheus/server/templates/prometheus.yml.j26
2 files changed, 7 insertions, 4 deletions
diff --git a/roles/monitoring/prometheus/server/defaults/main/main.yml b/roles/monitoring/prometheus/server/defaults/main/main.yml
index 61bc4323..dd290e9e 100644
--- a/roles/monitoring/prometheus/server/defaults/main/main.yml
+++ b/roles/monitoring/prometheus/server/defaults/main/main.yml
@@ -77,8 +77,9 @@ prometheus_server_web_listen_address: 127.0.0.1:9090
prometheus_server_remote_write_receiver: no
-# prometheus_server_remote_write_config:
-# - url: "https://mon.example.com/prometheus/api/v1/write"
+# prometheus_server_remote_write_destinations:
+# example:
+# url: "https://mon.example.com/prometheus/api/v1/write"
# basic_auth:
# username: remote
# password_file: /etc/prometheus/prometheus-remote.secret
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
index cf21dc80..d72a4815 100644
--- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
@@ -96,8 +96,10 @@ scrape_configs:
- targets: ['{{ config.url }}']
{% endfor %}
{% endfor %}
-{% if prometheus_server_remote_write_config is defined %}
+{% if prometheus_server_remote_write_destinations is defined %}
remote_write:
- {{ prometheus_server_remote_write_config | to_nice_yaml(indent=2) | indent(2) }}
+{% for name, config in prometheus_server_remote_write_destinations.items() %}
+ - {{ config | combine({'name': name }) | to_nice_yaml(indent=2) | indent(4) }}
+{% endfor %}
{% endif %}