Basic auth config for alertmanager in prometheus.yml

45 views
Skip to first unread message

Philipp Wieseckel

unread,
Aug 10, 2020, 4:46:03 AM8/10/20
to Prometheus Users
Hi there,

i am using prometheus installed via docker and behind an Apache reverse proxy with basic auth.
I tried to give prometheus the username and password to connect to basic auth and send alerts to alertmanager, unfortunately i cant get it to work. Usually the container wont even start as it says the config is malformed as i put in the basic auth parameters.

Alertmanager section of prometheus.yml looks like this:

alerting:
  alertmanagers:
    - scheme: https
      path_prefix: /alertmanager
      static_configs:
        - targets:
                - prometheus.domain.com

wherever i put my basic auht here it does not work.

Can anyone enlighten me what im doing wrong?

Best regards
Philipp

Brian Candler

unread,
Aug 10, 2020, 11:33:06 AM8/10/20
to Prometheus Users
The documentation at https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config shows how to configure it, but you haven't shown what you tried.

According to the documentation:

alerting:
  alertmanagers:
    - scheme: https
      path_prefix: /alertmanager
      basic_auth:
        username: admin
        password: tcpip123

Philipp Wieseckel

unread,
Aug 13, 2020, 4:18:47 AM8/13/20
to Prometheus Users
Thank you Brian,

works like breeze now, i've read the documentation but somehow did not manage to put the variables at the right place seems i have to learn mor about YAML.

Thanks to you again Brian!
Reply all
Reply to author
Forward
0 new messages