diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-10-27 23:54:16 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-10-27 23:54:16 +0200 |
commit | 152652bf3df22bd4687012e3b372cd00760bf1cd (patch) | |
tree | 6a1b984f8d0c835b87403b02115d98a6c54a20ac /roles/monitoring/prometheus/server/templates | |
parent | prometheus add basic auth to alert-manager (diff) |
restore promethues self-scraping if auth is used
Diffstat (limited to 'roles/monitoring/prometheus/server/templates')
-rw-r--r-- | roles/monitoring/prometheus/server/templates/prometheus.yml.j2 | 5 |
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: |