wrouesnel / pdns_exporter

a quick and simple powerdns exporter for metrics via the control socket interface
Apache License 2.0
11 stars 5 forks source link

Build Status Coverage Status Go Report Card

PowerDNS Prometheus Exporter

An alternate spin on a PowerDNS exporter which works using metrics read from the PowerDNS control-socket, rather than the REST API. This makes it compatible with older versions of PowerDNS, and avoids the need to turn on or secure the REST API if it is not needed.

Since older versions of powerDNS blocked the serving loop while metrics are being read, rate-limiting functionality is included and turned ON by default - that is, multiple prometheus scrapes will be limited by a cool-down period (by default 10 seconds).

If you are using a newer version (PowerDNS 4+) then this problem does not apply as metric scrapes are atomic, and you can disable it for more precise metrics.

CLI Options

Monitoring pdns_recursor

pdns_recursor uses a unixgram rather then unix control socket. To monitor a pdns_recursor process use the following settings:

$ ./pdns_exporter.x86_64 -collector.powerdns.socket=recursor:unixgram:/run/pdns_recursor.controlsocket

The process also needs to run as the same user as pdns itself, otherwise control socket replies won't work. The -collector.powerdns.local-socket.mode option can help in this regard by altering the permissions on the launched process to be looser. The default is 640.