Skip to content

PowerDNS

Prometheus Metrics

PowerDNS is a high-performance DNS server available as an Authoritative Server and a Recursor. Starting with Authoritative Server 4.3+ and Recursor 4.5+, PowerDNS exposes a built-in Prometheus metrics endpoint through its web server.

Enable the built-in web server in your PowerDNS configuration (/etc/powerdns/pdns.conf):

webserver=yes
webserver-address=127.0.0.1
webserver-port=8081
webserver-allow-from=127.0.0.1
api=yes
api-key=changeme

Restart PowerDNS to apply the change:

Terminal window
sudo systemctl restart pdns

Verify the metrics endpoint is accessible:

Terminal window
curl http://localhost:8081/metrics

For more details, see the PowerDNS HTTP API documentation.

Terminal window
sudo tee /etc/glouton/conf.d/99-powerdns.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:8081/metrics"
name: "powerdns"
allow_metrics:
- "pdns_auth_queries"
- "pdns_auth_answers"
- "pdns_auth_cache_hits"
- "pdns_auth_cache_misses"
- "pdns_auth_latency_average"
- "pdns_auth_udp_answers"
EOF

Glouton automatically detects configuration changes.

Metric Description
pdns_auth_queries Total number of DNS queries received
pdns_auth_answers Total number of DNS answers sent
pdns_auth_cache_hits Total number of packet cache hits
pdns_auth_cache_misses Total number of packet cache misses
pdns_auth_latency_average Average query latency in microseconds
pdns_auth_udp_answers Total number of answers sent over UDP