Hi All,
I am having a bit of a problem with authenticating against an endpoint to get metrics.
I have setup Traefik as a reverse proxy with authentication in place. If i test via a web browser I authenticate and cant view the metrics. When I setup Prometheus to do this i get an error saying not authorised. "server returned HTTP status 401 Unauthorized"
Here is my config with IPs removed:
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
rule_files:
- /opt/prometheus/prometheus/rules/alert.cpu.yml
- /opt/prometheus/prometheus/rules/alert.memory.yml
scrape_configs:
- job_name: prometheus
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: mail
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- xx.xx.xx.xx
basic_auth:
username: test2
password: <secret>I have the latest version of prometheus 2.2.1.
Can anyone help and tell me what I am doing wrong please?
Thanks!