Skip to content

Logs and metrics

The server writes its log to standard output, and it serves Prometheus metrics at http://127.0.0.1:9153/metrics. The log says what happened and why, one event to a line. The metrics say how much happened, as numbers that a dashboard or an alert reads. The query log is a third record, of each question a client asked, and The query log covers it.

The log goes to standard output, so whatever started the server keeps it:

How the server runs Where to read the log
The systemd unit of Install and run journalctl -u tadoru, and journalctl -fu tadoru to follow it
The compose file in packaging/ docker compose logs tadoru, run in packaging/
A container started by hand docker logs and the name of the container
A checkout, with cargo run The terminal

By default the server keeps no log file of its own, and it rotates nothing. Rotation and retention belong to the journal or to the container runtime. log_file_days in node.toml turns on a file for each day in the state root, as The log file says.

No line holds a password or a private key. The setup token of the first start goes to a terminal alone, and never to the journal or to docker logs.

Each line is best effort, at every level, at the start, at the stop and for errors. A line first waits in a queue of 16 384 lines and 8 MiB, the pipe. One thread, log, takes each line from the pipe. It hands the line to a second queue of 16 384 lines and 8 MiB. A second thread, log-out, writes that queue to standard output.

The thread log also keeps the recent lines of the log in memory. It keeps them in a ring of 10,000 lines or 4 MiB, whichever comes first, and a restart empties it. A line longer than 64 KiB is kept there as its first 64 KiB, with the mark [cut at 64 KiB] at its end. The two queues and the ring take up to about 24 MiB of memory: 20 MiB of lines, and about 4 MiB of slots, entries and headers.

A reader that stops reading, such as a paused terminal or a stuck log collector, holds log-out alone. The thread log and the pipe go on, the server goes on answering, and a stop still ends. Where the queue of standard output is full, a new line is dropped whole for standard output, and is not written later. When that queue has room again, the log says how many lines it dropped, with the line the log dropped lines, because standard output did not take them.

A stop waits, for 2 seconds at most, until standard output took each line still in its queue when the stop came. A full queue does not keep the stop out. A second signal ends the stop half a second after it at most, where that comes first, and then the exit status is 1. Lines that still wait then are lost, and no counter counts them. The users and the changes of the configuration are not log lines. auth.sqlite and the command ledger keep them whatever happens to the log.

Standard error is outside the queue. A panic message and the last error of a start that fails go to it through a thread of their own, errors. That thread waits 1 second at most for it. A reader that stops reading standard error then costs a thread that panics one second at most. A start that fails still ends with status 1. Where standard error does not take a message within its second, the message waits while the process lives, and the exit loses it.

Nine messages at most are held at once. A message past them is dropped. The next message that is made says how many were dropped before it, on a line of its own. A message longer than 64 KiB is cut, and ends with [the message was cut at 64 KiB].

The message has the form of Rust: the thread, its id, the place in the code and the reason. With RUST_BACKTRACE=1 it also holds the short backtrace, which starts at the code that panicked. A panic inside a task names the task too, as in the task 42. The line of the log that says the task ended, the task 42 panicked; its message is on standard error, names the same number. The commands other than the server write standard error at once, as before.

A line holds no text from outside the code of the server that no check bounded. The server keeps the recent lines in memory, in the ring, and an operator reads them through the API:

  • A refusal of a file names the file, the setting, the line and the rule, and not the value. tadoru config validate of the file gives the whole reason.
  • A URL shows its scheme and its host alone, such as https://lists.example, never its path, its query or a user and a password.
  • A problem of an ACME authority names its step and its type, never its detail.
  • A failed TLS handshake names the kind of the failure, such as the name does not match. It never names a name that the certificate of the peer presents.
  • A task that panicked or stopped is named by its id, as the task 42 panicked; its message is on standard error. The message of the panic goes to standard error alone, as the paragraph above says.
  • A failed login names a name only where an account has that name, and says an unknown name otherwise. It never holds a password.
  • A line of the DNS client of the API names the outcome of each attempt. It holds the problem of an attempt only where the server wrote that text itself. The reason of a failed TLS handshake, the type of an HTTP reply and the text of a broken rule of HTTP/2 stay out. The answer of the route holds them. Three things come only where store_names was on as the query started and is on as the line is written: the name of the question, the host name of the target and the problems of the attempts. The outcome of the line is that of the network part. The conversion of the reply can still answer too-large, malformed or timeout.
  • The ring takes the lines of the server alone. A line of a library, such as rustls, hyper or quinn, never reaches the ring, at any level.
  • A span of a library exists only where TADORU_LOG names that library, or names a span. A log_level or a TADORU_LOG of debug or trace alone makes no span of a library. So each line of the server reaches the ring at those levels too. Where a span of a library exists, a line of the server inside it stays out of the ring. Standard output keeps such lines, because the operator of the machine asked for them there, and they can hold what a peer sent.

An error that stops the start goes to standard error whole, as the message of a panic does. It never goes to standard output or the ring.

An operator or an admin reads the lines of the ring with GET /api/logs. A viewer gets 403. On the socket the route needs a token or a session too. The lines hold the names of accounts, the addresses of clients and the paths of files.

  • The ring holds what the log writes, at the levels that log_level and TADORU_LOG let through. It holds none of the four lines that log_resolution_errors = false drops (Drop the lines about a failed resolution).
  • level, since and until filter the lines. before reads a page of the past, and after reads the lines that came since the last poll.
  • reset: true says that the server started again since the cursor, and the page holds the newest lines. gap counts the lines that left the ring between the cursor and its oldest line.
  • Two reads run at once for the whole server. A third gets 429 logs-busy, with Retry-After: 1.
  • A page holds up to 1000 lines. It stops at the first line that takes its JSON to 1 MiB or past it. So it can hold that line more, about 1.38 MiB at most.
  • A page that the client does not take within 30 seconds of its build loses its bytes. Its connection closes gracefully: on HTTP/2 the other streams of that connection finish within 10 seconds, and then it ends. The deadline bounds how long the server keeps the page, from its build. A client that reads less than about 47 KiB a second can lose a page of 1.38 MiB. It asks for fewer lines with limit.
  • With store_names off, a line at info or warn names no query. At debug and trace the log names queries whatever store_names says, and the route shows what the log wrote.

API Reference gives each parameter and the fields of the answer.

Set log_file_days in node.toml to a number of days, from 1 to 365. The server then writes the log to a file for each day as well: STATE/logs/tadoru-YYYY-MM-DD.log. The day is the day in UTC. Where log_local_time is on, it is the day in the time zone of the machine (see Write the time in the zone of the machine). log_file_mib, 256 MiB by default, is the most room that the files take in all. A revision applies both at once, with no restart.

  • The directory is at mode 0700, and each file at mode 0600. A file holds the same lines as standard output, the lines of the libraries too, in the form of log_format.

  • When the file turns on, it first gets the lines that the ring of recent lines held since the start, oldest first, and then each new line. Then one line says what the file got: the log file starts with the lines that the ring held since the start, at INFO. Where some of those lines are missing, the line is at WARN and says how many:

    • unavailable for the lines that the ring no longer held.
    • excluded for those that the queue of the file had no room for.
    • failed for those that the file did not take.

    This line obeys the level of the log, so log_level = "error" hides it. It is best effort: new lines can come before it, and a full queue can drop it.

  • The ring keeps no line of a library, so the first lines of the file hold only the lines of the server itself. A line longer than 64 KiB is in them as its first 64 KiB, with the mark [cut at 64 KiB].

  • log_file_days = 0 turns the file off. The files stay as they are. A later revision that turns the file on again in the same run first writes the lines that the ring still holds from the time the file was off. It writes no line twice.

  • The day of a line is the day at which the thread of the file takes it. So a line of an event just before midnight can be in the file of the next day.

  • The server deletes the oldest file other than that of the day where the files would pass log_file_mib. Where the file of the day alone is past it, the file takes no line for the rest of the day, and the older files stay.

  • The cap counts only the files with the name of a day that are regular files of the server with one link. Any other entry of logs/ is left as it is, out of the count, with one warning. Such an entry is a link, or a file of another user with the name of a day.

  • The cap can delete the files of earlier days of this run, but never the file of the day.

  • A file of an earlier day goes after log_file_days days, counted back from the newest file or from today, whichever is earlier. A file that this run wrote stays until log_file_days times 24 hours passed since its last line, also where the clock moved.

  • Before each line, the server checks that the file system of the state root keeps a floor of free room: 5% of it, or 256 MiB, whichever is smaller. Under the floor, the file takes no line for a minute, so the log never takes the room that the configuration and the databases need. This check reserves no room. Another program that writes to the same file system can still fill it.

  • A panic message and the last error of a start that fails go to standard error alone, and are never in the file.

  • The file is best effort, as the rest of the log. The server syncs nothing, so a loss of power can lose the lines of the last seconds. The queue of the file holds 4 096 lines and 4 MiB. So the log takes about 34 MiB of memory at most with the file on.

dns_log_dropped_total counts each line that the file does not take, as file_full, file_write_failed or file_queue_full. The log file takes no line has the warnings and what to do.

Each line holds five parts: the time, the level, the part of the server that wrote it, the message, and the fields of the event. The time is in UTC, or in the zone of the machine (see below):

2026-10-17T03:04:05.123456Z INFO tadoru: storage roots config=/etc/tadoru state=/var/lib/tadoru runtime=/run/tadoru

The part before the colon is the target. It is the crate that wrote the line, or resolution for the four lines about a fault of one answer. Examples are tadoru, pipeline and resolver. A module can follow the crate, as in resolver::iterate. The fields are name=value pairs after the message. A field holds the details, so a message stays the same text from one event to the next, and you can search for it.

The levels are, from the most to the least serious:

Level What it means
ERROR Something failed and the server carries on without it, such as a metrics port that is taken
WARN Something went wrong that a person can act on, such as a blocklist source that does not answer
INFO A thing the server did once, such as a start, a new revision or a stop
DEBUG The detail of one event, such as a forwarded suffix that answered nothing
TRACE Every step, for one investigation at a time

The text form has no color codes, on a terminal and in the journal or docker logs alike. So a line reads the same wherever it lands, and a search or a parser sees no escape bytes. NO_COLOR changes nothing, because the server never writes color.

The server writes text lines by default. The setting log_format in node.toml chooses the form: "text" or "json". A new value takes effect with the revision that holds it, and the server needs no restart. A value that is neither is refused, as any other bad value in the file is. The names are in lower case.

log_format = "json"

The environment variable TADORU_LOG_FORMAT chooses the same form and wins over the file. The server reads the variable once at the start, so a new value needs a restart. Where the variable is set, a revision that changes log_format changes nothing. The log says so once in a WARN line, where the level in force shows warnings. A value of the variable that is neither text nor json is ignored. The server logs one WARN line at the start that names the value and the two choices. Then the file chooses.

With json each line is one JSON object. The message and each field of the event are keys of the object, beside level and target. The key timestamp is in UTC, or in the zone of the machine where log_local_time is on:

{"timestamp":"2026-10-17T03:04:05.123456Z","level":"INFO","message":"storage roots","config":"/etc/tadoru","state":"/var/lib/tadoru","runtime":"/run/tadoru","target":"tadoru"}

Where log_level is "trace", or TADORU_LOG turns on trace for server, a line that is written inside a query carries two more keys, span and spans. They hold the client and the transport of the query. The span of a query exists at trace level only, so at other levels these keys are absent.

The first line of a start is already in the form that log_format names. The server reads the node.toml of the config root before it writes that line. Where that file is missing or does not read, it reads the file of the configuration that ran last, and then it uses the defaults. A file that reads but that the start then refuses gives the first lines its form. The first revision moves the log to the form of the configuration that runs. The log then says that the format changed.

Where the deployment and not the file decides, such as a container image, set TADORU_LOG_FORMAT the way the server is run:

Terminal window
# The systemd unit. This opens an override file for the unit in an editor.
sudo systemctl edit tadoru
[Service]
Environment=TADORU_LOG_FORMAT=json
Terminal window
sudo systemctl restart tadoru
# The compose file: add this under the tadoru service, then run `docker compose up -d`.
environment:
TADORU_LOG_FORMAT: json
Terminal window
# A checkout.
TADORU_LOG_FORMAT=json cargo run --release -- --data-dir ./data

The journal stores a JSON line as text, as it stores any other line. journalctl -u tadoru shows the object whole, and it does not split the keys into fields of its own. A collector, such as Vector, Promtail or Fluent Bit, makes the keys searchable. It reads the journal or docker logs and parses each line as JSON. journalctl -u tadoru -o cat | jq . reads them by hand.

Four lines report a fault of one answer. Each carries the target resolution in place of the path of its module. Three are about an alias chain:

  • An answer whose chain is longer than the server tests.
  • An answer with two aliases of one name.
  • An answer whose alias owns other data.

The fourth is a reply that changed the case of the question. A line names the question only where store_names is on, and only for the question of the client and the steps of its walk.

On a server that answers many clients, one bad name can write many such lines. Set log_resolution_errors = false in node.toml and the log drops the four, before any form writes them and before the ring holds them. A revision applies the setting at once, with no restart.

The lines about the server itself stay:

  • A route that strips the signatures of the root.
  • A source address that a query cannot take.
  • A forwarder that stays down.
  • A root or anchors that cannot be fetched.

Three lines about one resolution stay too. They are security events or facts about a server:

  • An answer that failed DNSSEC validation.
  • The two refusals of rebinding.
  • A name server that answered for a zone it does not hold.

The environment variable TADORU_LOG wins over the setting, as it does for log_level. Where it is set, a revision that changes the setting, in either direction, changes nothing. The log says so in a WARN line for each change. The line also comes where the variable already drops the four lines. To drop the lines under TADORU_LOG, add the directive: TADORU_LOG=info,resolution=off.

A level for the module, such as TADORU_LOG=pipeline=debug or the pipeline=debug of TADORU_LOG=info,pipeline=debug, no longer covers these four lines. They follow resolution=..., such as TADORU_LOG=info,resolution=warn.

The server applies the setting at the first revision after the start. So a line of this kind that the start itself writes before then is kept.

By default each line carries the time in UTC, with a Z. Set log_local_time = true in node.toml and each line carries the time in the time zone of the machine, with its offset, in both forms:

2026-11-06T17:02:03.123456+01:00 INFO tadoru: storage roots config=/etc/tadoru state=/var/lib/tadoru runtime=/run/tadoru

A revision applies the setting at once, with no restart.

  • The offset is the one that the machine has at that moment. The server looks it up every 10 seconds and at each revision that turns the setting on. So across the change of the clock for summer, a line can carry the old offset for up to 10 seconds. The time of such a line and its offset still name the right moment.
  • The server reads the zone once, from TZ or from /etc/localtime. A change of the zone of the machine, to another place, shows after a restart. The change of the clock for summer does not need one.
  • The day of a log file follows the same zone, so the file of a day ends at local midnight. With the setting changed, the file of the day can change at once, to the day in the other zone. While the setting is on, the cap and the removal of old files keep two files. These are the file of the day in UTC and the file of the local day. So the change deletes no file of a day that still runs in UTC.
  • A machine with no zone gives UTC. The server finds it in one of two ways. Either TZ is unset and there is no /etc/localtime, or TZ names a file that is not there and is no rule of POSIX. TZ follows the rules of the C library. A leading : is dropped. Where TZDIR is set, it is the only place of the zone files. With no zone the lines carry +00:00. One WARN line says that the machine has no zone that the server can read. A revision that turns the setting on says it again. The server asks only at that revision, so a zone file that goes away later changes nothing until a restart.
  • GET /api/logs is not changed. Its at_ms and its filters stay in UTC whatever the setting. Only the text of a line shows the local time.

The setting log_level in node.toml chooses what is logged. The default is "info", which shows INFO, WARN and ERROR lines from every part of the server. The other levels are "error", "warn", "debug" and "trace". A new value takes effect with the revision that holds it, and the server needs no restart. The log says when the level changes, in an INFO line. A change to a quieter level says it before the change takes effect, where the old level shows INFO lines.

The first lines of a start use the louder of two levels. One is the level in the file. The other is the level of the configuration that ran last. So a refusal of an edit that asks for "error" still shows, where the configuration that ran last shows warnings. A warning about TADORU_LOG, TADORU_LOG_FORMAT or RUST_LOG raises the first lines to warn as well, so the warning shows. The quieter level then takes effect with the first revision.

log_level = "debug"

The environment variable TADORU_LOG chooses what is logged too, and it wins over the file. The server reads the variable once at the start, so a new value needs a restart. Where the variable is set, a revision that changes log_level changes nothing. The log says so once in a WARN line, where the level in force shows warnings. A value that does not read is ignored. The server logs one WARN line at the start that names the value. Then the file chooses.

The server does not read RUST_LOG, which many programs written in Rust read. So a value meant for another program of the host changes nothing here. Where RUST_LOG is set and TADORU_LOG is not, the server logs one warning at the start that says so.

The HTTP and QUIC libraries stay at INFO where the level for every part is louder. This holds for log_level and for TADORU_LOG alike: at "debug" and "trace", the log leaves out their debug and trace lines. Those lines dump each frame and each packet, and they hide the lines of the server. The names are h2, h3, hyper, quinn, rustls, tokio_rustls and tower. A name covers each target that starts with it: quinn covers quinn_proto and quinn_udp, hyper covers hyper_util, and tower covers tower_http. Their WARN and ERROR lines still show. The rule leaves out mio and notify, which are not HTTP or QUIC libraries.

To get the lines of a library back, name it in TADORU_LOG, such as TADORU_LOG=debug,h2=debug. A name also brings back its family: quinn=debug brings back quinn_proto, and quinn_proto=debug brings back quinn as well. Only a name of the library does it. A level for one span, such as [request]=trace, does not. log_level has no such name, so it cannot bring a library back.

log_level takes one level for everything else. TADORU_LOG takes one level for everything, a level per target, or both, in the syntax of RUST_LOG. A comma separates the parts, and the most specific part wins:

TADORU_LOG What it logs
info The default
warn Only what went wrong
info,pipeline=debug The default, and every detail of the query path
debug,h2=debug Every detail of the server, and the frames of h2 too
info,resolver=debug The default, and the detail of each upstream question and walk
info,server=trace,pipeline=trace Each query, from its transport through to its answer

pipeline=trace alone leaves out the client and the transport of a query, because the listener writes those. Name server with it to see both halves.

The targets are the crates of the server:

Target What it writes about
tadoru The start, the stop, the tasks that run beside the query path, and the metrics endpoint
server The listeners: UDP, TCP, DNS over TLS, HTTPS and QUIC
pipeline The query path: the cache, blocking, local zones, forwarding and recursion
resolver Questions to upstreams, the walk from the root, and DNSSEC validation
resolution Four lines about a fault of one answer, written by pipeline and resolver: Drop the lines about a failed resolution
cache The answer cache and its snapshot
config Revisions, the watcher of the config root, and the journals of the zones
zone Reading and changing zone files
blocklist_sources Fetching and reading blocklist sources
blocklist Compiling blocklists
acme Certificates from an ACME authority
api The HTTP API, accounts and the setup token
state The query log and the files under the state root

A level per target is a tool for one investigation. Set TADORU_LOG the way the server is run:

Terminal window
# The systemd unit. This opens an override file for the unit in an editor.
sudo systemctl edit tadoru
[Service]
Environment=TADORU_LOG=info,resolver=debug
Terminal window
sudo systemctl restart tadoru
# The compose file: add this under the tadoru service, then run `docker compose up -d`.
environment:
TADORU_LOG: info,resolver=debug
Terminal window
# A checkout.
TADORU_LOG=info,resolver=debug cargo run --release -- --data-dir ./data

A level of debug or trace for pipeline, server or resolver writes lines for each query. On a busy server that is a lot of disk in the journal. Turn it on for one investigation, and set it back after.

The log follows store_names where it can. Two lines name the question only where store_names is on: the warning a server's reply changed the case of the question and the debug line a shortened name failed. Without it each line says the same and leaves the name out. The warning names the question only for the client’s own question and the steps of its walk. A question that the server asks for itself never names it. Examples are a check of signatures, the address of a name server, a probe or the priming.

At trace the log names every query, whatever store_names says, and so do its ring and its file. The zone name of a refused zone transfer is logged at debug. Where names must stay out of the log, keep resolver and pipeline below debug, and keep log_level below trace.

Most of the time the log holds a few INFO lines at the start and one for each new revision. A WARN or an ERROR line names something to look at. Troubleshooting explains a refusal, and the message of a refusal is the same text there as here.

These lines say that a part of the server is not working, while the rest goes on answering:

Line What to do
could not serve /metrics Another program holds the port of metrics_listen. Free it, or name another address
the log dropped lines, because standard output did not take them The reader of standard output was slow or stopped. stdout_full, queue_full, too_large and write_failed count the lines lost since the last such line. stdout_full is a reader that did not keep up. queue_full now means that the thread log fell behind, not the reader. Look at the journal or the log collector
RUST_LOG is set, and this server reads TADORU_LOG instead, so RUST_LOG changes nothing Set TADORU_LOG with the same value, and restart the server
TADORU_LOG does not read as a level or a list of directives, so log_level in node.toml chooses what is logged The value of TADORU_LOG is not a level or a list of targets. The line does not quote it, because an environment can hold anything. Correct it, and restart the server
TADORU_LOG_FORMAT is not a format, so log_format in node.toml chooses how the log is written. The formats are "text" and "json" Set TADORU_LOG_FORMAT to text or json, and restart the server
TADORU_LOG is set, so log_level = "..." in node.toml changes nothing The variable wins over the file. The line also appears where the file repeats the value of the variable. Otherwise take the variable out of the environment of the server, and restart it
TADORU_LOG is set, so log_resolution_errors = ... in node.toml changes nothing The variable wins over the file, in both directions, so the four lines of the target resolution stay or go as the variable says. The line also appears where the variable already drops them. To drop them, add resolution=off to the variable, such as TADORU_LOG=info,resolution=off, or take the variable out of the environment of the server, and restart it
TADORU_LOG_FORMAT is set, so log_format = "..." in node.toml changes nothing The variable wins over the file. The line also appears where the file repeats the value of the variable. Otherwise take the variable out of the environment of the server, and restart it
the query log could not be opened, so nothing is recorded Look at the free space and the owner of the state root. After an upgrade, the error can name the free space that the copy of the log needs, or an object that depends on its table. Read The query log is off after an upgrade
the query log was damaged, so it was moved aside and a new, empty log starts. Its rows stay in the kept file, and the recover command copies them into a new file Nothing to do for DNS: a new log takes the rows of each new query. kept names the kept file, and recover is the command that gets its rows back. Read A damaged query log was moved aside
could not read the free space of the state root, so the upgrade of the query log runs without the check Nothing to do. The copy runs, and a disk that fills during it undoes it. Read The query log is off after an upgrade
the query log was still opening at the stop. A step of its upgrade that had not committed runs again at the next start, a give-back of free space that had not ended goes on at the next start, and the rows of this start are counted as lost Nothing to do. The next start runs that step again, or goes on with the give-back. Let it finish before you stop the server again. Read The query log answers query-log-starting
could not give back free space of the query log, so part of it stays in the file until the next prune Look at the error, and at the disk of the state root. The log opens anyway. The prune, once a minute, tries again while much of the file is free
could not fold the query log's write-ahead log into its file, so part of its free space stays in the file until the next prune Look at the disk of the state root. The log opens anyway. The prune, once a minute, tries again while much of the file is free. stays_bytes says how much stays
the blocklist refresh task stopped, and no source will be fetched again Restart the server. The lists it holds keep serving until then
a blocklist source could not be reached, so it keeps the content it had Look at the source URL from this machine. Alert on dns_blocklist_check_age_seconds, as Reading a list now, and taking one this server refused says
no root server answered the priming query Look at the outbound network of the machine on port 53
the cache snapshot could not be written Look at the free space of the state root. The next stop tries again
the TLS certificate did not reload, and the old one keeps serving Look at the certificate files that node.toml names
an ACME order failed A certificate from ACME has the steps of an order
the clock reads earlier than this build, so no signature can be judged and signed names outside the grace names fail Set the clock, or start the time client. The time client explains the grace names
reads of auth.sqlite ran past their budget, so their requests answered 503 accounts-busy place, thread and read count the late reads since the last such line, which comes once a minute at most. Read The API answers accounts-busy
cannot watch the configuration directory; falling back to the timer A change to a file takes effect at the next pass, at most 30 seconds later
a record is too large for a zone transfer A record of the zone fits no message, so each transfer of the zone ends with SERVFAIL. Make the record smaller. The line names its owner and its type
a write of the serial witness failed, so the change of a zone is refused Look at the disk of the state root. The error says what failed. A zone that the serial witness stops has the rest
a zone has used most of its serial space The serial of the zone has less than an eighth of its room left. A history near its end says what to do
a query of the DNS client failed A task of the DNS client panicked or was cancelled. The line names the task by its id, and the message of a panic is on standard error. That query gets no answer from the task. Another query can run once every socket of the failed query has closed
a socket of a query of the DNS client is still open, so the DNS client stays busy A socket of a query outlived its deadline by 10 seconds. The DNS client takes no other query until the socket closes, and a restart ends it

This line says that somebody guesses at an account:

Line What to do
the failed logins at one account reached the threshold of an hour, from every address together The account that account names had 50 failed logins in an hour, likely from many addresses. Nothing waits. Read An account that many addresses guess at

The first start after an upgrade copies the query log once. Then it gives the space of the old copy back to the disk, before the log is ready. While much of the file is still free space after that, the prune gives the rest back once a minute. A later start does so too. One of these INFO lines says how it ended:

Line What it means
gave back free space of the query log Done. bytes says how much went back to the disk
a reader holds the query log's write-ahead log, so part of its free space stays in the file until the next prune A backup or a long read of the log held it. stays_bytes stays in the file. The prune gives it back once the reader ends, while much of the file is free, and new rows reuse it otherwise
the stop came while the query log gave back free space. Its upgrade is done, and the next start goes on with the rest Nothing to do. stays_bytes stays in the file until the next start
the query log was made without incremental vacuum, so its free space comes back at the first prune, which rewrites it The file was not made by the server. The first prune rewrites it, and needs free space of its size for that

The endpoint serves every metric in the Prometheus text format. It listens on the loopback address by default, because the numbers describe the inside of the server:

Terminal window
curl -s http://127.0.0.1:9153/metrics | grep '^dns_'

Each metric includes a # HELP line that describes what it measures. The # TYPE line names its type, such as a counter or a gauge. For example:

# HELP dns_queries_total Parsed DNS queries, by transport and opcode.
# TYPE dns_queries_total counter
dns_queries_total{transport="udp",opcode="QUERY"} 1

Descriptions do not create samples. A metric appears only after the server records its first value, so an unused metric stays absent from the output.

metrics_listen in node.toml names the address, and an empty string turns the endpoint off. node.toml: what this machine does has the setting. The server installs the endpoint once in the life of the process:

  • An address that a running server did not serve yet takes effect at once.
  • A move to another address, and turning the endpoint off, take effect at the next start. The log says so with a WARN line.
  • An address that the server cannot bind does not stop the server. The server logs could not serve /metrics, and goes on answering DNS without the endpoint.

The endpoint asks for no password, and it carries no client address and no name that a client asked. Some labels name things of your configuration: the address of an upstream, the name of a blocklist source, and the name of a client group. A group name is hidden as (hidden) while store_clients is off. If you name an address that other machines reach, make sure that only the machine of your Prometheus reaches it. Use a firewall or a private network.

A scrape job for one server:

scrape_configs:
- job_name: tadoru
scrape_interval: 15s
static_configs:
- targets: ["127.0.0.1:9153"]

A Prometheus on another machine needs metrics_listen set to an address that machine reaches, such as 192.168.1.10:9153.

Every counter starts at zero, and a restart sets it back to zero. Read a counter with rate() or increase(), which handle the reset. A counter that has not counted yet is not on the page: a metric appears the first time the server records it. dns_log_dropped_total is the exception, on the page from the start at 0 for each reason. A gauge says a value now, and you read it as it is.

These queries answer the usual questions:

Question Query
How many queries a second, by transport sum by (transport) (rate(dns_queries_total[5m]))
What share of answers is SERVFAIL sum(rate(dns_responses_total{rcode="SERVFAIL"}[5m])) / sum(rate(dns_responses_total[5m]))
How long the slowest 5 in 100 answers take histogram_quantile(0.95, sum by (le) (rate(dns_query_duration_seconds_bucket[5m])))
What share of lookups the cache answers rate(dns_cache_hits_total[5m]) / (rate(dns_cache_hits_total[5m]) + rate(dns_cache_misses_total[5m]))
How many answers blocking stops, by group sum by (group) (rate(dns_blocked_total[5m]))
Which upstream is slow max by (upstream) (dns_upstream_duration_seconds{quantile="0.95"})
Whether an edit took effect dns_config_running_revision

The histogram of dns_query_duration_seconds has bucket edges from 50 microseconds to 5 seconds, so a cached answer and a slow walk fall in different buckets. The histogram of dns_zone_witness_sync_seconds has edges from 0.5 milliseconds to 5 seconds.

These alerts catch what goes wrong most often:

Alert when Because
dns_blocklist_check_age_seconds > 172800 A source has not been read for two days, with the default refresh of 24 hours, and its list grows old
dns_tls_certificate_expiry_seconds - time() < 7 * 86400 The certificate of DNS over TLS expires within a week
time() - dns_cache_snapshot_last_write_timestamp_seconds > 7200 The cache snapshot, written every 15 minutes by default, has not been written for two hours. That is most often a full disk
rate(dns_querylog_dropped_total{reason!="log_off"}[15m]) > 0 The query log loses rows. The label reason says why. queue_full is load, a slow turn of the writer, or a log that still opens: the line a turn of the query log writer took N ms names slow turns, and a warning after the query log is open counts the rows lost while it opened. write_failed comes with the line could not write query log rows. Read The query log answers query-log-starting
increase(dns_querylog_dropped_total{reason="log_off"}[15m]) > 0 The query log is off. Either its database did not open, and the line the query log could not be opened, so nothing is recorded says why, or a query log in memory is off, and telemetry.off of the health says why, or its writer ended in a panic, whose message goes to standard error only
increase(dns_querylog_dropped_total{reason=~"store_full|store_unmeasured"}[15m]) > 0 A query log in memory writes no row for want of room, or because its room could not be measured. telemetry.full or telemetry.unmeasured of the health says why
rate(dns_auth_reads_late_total[5m]) > 0 Reads of the accounts wait past their budget, and their requests answer 503 accounts-busy. The label stage says where they waited. Read The API answers accounts-busy
increase(dns_log_dropped_total{reason="stdout_full"}[15m]) > 0 The log loses lines, because standard output does not take them as fast as the log writes them. Look at what reads it: the journal, the log driver of the container, or a paused terminal. Before this reason came, such a line counted as queue_full, so move an alert on queue_full for a stalled reader to this one
increase(dns_log_dropped_total{reason="queue_full"}[15m]) > 0 The thread log does not take the lines as fast as the server makes them, which is a machine short of processor time, or a log at trace under load. A stalled standard output does not count here
increase(dns_log_dropped_total{reason="too_large"}[15m]) > 0 A line was larger than 8 MiB, and the log dropped it whole
increase(dns_log_dropped_total{reason="write_failed"}[15m]) > 0 Standard output refused a write, such as a pipe whose reader closed it
increase(dns_log_dropped_total{reason="writer_gone"}[15m]) > 0 A thread of the log ended in a panic, and its lines are lost until a restart. The panic message is on standard error
increase(dns_log_dropped_total{reason="file_write_failed"}[15m]) > 0 The log file did not take lines: a write failed, or the file of the day was refused, such as a link or a file of another user at its name. The warnings of the log name the file and the reason. Standard output and the ring still have the lines
increase(dns_log_dropped_total{reason="file_full"}[15m]) > 0 The log files reached log_file_mib with only the file of the day left, or the file system of the state root is under its floor of free room. A file at its cap counts each line for the rest of its day, so keep this alert apart from the others: raise log_file_mib, lower log_file_days, or free room on the disk
increase(dns_log_dropped_total{reason="file_queue_full"}[15m]) > 0 The disk under the log files takes the lines slower than the log makes them, and the queue of the log file, 4096 lines or 4 MiB, ran out of room. Standard output and the ring still have the lines
increase(dns_log_dropped_total{reason="ring_busy"}[15m]) > 0 A read of the recent lines held the ring while the lines that wait for it ran out of their room: 256 lines, or what remains of the 4 MiB of the ring, which is about 4 lines of 64 KiB when the ring is full. The ring lost those lines. Standard output gets each of them on its own try, which can fail too, as stdout_full or write_failed. No warning line says so
rate(dns_upstream_mismatched_replies_total[5m]) > 0 Replies that match no query arrive, which can be a spoofing attempt
dns_blocking_disabled == 1 for more than an hour Somebody turned the switch off and did not turn it back on
dns_blocking_setting_disabled == 1 The setting enabled of blocking.toml turns blocking off for every client. Alert on it beside the switch, because either one turns blocking off
rate(dns_listener_errors_total[5m]) > 0 A listener fails to read or accept, which is most often a machine out of file descriptors
rate(dns_udp_kernel_drops_total[5m]) > 0 The kernel drops queries because a UDP socket is full, so clients see timeouts that no log line explains. Linux only

Reading a list now, and taking one this server refused says more about the blocklist numbers. Encrypted DNS says more about the numbers of the encrypted transports.

A counter only goes up, and its name ends in _total. A gauge says a value now. A histogram counts how long something took, in buckets, and Prometheus reads it as _bucket, _sum and _count. dns_query_duration_seconds and dns_zone_witness_sync_seconds are the two histograms. A summary also measures how long something took, but the server works out its quantiles itself. It comes as series with a quantile label, from 0 to 1, beside _sum and _count, and it has no _bucket series. A summary of one server cannot be added to the summary of another. A time is in seconds, and a point in time is a Unix time in seconds.

Metric Type Labels What it counts
dns_queries_total counter transport, opcode Queries that parsed. transport is udp, tcp, tls, https, quic or h3
dns_responses_total counter transport, rcode Answers written, by response code
dns_query_duration_seconds histogram transport The time from a query arriving to its answer being written
dns_malformed_packets_total counter transport Packets that do not read. A query gets no answer, and an update gets the header alone
dns_truncated_responses_total counter Answers too large for UDP, sent with the TC bit
dns_refused_total counter reason Queries the server refuses to serve: recursion for a client outside allow_recursion, zone for a client outside query_from, rebinding for an answer that points at a private address, transfer for a zone transfer refused, or answered NOTAUTH, and proxy_datagram for a dynamic update over UDP behind a PROXY header
dns_transfers_total counter kind, outcome Zone transfers, by axfr or ixfr, and by sent whole, cut before their last message, busy past a limit, or failed at a stopped zone. An IXFR over TCP answered with the SOA alone counts as ixfr and sent too
dns_transfers_in_flight gauge Zone transfers that stream now
dns_transfer_bytes_total counter The octets of every message of every zone transfer
dns_ixfr_answers_total counter transport, kind, reason IXFR answers, over tcp or udp, by the form that the server chose: ixfr-incremental for the changes alone, ixfr-whole for the whole zone, ixfr-current for the SOA where the secondary holds the serial, and ixfr-over-tcp for the answer over UDP that sends the secondary to TCP. reason says why the whole zone goes, or is none. A refusal or a failure is no answer here, and a count does not mean that the stream ended
dns_zone_differences gauge The changes of the zones that the server keeps in memory to answer IXFR
dns_zone_differences_bytes gauge The memory of those changes, which stays under 64 MiB
dns_zone_differences_emptied_total counter reason Each time the kept changes of a zone started again with none: start, served-nothing, move, apex, whole-zone-time, bound, budget, refused or digest
dns_notify_rounds_total counter outcome NOTIFY sent to a secondary that ended: answered, notimp, refused, unanswered, unreachable, failed, dropped past the refresh time of the zone, or cancelled where a revision took the zone or the secondary out
dns_notify_messages_total counter NOTIFY datagrams that went out, each copy counted
dns_notify_waiting gauge NOTIFY that wait for their turn or run now
dns_rate_limited_total counter limit, scope Queries a rate limit stopped. Over UDP a client of allow_recursion gets no answer, and a client outside it gets an empty answer with the TC bit, so this is the only record
dns_capacity_refused_total counter Queries answered SERVFAIL because the server already ran as many resolutions as it allows
dns_resolutions_in_flight gauge Resolutions that run now
dns_forward_failures_total counter reason Questions the forwarders did not answer, which the client got as a failure
dns_forward_races_total counter outcome Forwarded questions where two upstreams were asked at once, in a race of forwarders: first where the first usable reply to come in passed the checks, later where it failed them and a later one passed, none where no reply passed. A SERVFAIL, a REFUSED or a timeout is no usable reply
dns_recursion_failures_total counter reason Questions the walk from the root did not answer
dns_extended_errors_total counter code Extended DNS Errors sent, by the number of the code
dns_ecs_received_total counter Queries that carried an EDNS Client Subnet option
dns_ecs_ignored_total counter EDNS Client Subnet options that the server read and did not use
dns_designation_answers_total counter transport Answers at _dns.resolver.arpa that name the encrypted endpoints of this server
dns_listener_errors_total counter transport Reads and accepts of a listener that failed

The label transport names DNS over HTTPS on HTTP/3 h3. That is apart from https, which is DNS over HTTPS on HTTP/2 or HTTP/1.1 and the local socket. Older versions counted HTTP/3 under https. So a dashboard that sums transport="https" counts less from the upgrade on: add h3 to it.

A zone transfer that reaches its last message logs sent a zone transfer at the level info. The line holds the zone, its serial, the client, the records, the messages, the octets and the seconds. A transfer that ends early logs cut a zone transfer with its reason. A transfer that stops part way says what each reason means. dns_transfers_total counts a transfer of a stopped zone as failed, and one past a limit as busy.

An IXFR adds from, the serial of the secondary, to the line. The line then has one of two forms: kind as ixfr-incremental and the count of differences, or kind as ixfr-whole and its reason. An IXFR answered with the SOA alone logs answered an IXFR with the SOA at the level debug, once the SOA went out. An SOA too large for the client over UDP goes as TC with no record, and logs nothing.

After tadoru zone witness reset, accept or raise, an apex serves inside its whole-zone time, at the start or later. The first time it does, the server logs an apex sends whole zones after a new history once for that apex. The line is at the level info, with the end of the time and the old serials. A zone that is stopped or turned off serves nothing, so it logs the line once it serves. Where no serial can pass the old serials, way_out names tadoru zone witness raise with --old-serials.

The records of a cut and dns_transfer_bytes_total count each message as the transfer queues it. So a cut counts up to 10 messages that never reached the client.

A NOTIFY to a secondary (NOTIFY) logs notified a secondary. The level is info at the first answer of that secondary after a start or after a failure, and debug after that. A secondary that does not take it gets one warning while it stays in that state. So one that is down for a day writes one line. dns_notify_rounds_total counts every NOTIFY, also those the log names at debug, and a stop counts none of those that it cuts. dns_notify_waiting reads 0 once the sending of NOTIFY ends.

A listener on one address runs several workers, and each has a socket of its own. These metrics count per worker. The label address is the address of the listener, and worker is the number of the worker among those of that address, from 0.

Metric Type Labels What it counts
dns_udp_datagrams_received_total counter address, worker Datagrams the worker read from its socket
dns_udp_datagrams_dropped_total counter address, worker, reason Datagrams the worker read and dropped: oversized for one past 4096 bytes, proxy_header for one whose PROXY header was refused, silent for one the server answered with silence, and forged for one whose source was an IPv4 address in IPv6 form
dns_udp_kernel_drops_total counter address, worker Datagrams the kernel dropped for the socket of the worker before the worker saw them, nearly always because its receive queue was full
dns_udp_socket_buffer_bytes gauge address, direction The size of the receive or the send buffer of the UDP sockets of each DNS listener, in bytes, as the kernel gave it after a bind or a revision: half the raw value that Linux reports, in the terms of udp_receive_buffer_kib and udp_send_buffer_kib. Under the setting, the cap of the kernel is lower. An address that a revision removes keeps its last value until a restart

A silent datagram is most often one that does not read, or one from a client over a rate limit. dns_malformed_packets_total and dns_rate_limited_total say which. A datagram that the kernel dropped never reaches a worker, so it is in the third metric alone. The server reads that number from /proc/net/udp every ten seconds. So it trails the kernel by up to ten seconds. Only Linux has it. On another system the metric has no series, which means unknown, not zero.

When the number rises, most often the queue of a socket filled faster than the worker read it. The first thing to check is whether the host is short of CPU. The kernel also counts here a datagram with a bad checksum, and one that a socket filter refused. A listener that ends loses what the kernel dropped since the last read, up to ten seconds. One example is a new revision that removes its address.

Metric Type Labels What it counts
dns_tcp_connections_open gauge transport TCP connections open now: tcp, tls for DNS over TLS, or https for DNS over HTTPS and the plain HTTP listeners, the challenge of ACME on acme_http_listen included
dns_tcp_connections_refused_total counter TCP connections refused because the server was at its limit
dns_tcp_timeouts_total counter transport, kind Connections a timeout ended: idle for one that sent no query within tcp_idle_timeout_seconds (30 seconds for DNS over TLS), read for a message whose body did not arrive within tcp_read_timeout_seconds, and write for a peer that stopped reading, so an answer could not leave within tcp_write_timeout_seconds. Each is 10 seconds by default. A peer that closes its side counts nowhere
dns_tls_handshake_failures_total counter reason DNS over TLS handshakes that did not finish: timeout, protocol, eof or no_certificate
dns_tls_sessions_evicted_total counter transport, reason TLS sessions of DNS over TLS (tls) or DNS over HTTPS (https) that the store dropped before their 12 hours ended: capacity_new for a new session of a full store, capacity_resumed for a resumed one, address for a new session of an address that held 32, address_resumed for a resumed one of an address that held 32 resumed ones, prefix and prefix_resumed the same for a /24 or /56 that held 256. A client that comes back after its session went pays one full handshake. A restart and a new certificate drop sessions without a count
dns_tls_sessions_stored gauge transport, part TLS sessions that the store of DNS over TLS (tls) or DNS over HTTPS (https) holds: new for sessions that nobody resumed yet, resumed for the others. It shows the certificate that serves, from its first handshake on, and 0 while no certificate serves
dns_tls_certificate_expiry_seconds gauge When the certificate of DNS over TLS expires
dns_https_responses_total counter status, version Answers of the DNS over HTTPS listeners, by HTTP status and by HTTP version
dns_quic_connections_open gauge protocol QUIC connections served now: doq or h3
dns_quic_connections_held gauge QUIC connections of DoQ and DoH3 that hold a place of the 1000 that every DoQ and DoH3 address shares now: open, in their handshake, closed and not yet gone, which takes three probe timeouts after the close, or still held by a task of the server. It can read more than dns_quic_connections_open
dns_quic_connections_refused_total counter reason QUIC connections refused: budget where the DoQ and DoH3 listeners together hold 1000 connections, closed ones not yet gone included, client for a client at its cap, and untracked for every attempt once the server cannot see when a connection is gone, which a log line at ERROR reports
dns_quic_retries_total counter QUIC connections asked to prove their address first, because the client was at its cap, or because 64 attempts weighed on the listeners: handshakes in progress, and attempts from addresses not yet proven that hold no place of their client
dns_quic_ticket_key_failures_total counter New ticket keys of DoQ and DoH3, which share them, that the server could not make. Until one is made, connections get no ticket to resume
dns_quic_handshake_failures_total counter reason QUIC handshakes that did not finish: timeout or protocol
dns_quic_protocol_errors_total counter reason Broken rules of DNS over QUIC, each of which closes its connection
dns_padded_responses_total counter transport Encrypted answers sent with padding
dns_proxy_headers_total counter version PROXY protocol headers read: 1, 2, or local for one that named no client
dns_proxy_header_failures_total counter reason PROXY protocol headers refused
dns_forged_peers_total counter transport Datagrams, connections and QUIC paths dropped because their source was an IPv4 address in IPv6 form, which no real client has here
Metric Type Labels What it counts
dns_upstream_queries_total counter protocol Questions asked of an upstream, one for each attempt. In a race, the attempt dropped when the other won counts once too
dns_upstream_answers_total counter protocol Answers taken from an upstream
dns_upstream_failures_total counter protocol, reason Attempts that failed, such as a timeout or a certificate that did not check. proxy is an attempt through the outbound proxy that the proxy refused or could not carry, which never goes direct
dns_upstream_rejections_total counter rcode Replies whose code says the upstream failed, so the next upstream was asked
dns_upstream_retries_total counter Retries after a first attempt failed. The second upstream of the first pair of a race is no retry
dns_upstream_mismatched_replies_total counter Replies that did not match the query sent, which can be a spoofing attempt
dns_upstream_tcp_fallbacks_total counter Answers truncated over UDP and asked again over TCP
dns_upstream_edns_fallbacks_total counter protocol Questions asked again without EDNS, because the upstream did not take it
dns_upstream_edns_marks_total counter protocol Servers that refused EDNS and answered without it, so they are asked without it for five minutes
dns_upstream_payload_fallbacks_total counter Starts of the fallback to 1232 bytes: a UDP query that offered more than 1232 got no answer, so the later UDP queries of its question offer at most 1232. Once per question, a probe of an upstream at rest included. It counts a question that fails after it, and one that sends nothing more
dns_upstream_payload_marks_total counter Servers remembered for one minute as losing large UDP answers: a UDP query that offered more than 1232 waited its whole timeout with no answer, so that server is offered at most 1232. Once per new memory, again after it ends or the table drops it. It proves no loss of fragments and no answer saved
dns_upstream_duration_seconds summary upstream, protocol, quantile How long each upstream took to answer. upstream is an address and a port, or a name and a port, such as dns.example:853, for a forwarder with no addresses that a SOCKS5 proxy reaches by its name
dns_upstream_chosen_total counter upstream, protocol Questions sent to each upstream, an attempt dropped in a race included
dns_upstream_rests_total counter route, upstream, protocol Rests of an upstream, started or made longer each time a probe of the server’s own got no answer
dns_upstream_suspects_total counter route, upstream, protocol Upstreams that answered nothing three times in a row, so the server asked a question of its own
dns_upstream_handshakes_total counter protocol, resumed Handshakes with an encrypted upstream, and whether each resumed an earlier session
dns_upstream_connections_open gauge protocol Connections to encrypted and tcp:// upstreams open now
dns_address_bound_total counter step Queries a server address did not receive, because it had all three of one question over that transport. step says which: initial, stream (after a truncated reply), plain (without EDNS), case, resend or subnet
dns_coalesced_queries_total counter Queries that joined the same question already in flight
dns_coalesced_answers_total counter Times a client read the shared answer of a question in flight, the client that started it included. A lookup of the server itself, a prefetch, and a client that found the answer in the cache do not count
dns_coalesced_abandoned_total counter Shared answers that a client waited for and no client read, such as when every waiting client gave up first
dns_inflight_questions gauge Different questions in flight now
dns_inflight_refused_total counter Questions refused because too many were in flight
Metric Type Labels What it counts
dns_client_attempts_total counter transport, outcome Attempts of the DNS client of the API, one for each exchange, the retry over TCP after a truncated reply included. transport is udp, tcp, tls, https, quic or h3. outcome is answered, timeout, unreachable, refused, tls, http, malformed or local. A target that the rule refuses before any attempt counts nothing

These count the work of the recursive mode, which asks the authoritative servers itself.

Metric Type Labels What it counts
dns_priming_attempts_total counter Times the server read the list of root servers
dns_priming_failures_total counter Times no root server answered that read
dns_minimised_queries_total counter Questions sent with a shortened name, which tells a server less
dns_minimisation_fallbacks_total counter Times a shortened name failed and the whole name was sent once
dns_hedged_queries_total counter Questions also sent to a second server because the first was slow
dns_lame_answers_total counter Answers from a server that does not hold the zone it was asked about
dns_unwalkable_answers_total counter fault Answers from a name server whose alias chain cannot be walked: ambiguous for two links at one name, crowded for a name that is an alias and owns other data. The next server of the zone is asked
dns_all_lame_total counter Times every server of a zone answered that way
dns_throttled_addresses_total counter Server addresses put to rest for a minute after three silent replies
dns_case_mismatches_total counter Replies whose question came back in another letter case than sent
dns_unrandomised_retries_total counter Questions sent again in their first letter case after a server changed it
dns_ecs_sent_total counter Questions sent with an EDNS Client Subnet option
dns_ecs_mismatches_total counter Replies whose EDNS Client Subnet option did not match the question, dropped
dns_ecs_unsupported_total counter Server addresses marked for a day as not taking the option
Metric Type Labels What it counts
dns_cache_hits_total counter Lookups answered from the cache
dns_cache_misses_total counter Lookups that found nothing usable, an expired entry included
dns_cache_negative_hits_total counter kind Lookups answered by a negative entry: nxdomain, nodata or failed
dns_cache_failures_total counter Failed resolutions held for a short time, so the server does not ask again at once
dns_cache_entries gauge Names held now
dns_cache_accounted_bytes gauge The memory the entries take, without the overhead of the allocator
dns_cache_evictions_total counter Names dropped to stay inside the memory bound. A steady climb says the cache is too small
dns_cache_refused_total counter reason Answers served and not stored: too_large or not_wanted
dns_cache_stale_served_total counter reason Answers served after their lifetime ended, while a refresh ran or failed
dns_cache_refreshes_total counter trigger, outcome Refreshes of an entry: refreshed, failed or refused
dns_cache_prefetch_skipped_total counter trigger, reason Refreshes ahead of time that did not start, because a budget or the table of questions was full, or a refresh of that question was running already
dns_cache_prefetch_late_total counter Misses that a refresh ahead of time saves, while that refresh is on
dns_cache_synthesized_total counter kind Negative answers made from signed proofs held before: nxdomain, nodata or wildcard
dns_cache_span_bytes gauge The memory those proofs take
dns_cache_flushes_total counter reach Flushes of the cache: name, below or all
dns_cache_flushed_total counter store What each flush removed, by the store it removed from
dns_cache_snapshot_writes_total counter outcome Writes of the cache snapshot: written or failed
dns_cache_snapshot_bytes gauge The size of the last snapshot written
dns_cache_snapshot_last_write_timestamp_seconds gauge When the last snapshot write that worked happened
dns_cache_snapshot_refused_total counter reason Snapshots that a start refuses to load, such as one written under another configuration
dns_cache_restored_total counter result What a start did with each entry of the snapshot
Metric Type Labels What it counts
dns_blocked_total counter group, source Answers blocked, by client group and by the source that held the rule. source is (entries) for a name you wrote and (regex) for a pattern
dns_blocklist_rules gauge source, action Rules of its action that a source serves now. action is block or allow, and the series of the other action reads 0
dns_blocklist_bytes gauge source The memory the compiled list of a source takes
dns_blocklist_check_age_seconds gauge source How long since a read of the source last worked
dns_blocklist_passes_total counter source, outcome Reads of a source, by how each one ended
dns_blocking_disabled gauge 1 while the switch in memory is off, and 0 while it is on
dns_blocking_setting_disabled gauge 1 while the setting enabled of blocking.toml is false, and 0 while it is true. Written at each revision

dns_blocklist_rules counts the rules of the action of a source: the block rules of a list that blocks, which is every list today. The @@ lines of a list that blocks are not in it. A list that the server serves has two series, one per action, and the series of the other action reads 0. A list that the configuration names reads 0 for the other action from the first sample, before any read of it. So when the action of a list changes, its old count reads 0 within ten seconds.

A list keeps its last count in two cases:

  • A list that you take out of the file.
  • A list whose settings changed, while the set compiled under the new settings is not ready yet.

The value stays until the next read of the list. For a list that you took out, it stays until the server restarts. So a sum over the lists can count rules that no longer serve. The health line says which lists serve.

Metric Type Labels What it counts
dns_dnssec_validations_total counter state Answers judged: secure, insecure, bogus, indeterminate or unchecked
dns_dnssec_bogus_total counter fault Answers that failed validation, by what failed
dns_dnssec_chain_questions_total counter type, route Questions the validation asked for itself: ds, dnskey or soa
dns_dnssec_proofs_total counter record, outcome Proofs that a signed name does not exist, by their kind and result
dns_dnssec_crypto_calls_total counter algorithm, result Signatures checked, by algorithm and by valid or invalid
dns_dnssec_crypto_limits_total counter limit Times a bound on the work of validation was reached
dns_dnssec_nsec3_calls_total counter Hashes computed for NSEC3 proofs
dns_dnssec_clock_graced_total counter Answers given without validation while the clock is not trusted
dns_dnssec_clock_refused_total counter SERVFAIL answers that the clock caused
dns_clock_state gauge state 1 on the current verdict about the clock, and 0 on the others
dns_nta_active gauge Negative trust anchors that act now
dns_nta_probes_total counter outcome Checks of whether a negative trust anchor is still needed
dns_nta_answers_total counter Answers under a negative trust anchor
dns_trust_anchor_keys gauge state The root keys the server holds, by their state
dns_trust_anchor_refreshes_total counter outcome Refreshes of the root keys
Metric Type Labels What it counts
dns_updates_total counter result Dynamic updates: applied, unchanged, refused or failed
dns_aname_refreshes_total counter result Lookups that keep the addresses of an ANAME record fresh: ok, failed or skipped
dns_aname_sets gauge state ANAME owners by the state of their addresses: fresh, stale or missing
dns_journal_transactions gauge zone Transactions of the journal of each zone past its base: what the next start replays, and what the limits of a checkpoint count. zone is the zone id, the name of its directory under zones/
dns_record_changes_pruned_total counter kind Rows that the prunes of the record changes deleted: window for keys past their 24 hours, audit for commands of the audit past their age or its bound
dns_record_changes_prune_failures_total counter kind Batches of those prunes that failed before they committed, so they deleted nothing: window or audit
dns_ledger_rows_pruned_total counter Finished commands of the ledger that its prune deleted: dynamic updates, ACME records, sweeps of aging, serial witness moves and expiry sweeps that made no revision, more than 7 days and 1 hour after a batch stamped them
dns_ledger_rows_stamped_total counter Finished commands of the ledger that a batch stamped, which starts their 7 days and 1 hour
dns_ledger_rows_capped_total counter Stamps that an earlier run of the server left ahead of the clock of this one, which a batch brought back to it
dns_ledger_prune_failures_total counter Batches of the prune of the ledger that failed before they committed, so they changed nothing
dns_ledger_prune_start_hold gauge The state of the start hold of the prune of the ledger at its last batch: 1 in the first 7 days and 1 hour after a start, while the prune deletes nothing, and 0 after it. Each batch sets it, also a batch that fails
dns_acme_orders_total counter result Certificate orders that ended: issued, failed or rate_limited
dns_acme_next_attempt_seconds gauge When the next certificate order or renewal check is planned
dns_zone_clock_held gauge 1 while the zone clock is held, and 0 otherwise. No record expires while it holds
dns_records_expired_total counter zone Records that expiry sweeps removed from each zone, since the start of the server. zone is the zone id
dns_record_expiry_blocked gauge zone, reason 1 for the reason that holds a record of the zone past its expiry time, and 0 for a reason that held it before: gate, clock, outage, state, rule, cross-file or failed

dns_zone_clock_held is set at the start of the server, at each tick of the zone clock once a minute, and at each resume. So a metrics endpoint that a later revision turns on reads it within a minute. An open outage of a stopped server alone reads 0.

dns_record_expiry_blocked is set each time the server looks at the zones with record_expiry. It looks after each change of the zones, each event of the zone clock, each sweep, and at the time of the next record. So a metrics endpoint that a later revision turns on reads it at the next look.

A zone has a series at 1 only while a record of it is past its expiry time and still in the zone. reason says the first reason that holds it, as GET /api/zones/{id} does. The reason state stands for every state of the zone that the sweep passes over, so the series of a zone stay seven at most. A clean stop of the server sets each series to 0. A zone that a revision deletes reads 0 until the server stops, because the exporter removes no series by name. The counter dns_records_expired_total counts from the start of the server, and starts again at a restart.

dns_journal_transactions is sampled every ten seconds. Its label is the zone id, such as home-arpa, and not the name of the zone. A count that grows says that a zone takes updates and no checkpoint, and the next start replays that many. A frozen zone takes no checkpoint until its thaw, so its count grows with its updates by design. A zone with no journal reads 0. A count that the server cannot know keeps its last value, or has no series yet. Four cases are such:

  • A journal that does not read.
  • A journal damaged before its end or written for another zone.
  • A journal missing for a moment while it is replaced.
  • A zone that the running revision lists with no anchor.

A zone that a revision deletes reads 0 until the server stops, because the exporter removes no series by name.

The prunes of the record changes run at each tick of the checkpoints, once a minute, and once at a start. A batch counts its rows after its commit. A batch that fails before it commits counts once as a failure.

While a kind fails, the server logs one warning an hour for it: the prune of the record changes (window) failed, and the next tick tries again, with the error. A batch that commits starts the hour again. A batch that stops with an error of the program logs the prunes of a tick stopped, and the next tick tries again. Read the error to know what to do:

  • For window, the error is of the disk or of the lock of control.sqlite.

  • For audit, the prune reads the journals of the running revision to know which commands a journal still needs. It keeps every command until it can. Each kind of error has its own way out:

    • The record of the running revision does not read. The error says the record of revision N does not read and names no zone. The record lives in the state root with the generation. So restore the state root from a backup, or roll back to a revision whose record reads.
    • A journal of a zone does not read. The error names the zone. tadoru zone list and the health report name it too. A checkpoint repairs it, and so does tadoru zone journal cut or remake with the server stopped.

    Until then the audit keeps every command, and its bound holds through the starts.

The prune of the ledger runs in the same ticks and shares their budget. A command of a dynamic update, of ACME or of aging that made no revision stays in control.sqlite. So a repeat of its id gets its first answer.

A batch stamps each such command after it finishes, from a clock of the server process. It deletes a command once that clock is more than 7 days and 1 hour past the stamp, at most 100 commands a batch. The clock starts at the first batch after a start, and no command goes in the first 7 days and 1 hour. dns_ledger_prune_start_hold reads 1 from the start until then, and 0 after it. The gauge is the state of the hold at the last batch. Each batch sets it from that clock, also a batch that fails.

The hold is not a failure. A batch counts its rows after its commit. A batch that fails counts once in dns_ledger_prune_failures_total. While the batches fail, the server logs one warning an hour: the prune of the ledger failed, and the next tick tries again, with the error. A batch that commits starts the hour again, also when it changed no row. A ledger that keeps growing says what to do.

The serial witness, serials.sqlite in the state root, holds the first and the last serial that the apex of each zone served. The serial says what it does.

Metric Type Labels What it counts
dns_zone_serial_moves_total counter reason Moves of the serial of a zone past the serial that its apex served: behind, same-serial-other-records, undefined or digest-version
dns_zone_witness_stops gauge reason The zones that the witness stops now, by the first word of the reason of the stop: witness-bound, witness-fenced, witness-history-lost, freeze-uncertain or witness
dns_zone_witness_failures_total counter Writes of the witness that failed. A write that the store refuses counts, and so does a write that fails after its commit
dns_zone_witness_sync_seconds histogram How long each write of the witness took, its sync included
dns_zone_witness_rows gauge The rows of the witness at its last read or write. A row stays after its zone goes

Each move counts with its line, moved the serial of a zone past the serial it served. A move is not a fault: the server keeps the serial of a zone ahead of what its secondaries hold. Many moves of same-serial-other-records say that somebody edits the records and keeps the serial.

dns_zone_witness_stops is set at each change of the state of the zones, with all five reasons, 0 included. It counts a zone of yours whose stop the health report shows with a reason of the witness. That reason starts with one of the five words, or holds The serial witness stops it too: and then one of them. A zone that zone.toml turns off is not counted, because it serves nothing whatever the witness holds. A value above 0 says that a zone answers SERVFAIL. A zone that the serial witness stops gives the way out of each reason.

Alert on it, and on a rise of dns_zone_witness_failures_total: a write that fails refuses the change of a zone. A sync that takes long makes every change of a zone slow, because each change writes the witness first. Look at the disk of the state root then.

Metric Type Labels What it counts
dns_querylog_rows_total counter Rows written to the query log
dns_querylog_dropped_total counter reason Rows lost: queue_full for a full queue, write_failed for a batch that did not commit, and log_off for a query log that is not running. That is a database that did not open, with the line the query log could not be opened, so nothing is recorded, a query log in memory that is off, with the line telemetry is off at this start or telemetry is off from this pass until a restart, or a writer that ended in a panic, whose message goes to standard error only. A query log in memory adds store_full, for a row that its room or its tmpfs had no room for, and store_unmeasured, for a row that it dropped because its room could not be measured. The line the query log in memory writes no row now comes with both
dns_querylog_bytes gauge The disk space that the query log takes
dns_querylog_wal_bytes gauge The size of the write-ahead log of the query log at the last prune. A read holds it. On the disk it does not count against retention_mib, and in memory it does
dns_querylog_scrub_pending gauge 1 while the query log still scrubs its files after a redaction or a start, and 0 once the scrub ended
dns_querylog_scrubs_total counter outcome Scrubs that ended: complete, or limited for a file without auto-vacuum, whose free pages keep what earlier deletions left
dns_log_dropped_total counter reason Log lines lost while the server ran: stdout_full for a full queue of standard output, queue_full for a full pipe, which the thread log did not empty in time, too_large for a line larger than the pipe, write_failed for a line that standard output refused, writer_gone for the lines of a thread of the log, log, log-out or log-file, that ended in a panic, ring_busy for a line that the ring of recent lines had no room for while a read held it, file_full for a line that the log file did not take because of its cap or the floor of free room, file_write_failed for a line whose write to the log file failed or whose file of the day was refused, and file_queue_full for a line that the queue of the log file had no room for. A line lost in the pipe counts once. A line that the thread log took, and that both standard output and the ring then lost, counts once for each. Each reason is on the page from the start, at 0. It counts while standard output is blocked, and while a level hides the warning of a loss. Lines that still wait at the exit are not counted
dns_config_running_revision gauge The revision of the configuration that the server answers under
dns_auth_log_cut_pending gauge 1 while the write-ahead log of auth.sqlite holds frames that the last cut of the server could not take, and 0 after a cut. A reader of the file, such as a tadoru accounts command, or a failure such as a full disk, holds the cut. The server retries every minute, and the log line gives the reason
dns_auth_reads_late_total counter stage Reads of auth.sqlite that did not end within the 3 seconds that a request gives them, so the request answered 503 accounts-busy. stage says where the read was: place while it waited for one of the 16 places of the reads, thread while it waited for a thread, read while the store did not answer

These count the addresses of api_listen and of console_listen. door is api or console. The socket api.sock counts in none of them.

A connection over HTTP/3 of console_http3 counts in dns_api_connections_open and dns_api_tls_handshake_failures_total under console, with the reasons timeout and protocol. The four metrics of QUIC count the UDP doors alone.

Metric Type Labels What it counts
dns_api_connections_open gauge door Connections open now, the ones still in their TLS handshake included
dns_api_tls_handshake_failures_total counter door, reason TLS handshakes that did not finish: timeout, protocol, eof, no_certificate, or challenge for a client that asked for an ACME check, which a door does not answer
dns_api_attempts_refused_total counter door, class Answers of 429 after too many failed attempts: login for passwords and setup tokens, credential for API tokens and session cookies
dns_api_bodies_waiting_total counter door Answers of 503 busy, because the request bodies in flight filled their budget
dns_api_accounts_guessed_total counter none Each time the failed logins at one account, over every address, reached 50 in a sliding hour. One account counts once an hour at most, so this counts crossings, not accounts
dns_api_forged_peers_total counter door Connections closed at once because their source was an IPv4 address in IPv6 form, which no real client has here
dns_api_quic_handshakes gauge QUIC handshakes in progress on the UDP doors of console_http3
dns_api_quic_connections_held gauge QUIC connections that hold a place of the 256 of the UDP doors: open, in their handshake, or closed and not yet gone, which takes three probe timeouts after the close. It can read more than dns_api_connections_open
dns_api_quic_retries_total counter Attempts on the UDP doors that had to prove their address first with a Retry, because the client was at its cap, or because 64 attempts weighed on the doors: handshakes in progress, and attempts from addresses not yet proven that hold no place of a client
dns_api_quic_refused_total counter reason Attempts and requests that the UDP doors refused: budget for the 256 connections of all the doors, closed ones not yet gone included, client for the cap of one client, requests for the 1024 requests of all the doors, and untracked for every attempt once the server could not see when a connection is gone, which a log line at ERROR reports

A failed login writes an INFO line with the door, the client address and the name, cut to 64 characters. The first refusal of a name or an address in its minute writes a WARN line. No line carries a password, a token or a cookie.