I have a PowerDNS Authoritative Server 4.8.3 instance deployed in docker with (among others) the following configuration:
- PDNS_api=yes
- PDNS_api_key=<api_key>
- PDNS_webserver=yes
- PDNS_webserver-allow-from=127.0.0.1,10.0.0.0/8,172.0.0.0/8,192.168.0.0/16
- PDNS_webserver_address=0.0.0.0
- PDNS_webserver_password=<password>
but I can't get access to the /metrics endpoint with Prometheus. I always get an HTTP 401 whatever configuration I try (with credentials and/or basic auth).
I get the same thing when trying directly with curl
curl -v -H 'X-API-Key: <api_key>' -u":<password>" http://pdns:8081/metrics
curl -v -u":<password>" http://pdns:8081/metrics
curl -v -H 'X-API-Key: <api_key>' http://pdns:8081/metrics`
But i'v always the same error :
* Trying 192.168.96.9:8081...
* Connected to pdns (192.168.96.9) port 8081 (#0)
> GET /metrics HTTP/1.1
> Host: pdns:8081
> User-Agent: curl/7.88.1
> Accept: */*
> X-API-Key: <api_key>
< HTTP/1.1 401 Unauthorized
< Connection: close
< Content-Length: 12
< Content-Type: text/plain; charset=utf-8
< Www-Authenticate: Basic realm="PowerDNS"`
What am I missing?
Thanks !
use "#" as user
and for prometheus