/metrics in the Prometheus text format. Prometheus scrapes them,
Grafana graphs them, and the alert rules that come with DNZ tell you when something is off. You run
Prometheus and Grafana wherever you like; they only need to reach DNZ.
What is in there:
- queries by source (local, cache, upstream, blocked…), response code, type and transport, and a latency histogram,
- the cache: hits, misses, stale answers, prefetches, evictions,
- every upstream’s health, round-trip time and failures,
- blocked queries, RPZ hits, the per-client rate limit and response rate limiting,
- DNSSEC validation results and the recursive resolver,
- zone transfers, NOTIFY, secondary zones and dynamic updates,
- proxying on or off, proxies by kind, certificate expiry, dnz-proxy nodes, Traefik and Caddy proxies, GeoDNS health checks and the Caddy/Traefik record syncs.
Turn them on
Open Settings → General → Prometheus metrics, switch it on and pick where it is served:
Make a token creates a bearer token Prometheus sends with every scrape. It is shown once: copy
it. A scrape without it, or with the wrong one, gets
401.
The card then shows a scrape config for Prometheus, filled in with DNZ’s address as your browser
reaches it (change it to the address Prometheus uses), and a curl line to check it from the
Prometheus host.
The same from the terminal:
Scrape it
Add a job toprometheus.yml on the Prometheus server. With a token, keep it in a file only
Prometheus can read:
dnz_build_info carries its node id, dnz_cluster_leader and
dnz_cluster_generation its place in the cluster), and metrics settings saved on one node reach the
others within 15 seconds. Check it from the Prometheus host:
Prometheus and Grafana with Docker Compose
Themonitoring/ folder on the public
repository has a compose file that runs Prometheus (with DNZ’s alert rules) and Grafana (with the
dashboard and the data source already set up) for a DNZ that runs elsewhere:
DNZ_TARGET is host:port as Prometheus reaches DNZ: the own listen address, or the dashboard’s
address with DNZ_SCHEME=https behind TLS. Grafana is on port 3000 (user admin), Prometheus on
9090.
Grafana dashboard
Download the dashboard, import it (Dashboards → New → Import, upload the file) and pick your Prometheus data source:Alert rules
Download the rules next toprometheus.yml:
Add the file to
rule_files in prometheus.yml. The rules expect the job to be called dnz.
Metrics reference
DNZ describes every metric it exports: each one comes with a# HELP line in the scrape output
(curl …/metrics as above). A few to start with:
Labels never carry query names or client addresses, so the number of series stays small; query
types outside the common ones are counted as
other.