summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/prometheus/server/templates/prometheus.yml.j2')
-rw-r--r--roles/monitoring/prometheus/server/templates/prometheus.yml.j211
1 files changed, 10 insertions, 1 deletions
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
index 09d5452d..d72a4815 100644
--- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
@@ -45,7 +45,7 @@ scrape_configs:
- targets: ['localhost:9090']
labels:
instance: '{{ inventory_hostname }}'
-{% if prometheus_server_alertmanager is defined %}
+{% if prometheus_server_alertmanager is defined and 'scrape_instance' in prometheus_server_alertmanager %}
- job_name: 'alertmanager'
{% if 'path_prefix' in prometheus_server_alertmanager %}
@@ -58,6 +58,8 @@ scrape_configs:
{% endif %}
static_configs:
- targets: ['{{ prometheus_server_alertmanager.url }}']
+ labels:
+ instance: '{{ prometheus_server_alertmanager.scrape_instance }}'
{% endif %}
{% for job in (prometheus_server_jobs) %}
@@ -94,3 +96,10 @@ scrape_configs:
- targets: ['{{ config.url }}']
{% endfor %}
{% endfor %}
+{% if prometheus_server_remote_write_destinations is defined %}
+
+remote_write:
+{% for name, config in prometheus_server_remote_write_destinations.items() %}
+ - {{ config | combine({'name': name }) | to_nice_yaml(indent=2) | indent(4) }}
+{% endfor %}
+{% endif %}