Preface
This is a fork of the original PowerDNS exporter from https://github.com/ledgr/powerdns_exporter based on the last commit 633ebaa348a20bab3db4339dd6494a1a235aee27.
The original project seems to be abandoned.
This fork removes the depenency for the osbolete Go version 1.5, adds go modules support and replace the github.com/prometheus/common/log
module.
The prometheus/common/log
module has been deprecated and removed in version 0.27.0 of the Prometheus client library, see https://github.com/prometheus/common/pull/306
The docker image and it's reference has been removed. A seperate docker image will not be provided as it can be easily build if the environment requires it.
PowerDNS Exporter
PowerDNS exporter for Prometheus
Periodically scrapes metrics via the PowerDNS HTTP-API and exports them via HTTP/JSON for consumption by Prometheus.
The following PowerDNS products are supported
- Authoritative Server
- Recursor
- Dnsdist (coming soon)
Flags
Name | Description | Default |
---|---|---|
listen-address | Host:Port pair to run exporter on | :9120 |
metric-path | Path under which to expose metrics for Prometheus | /metrics |
api-url | Base-URL of PowerDNS authoritative server/recursor API | http://localhost:8001/ |
api-key | PowerDNS API Key | - |
The api-url
flag value should be passed in this format:
- PowerDNS server/recursor 3.x:
http://
: / - PowerDNS server/recursor 4.x:
http://
: /api/v1
Installation
Build the binary by running make build
. A stripped and, if upx
has been found compressed by UPX, binary can be obtained by running make strip
.
List of make targets
Target name | Description |
---|---|
all |
Same as make depend build strip install |
build |
Build binary in bin/ |
clean |
Remove binary from bin/ |
depend |
Fetch dependencies |
destdirs |
Create installation directories |
distclean |
Remove build binary and dependency packages |
install |
Same as make strip destdirs install-bin |
install-bin |
Install binary in the filesystem under /usr/bin |
strip |
Strip binary and compress binary using UPX if upx has been found |
uninstall |
Remove binary from installation directory /usr/bin |
Usage
See here for instructions on how to enable the HTTP API in PowerDNS.
Then run the exporter like this:
bin/powerdns_exporter api-url="http://: -api-key="/ " "
Show help:
bin/powerdns_exporter --help