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.j25
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
index 98ac1aaa..883aa223 100644
--- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2
@@ -30,6 +30,11 @@ scrape_configs:
{% if prometheus_server_web_external_url is defined %}
metrics_path: '{{ (prometheus_server_web_external_url | urlsplit('path'), 'metrics') | path_join }}'
{% endif %}
+{% if prometheus_server_selfscraping_auth is defined %}
+ basic_auth:
+ username: '{{ prometheus_server_selfscraping_auth.username }}'
+ password_file: '/etc/prometheus/prometheus-selfscraping.password'
+{% endif %}
static_configs:
- targets: ['localhost:9090']
labels: