Skip to content

Commit

Permalink
Make basic_auth for prometheus and promtail optional (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
simcod authored Sep 11, 2024
1 parent f2c3897 commit 9d22b64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ alerting:
{% if prometheus_remote_write_url %}
remote_write:
- url: {{ prometheus_remote_write_url }}
{% if prometheus_remote_write_basic_auth_username is defined and prometheus_remote_write_basic_auth_password is defined %}
basic_auth:
username: {{ prometheus_remote_write_basic_auth_username }}
password: {{ prometheus_remote_write_basic_auth_password }}
{% endif %}
{% endif %}

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
Expand Down
2 changes: 2 additions & 0 deletions partition/roles/promtail/templates/promtail.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ positions:
clients:
- url: {{ promtail_loki_push_endpoint }}
timeout: 60s
{% if promtail_loki_basic_auth_username is defined and promtail_loki_basic_auth_password is defined %}
basic_auth:
username: {{ promtail_loki_basic_auth_username }}
password: {{ promtail_loki_basic_auth_password }}
{% endif %}

scrape_configs:
{{ promtail_scrape_configs|to_yaml(indent=2) }}

0 comments on commit 9d22b64

Please sign in to comment.