Categorygithub.com/fuze/powerdns_exporter
repositorypackage
0.0.0-20211206203602-92fe7ed63926
Repository: https://github.com/fuze/powerdns_exporter.git
Documentation: pkg.go.dev

# README

PowerDNS Exporter

Travis

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


Flags

NameDescriptionDefault
listen-addressHost:Port pair to run exporter on:9120
metric-pathPath under which to expose metrics for Prometheus/metrics
api-urlBase-URL of PowerDNS authoritative server/recursor APIhttp://localhost:8081/api/v1/
api-keyPowerDNS API Key-

The api-url flag value should be passed in this format:

  • PowerDNS server/recursor 3.x: http://<HOST>:<API-PORT>/
  • PowerDNS server/recursor 4.x: http://<HOST>:<API-PORT>/api/v1/

Building

git clone https://github.com/fuze/powerdns_exporter.git
cd powerdns_exporter
docker run -it -v $(pwd):/powerdns_exporter golang:1.12 /bin/bash
cd /powerdns_exporter
go get github.com/prometheus/client_golang/prometheus
go get github.com/sirupsen/logrus
go get gopkg.in/alecthomas/kingpin.v2
make build

A Makefile is provided in case you find a need for it.

Usage

See here for instructions on how to enable the HTTP API in PowerDNS.

Then run the exporter like this:

powerdns_exporter -api-url="http://<HOST>:<API-PORT>/api/v1/" -api-key="<YOUR_API_KEY>"

Show help:

powerdns_exporter --help