For the technical audience

Decisions ADR-161 to ADR-170

Every architecture decision record (ADR) behind TelltaleDNS: what we knew, what we chose, and what it costs. This page is built from the specification on every change, so it's always the current record.

ADR-161 Muting anomaly findings: a shared entry per standing rule, matched when the finding is created, recorded but not countedAcceptedCLUOBSGitHub issue #38.

Context

GitHub issue #38. Two LG TVs look up the PTR of every address in their /24 once an hour: about 225 NXDOMAIN answers in a minute, 87% of the device's queries, so each node they ask raises an nxdomain_storm finding every hour, TelltaleDNSDeviceAnomaly fires all day, and the Anomalies page is all TV. Acknowledging (OBS-014) clears one finding; the next hour brings another. What exists doesn't help: ignore_domains doesn't apply to nxdomain_storm and can't name a reverse zone; raising nxdomain_per_minute weakens the check for every device and is per node; [exclusions] for the reverse zone takes those lookups out of the query log and analytics for every device, so a device sweeping the same network would go unseen, which is the case the storm check exists for; an Alertmanager silence can't target a device (the metric carries only kind). Two facts about the code decide the shape: the [telemetry] section is node-local (shared.rs), and the TVs ask both nodes, so the contributor's [[telemetry.anomaly.mute]] would have to be written on every node; and the engine runs on the telemetry thread, which knows addresses, not device names or groups. Decision (proposed):

  • The entry. A top-level, shared [[anomaly_mute]], managed like groups and schedules: name (unique, the key), devices (device names, addresses or networks) and groups (at least one of the two), kinds (at least one of the finding kinds; there is no "all": a blanket mute is ignore-ing the engine, and an explicit list keeps a new kind visible), expires (optional, RFC 3339; the same words as a quick rule's devices, groups, expires, note), note (up to 200 characters). Who made it and when is in the audit log, not in the entry. Files, the API, the UI, MCP and Git all write the same entry; in a Git-managed cluster the API, UI and MCP refuse with 409 gitops_managed and show the TOML to commit, as for other configuration. It travels with the cluster's shared settings (CLU-003), so a mute set on the primary reaches every node, including ones that were down.
  • Matching. Device names and groups are resolved when the configuration applies, from the [[client]] entries (their addresses and networks) and the group's networks and the clients that name it, into a sorted list of address networks. The engine receives one compiled table (networks, a bit per kind, an optional end time) swapped in atomically, like exclusions, and looks a finding's device up once, when the finding is created: a lookup per finding, never per query. A name that matches nothing, an unknown kind, or an empty list is a 422 (the dry run says which). A MAC address is refused with a hint: the address changes with the lease, and the neighbour table isn't on the telemetry thread.
  • What muted means. The finding is recorded as before, with muted: true and mutedBy: <mute name>, so it is listed (with Show muted) and available to the API and MCP. It is not counted in telltale_anomalies_total{kind}, the sidebar badge, the anomaly alert rule, or the health level, and it is counted in a new telltale_anomalies_muted_total{kind}. The decision is made at creation against the finding's window start: an expires in the past mutes nothing new, a finding created while the mute held stays muted after it ends, and replaying the same queries with the same mutes gives the same findings.
  • Surfaces. PUT and DELETE /api/v1/anomaly-mutes/{name} (dry run, If-Match, Idempotency-Key, audited as config.anomaly_mute); the mutes are listed by GET /api/v1/config/entries?kind=anomaly_mute, as schedules and alerts are; GET /api/v1/analytics/anomalies gains muted and mutedBy on each finding and muted=true to include them (hidden by default, like acknowledged ones); MCP list_anomaly_mutes, plan_set_anomaly_mute, plan_remove_anomaly_mute (named like plan_remove_local_name), and find_anomalies takes muted. Agent scope: a mute can hide a compromised device, so it has its own write scope, config:write:anomalies (included in config:write:*), rather than riding on ops:anomalies (acknowledging, which changes no configuration) or config:write:groups. The Anomalies page gets Mute for this device… on a finding (the device and kind pre-filled; for 1 day, 1 week, 30 days or until removed, 1 week by default; a note; the preview, a dry run, before saving), a Show muted switch, and a list of mutes with Remove.

Alternatives rejected

[[telemetry.anomaly.mute]] (node-local: the TVs ask both nodes); a per-device ignore_kinds on [[client]] (no expiry, no note, and a device with no [[client]] entry can't have one); acknowledging on a schedule (a finding every hour is the problem); a mute that hides the finding entirely (nothing lost is a rule here: muted findings stay listed and counted apart); matching by MAC now (see above); muting a domain rather than a kind (a different decision, left open).

Consequences

one more shared section (older replicas skip it, CLU-010, and so don't mute until updated: they would still raise the finding, which is the safe direction); a lookup per finding on the telemetry thread; the muted counter's label set is the finding kinds, as telltale_anomalies_total's. Implementation notes (2026-11-15): the owner approved the shape ("shared top-level is right, go build it"). Two things were added that the proposal didn't say, for the owner to confirm: the config:write:anomalies agent scope above, and chatty_loop is a mutable kind like the others (it is informational and never counted, but a muted one is marked and listed the same). A device name must be a [[client]] with an IP or network in its match; a device known only by the router's DHCP or mDNS name is muted by its address. Accepted 2026-11-16: the owner answered "Go on all 5" to the list that named these two additions as the open confirmation, so the scope and the mutable chatty_loop stand as built. Verification (planned): the engine with a mute table (muted and unmuted devices, expiry, kinds, counters, replay); the config checks (unknown kind, empty lists, names that match nothing, MAC refusal); the API and MCP (dry run, If-Match, 409 under Git, audit); the UI flow end to end; the cluster path (a mute set on the primary reaches a replica).

See also

ADR-186 (a sweep of private reverse names is its own kind; the storm is judged on the other names).

Requirements CLU-003 CLU-010 OBS-014

Builds on ADR-186

Referenced by ADR-162 ADR-183 ADR-186

ADR-162 Editing a quick rule: replace it in place under its ID; the rule keeps its maker and its startAcceptedCLUGitHub issue #57 (a user's request).

Context

GitHub issue #57 (a user's request). The Quick rules page lists each rule with Remove only, and the form only creates, under a new ID. Changing a rule's domain, scope, end or note meant removing it and making another, which leaves a gap with no rule in effect and loses who made it and when. PUT /api/v1/rules/{id} already creates or replaces, but it stamped the writer and the time on every write. Decision (proposed):

  • No new operation. Edit is PUT /api/v1/rules/{id} with the rule's own ID (dry run, If-Match, Idempotency-Key, audited as rule.put with the rule before and after, so the editor is the audit entry's actor). Rules from the config files stay read-only (409).
  • What a replace keeps. The new rule keeps createdBy and created of the one it replaces, so the Quick rules page's Made column says who started the rule and the audit log says who changed it. A stored rule that has none (older data) takes the writer and now, as a new rule does. A client that re-puts a rule to refresh its start no longer does: it removes the rule and makes another.
  • The page. Edit on a rule made through the UI or API opens the form below the row, filled in from a copy taken when Edit was pressed (the list reloads every 10 s and must not reset the form). The preview is a dry run under the same ID, so it simulates the replacement and not an addition. The durations gain Keep the current end (…), first and selected when the rule has a live end time (sent as expires, so an edit that changes the note doesn't extend the rule), and Until I remove it is selected when it has none; any other duration counts from now. The confirmation is a notice on the page, not in the row, which the reload redraws (ADR-161's lesson).
  • No Edit for a rule from a config file, an expired one (the sweep removes it within seconds), or one made through the API for several devices or groups, or devices and groups together (the form holds one scope, so saving would drop the rest silently). The row says to use the API.

Alternatives rejected

remove then make a new rule from the page (a gap with no rule, and the maker and the start are lost); refreshing created on an edit (it would hide who started the rule); updated and updatedBy fields (a new key in the shared configuration, which an older replica refuses, CLU-010, and the audit log already has the editor); a separate PATCH (replace is the contract today); a multi-select scope in the form (a larger change, left open).

Consequences

no configuration schema change and no mixed-version issue; one behaviour change for API clients, that a replace no longer refreshes created; the page has two forms when one is being edited, so the form's test IDs differ (quick-rule-form for a new rule, quick-rule-edit-form for an edit). Accepted 2026-11-16: the owner answered "push it, accept ADR-162" after seeing the behaviour change (a replace no longer refreshes created) and the cases without an Edit.

Verification

a unit test that an edit keeps the maker and the start and that older data takes the writer; the e2e test flt_005 edit a quick rule in place (the form from the rule, the end kept, the old domain no longer allowed, one rule, the maker and start unchanged, the notice, Cancel).

Requirements CLU-010

Builds on ADR-161

ADR-163 A watchdog restarts a node that stops answering and leaves evidence of why: a thread outside the runtime, two checks, a bounded dumpAcceptedNFROBSGitHub issue #7.

Context

GitHub issue #7. A 2-CPU node (an LXC container with a two-worker runtime) stopped answering DNS, the API, metrics and the cluster port while its service stayed active, and stayed that way until someone restarted it, about twelve minutes in the report. The cluster saw its link drop a minute after DNS stopped, as if the runtime's threads stuck one by one. There was no stack to read: the release binary is stripped (ADR-164 gives it a debug file), and nothing on the node looks while it hangs. systemd's Restart=on-failure only acts when the process exits, and /livez is served by the runtime that is stuck. The owner promised the reporter (2026-11-14) "a watchdog so a wedged node restarts itself and leaves a dump", and held 0.7.0 until it exists (2026-11-16). Decision (proposed):

  • Where it runs. One OS thread, telltale-watchdog, started once the listeners are bound, outside the Tokio runtime and apart from the UDP workers: a check that runs on what is stuck can't see it. It wakes every 5 s. It adds nothing to the query path: no new code in the pipeline, no allocation, locking, or I/O there (02 §3).
  • Two checks. (1) The runtime runs a task: the thread spawns a trivial task on the runtime's handle and waits up to 2 s for it. (2) The listener answers: a plain UDP socket sends the node's own first UDP listener (UDP never has a PROXY header) a query for probe.telltale.invalid (the name of OBS-020's probes, which special-name handling answers NXDOMAIN without an upstream, and which the telemetry thread keeps out of the query log and analytics; a wildcard bind is asked on loopback); any well-formed reply with the same ID passes. With no UDP listener, only the first check runs.
  • Wedged. A check that has not passed for stall_secs (default 60, 20 to 600), counted from its last pass, or from the thread's start before its first one. A node that is still starting answers (the listeners are bound before the thread starts, and the lists compile in the background), so a long start doesn't count. One pass resets that check, and a stall that has been dumped is not dumped again until a check has passed.
  • What happens. The thread writes the dump, logs at ERROR, flushes the log files, then, with action = "restart" (the default), exits the process with status 70 for the supervisor to restart (systemd Restart=on-failure, Compose restart: unless-stopped, a Kubernetes container). With action = "dump" it writes the dump and leaves the node running. Restarts are limited to max_restarts_per_hour (default 6), kept as timestamps in <data_dir>/watchdog/restarts; past the limit it writes the dump and does not exit, so a false positive can't become an endless loop. A node started by hand (telltale run in a terminal) just exits.
  • The dump. <data_dir>/watchdog/hang-<UTC time>.txt (directory 0750, files 0640, the newest 5 kept): why (which check, for how long, when each last passed), the build (version, commit, target, build ID), uptime, the thread table from /proc/self/task (id, name, state, what it waits on, CPU time), memory and load, the query counters, the last 200 lines of the support log (ADR-156), the executable's mapping (to turn addresses into offsets), and each thread's stack (below). It holds no client data and no configuration. The support package includes the newest one.
  • Stacks. Each thread reports its own stack: the watchdog sends every thread of the process a signal (tgkill), and the handler stores up to 64 return addresses in a fixed table without allocating or taking a lock. The dump lists the raw addresses; addr2line -e telltale.debug <address> resolves them with the debug file of ADR-164. The wait is bounded (5 s); a thread that doesn't answer is listed as not answering, which says it is stuck in the kernel. The only unsafe is in telltale-net, with // SAFETY: comments (NFR-003). The binaries need unwind tables for this (-C force-unwind-tables, size only, no runtime cost).
  • Settings. A node-local [watchdog] section, restart-only like [support]: enabled (true), stall_secs (60), action (restart or dump), max_restarts_per_hour (6). Metrics: telltale_watchdog_enabled, telltale_watchdog_check_age_seconds{check} (seconds since each check last passed), and telltale_watchdog_last_action_timestamp_seconds (the last dump or restart, from the files, 0 for none). The log says at start-up when the previous run ended by the watchdog.
  • Not covered. A node that serves some clients and not others; a hang that spares both the runtime and the UDP listener (the checks ask whether it answers, not whether it answers well); a stall under 60 s.

Alternatives rejected

systemd's WatchdogSec with sd_notify (only systemd; the checks would still be ours); /livez as the check (the stuck runtime serves it; a Kubernetes liveness probe already restarts a pod, but a systemd or Compose install has nothing); a task on the runtime as the checker (it can't see its own stall); abort() for a core dump (needs core limits and systemd-coredump, so most installs would leave nothing); running gdb or eu-stack from the node (the unit's seccomp filter forbids ptrace, and the image has no tools); frame pointers everywhere for cheap unwinding (a cost on the query path); a self-update of the policy from the cluster (this is a node's own safety net).

Consequences

one idle thread waking every 5 s; one probe query per 5 s counted in telltale_queries_total like OBS-020's; four more settings and three metrics; a real wedge costs a restart (a few seconds) instead of an outage until someone notices; the dump needs the build's debug file to read. A false positive restarts a healthy node once per hour at most six times: the checks only fail when nothing answered for a minute. Accepted 2026-11-16: the owner answered "Push and accept" to the account of what was built, measured and left untested (stack capture on arm64 and armv7 is unproven: the ARM builds link, and the capture is bounded). Verification (planned): the check loop with a stubbed clock and probes (a stall is counted from readiness, a pass resets it, the restart limit); a runtime whose workers are all blocked is seen as stalled and a healthy one is not; the UDP probe against a real listener, a silent socket and one that answers with the wrong ID; the dump's content and its permissions, keeping five; the stack capture in a test that blocks a thread and finds its own function's address; a real-binary run on the build VM, built with a wedge-test Cargo feature (never in a release build) that blocks every runtime worker some seconds after start: the watchdog writes the dump and the process exits with status 70 within stall_secs and one check, as a supervising shell loop sees, and the dump's stacks name the blocked function. Amended 2026-11-19 (hand-off 20; amendment Proposed): the restart limit is no longer silent. No threshold, exit code or limit changed: when a stall begins and max_restarts_per_hour restarts are already counted for the hour, the node is still left running, and the watchdog now says so. (1) The dump it writes starts TelltaleDNS watchdog dump: restart cap reached; not restarting, and its action line gives the numbers. (2) The watchdog's thread logs one ERROR line with the same words. (3) While the stall lasts it logs that line again once an hour, with how long the node has been silent, and writes no new dump: the rotation keeps five, and a repeat would push out the dumps that show how the stall began. (4) When both checks pass again it logs one line saying the node answers again, how long after the stall was reported and how long it had been silent when it was reported (a report comes stall_secs into the outage, so "after" alone understated it; final review F2). (5) telltale_watchdog_restart_cap_reached_total counts these stalls, one per stall (a repeat is not another). All of it is an atomic and a tracing call on the watchdog's own thread, so it needs nothing from the runtime and works with the runtime stuck. But a stuck runtime also can't answer a scrape, so the counter helps after a recovery and while only the UDP listener is stuck. It is an in-process count that starts again at 0 when the node restarts, so the post-mortem evidence is the log and the dump, not the counter (final review F3); the docs say so and do not offer it as an alert for a runtime wedge. The decision is still made once per stall (above): an hour into a long stall the limit's window has passed, and the watchdog does not restart then. Whether it should is open for the owner (the conservative choice is the existing behaviour). Verification: the ops_012_*cap* tests (the dump's first line; one line, then one an hour, with a clock the test moves; a stall that ends by itself says so once; the counter; the line comes from run on a plain thread with no runtime) and a real process on a wedge-test build with max_restarts_per_hour = 0.

Requirements NFR-003 OBS-020

Builds on ADR-156 ADR-164

Referenced by ADR-164 ADR-168 ADR-174

ADR-164 Debug files for every build: link once with line tables, publish the split-off symbols beside the stripped binaryAcceptedNFRGitHub issue #7.

Context

GitHub issue #7. The release binary is stripped (strip = true), so a stack taken from a hung node (a gdb or eu-stack capture, or the watchdog's dump, ADR-163) is a list of addresses nobody can read. The owner promised the reporter "debug symbols with 0.7.0" (2026-11-14). Two things limit the options: the image must stay under 15 MiB compressed per architecture (NFR-001), and the binaries are built reproducibly with cargo auditable (NFR-005), whose dependency data (.dep-v0) must survive. Decision (proposed):

  • One link, then a split. The Dockerfile's build stage links with strip = none and debug = "line-tables-only" (the profile's environment overrides, in that build only), then uses llvm-objcopy from the pinned toolchain's llvm-tools component: telltale.debug gets the symbol table and the line tables (--only-keep-debug); the shipped binary is the same link output with the symbol table and debug sections removed, .dep-v0 kept, and a .gnu_debuglink to the debug file's name and CRC. A second build with symbols would have a different layout, so its addresses wouldn't match the shipped binary; -C split-debuginfo keeps no symbol table and isn't supported for fat-LTO static musl builds through zig.
  • No build ID. The zig linker writes none, so the pairing is the release it came from (same version, same architecture) and the debuglink's CRC, which gdb checks.
  • Published as telltale-<arch>-linux.debug.zst (zstd level 10) for the three architectures, in every release and every edge build, under the signed SHA256SUMS like the binaries and their SBOMs (verify.sh checks that the lines exist). releases.json doesn't list them: a node never fetches one, and self-update takes only its own binary by name.
  • What it costs, measured on the build VM (2026-11-16, the real Docker build for amd64):
    • The shipped binary is 34,754,048 bytes against 34,748,816 (5,232 more, 0.015%): .text is 4,864 bytes larger and everything after it shifts, because turning debug info on changes the linked layout a little (it also adds a one-byte .debug_gdb_scripts reference). It is not byte-identical code, so it was benchmarked rather than assumed: bench-smoke alternating baseline and split binary, ten runs each: cache-hot throughput median 530,993 against 526,753 qps (ranges 482k to 586k and 449k to 557k), cache-hot p50 45.5 against 33.0 µs, miss-heavy p50 217 against 223 µs. No difference beyond the run-to-run spread.
    • The debug file is 141 MB raw, 25.5 MB at zstd 10 (21.4 MB at 19). Three of them add about 75 MB to each edge publish.
    • The stripped binary no longer carries the .comment section (the compiler's identification string).
  • Reproducibility. The nightly two-clean-builds check still compares the binary byte for byte; it reports as a warning if the two debug files differ.
  • Reading a stack: zstd -d telltale-<arch>-linux.debug.zst -o telltale.debug, then addr2line -e telltale.debug -f -C -i <address> (docs/running.md). With line tables, an inlined call shows the line of its own source.

Alternatives rejected

shipping the unstripped binary (141 MB more in every image); full debug info (several times larger, and the line tables answer what a stack needs); a debuginfod server (a service to run); symbols only, no line tables (byte-identical code, and function names alone lose where inside a large function the thread waits).

Consequences

the Docker build adds a few seconds; the image workflow uploads 75 MB more; the release page gets three more files; a stack from any build can be read after the fact if its release's debug file is kept (edge builds are replaced on every push, so a dump from an edge build is read with that build's file while it is still published). Accepted 2026-11-16: the owner answered "Push and accept" after seeing the numbers above, including that the code is not byte-identical and that the images were already within 0.34 MiB of the 15 MiB gate (this adds about 0.04 MiB). Verification (planned): the A/B above; the split binary keeps .dep-v0 and gains the debuglink; addr2line on the debug file resolves a frame the watchdog's e2e produces (ADR-163's deploy/watchdog/e2e.sh on a debug build); the edge image run publishes the three files and the size gate and SBOM checks still pass.

Requirements NFR-001 NFR-005

Builds on ADR-163

Referenced by ADR-163

ADR-165 A member with no one to hand over to may use the rest of the budgetAcceptedGitHub issue #35 (0.7.0-edge).

Context

GitHub issue #35 (0.7.0-edge). spec/04 §4 caps each attempt at min(timeout_ms (400 ms by default), 3 × EWMA + 50 ms, 1 s). A forwarder's EWMA reflects its cached answers: about 6.5 ms for NextDNS over DoH on a home network, so the cap is about 70 ms. A name the forwarder has to resolve itself takes much longer: a carrier's Wi-Fi Calling gateway with TTL 0 took 900–1,200 ms at Cloudflare, Quad9 and NextDNS alike. In a group of one, that single attempt timed out at ~70 ms, Group::resolve had nothing left to try, and the client got SERVFAIL ("no upstream answered") after ~100 ms with 1.9 s of the budget unused. On two nodes in a day: 346 SERVFAILs (0.3 % of answers, enough to fire the availability SLO's ticket alert), 735 upstream timeouts, 2 upstream SERVFAILs; every lookup of the Wi-Fi Calling name failed. Larger groups do the same when every member is cut off. timeout_ms can't help: it only lowers the cap, and its 400 ms default is below these answers too.

Decision

  • The adaptive bound and timeout_ms are there to give up on one member and move to the next; hedging (ADR-013) already starts the next member before that. So the attempt on the last member in the attempt order whose breaker is closed may use the query's whole budget (Upstream::timeout_for(true)), bounded by what's left of it, as recursive upstreams already may (ADR-074). Earlier members keep their timeouts, and hedge delays are unchanged.
  • Members whose breaker is open or half-open (last resorts and probes) never get it. An upstream that is really down costs up to the budget per query until three timeouts in a row open its breaker, and then, as a last resort, fails within its timeout_ms (400 ms by default).
  • No retry of a member that timed out: the one attempt waits longer, so the upstream isn't asked twice and no timeout is recorded against an upstream that was only slow (answered within the budget).
  • Correction (2026-11-21, parallel; PR #76, contributed by Michael Roughton): "earlier members keep their timeouts" assumed every earlier member has a later one to hand over to. parallel starts its first parallel_fanout members at once, so none of them does. The members sort by EWMA and only the last member with a closed breaker was patient, so the faster racing members were cut off at 3 × EWMA + 50 ms: the fastest one in a group of two, and every racing member when a slower member follows them. With Cloudflare (EWMA about 10 ms over DoH, so about 80 ms) and Google racing, every name Cloudflare had to resolve itself (typically 100–200 ms) was abandoned while Google, the last member, was waited for: about 7 % of Cloudflare's attempts counted as timeouts (none against Google, and none when the same names were sent to Cloudflare directly), its breaker opened now and then, and cold lookups took Google's time instead of the faster answer. So with parallel, every member with a closed breaker among the first parallel_fanout is patient too; members after them, probes and last resorts are not, and the other strategies are unchanged. Hedge delays are unchanged, but a racing member that is no longer cut off no longer starts the next member early: with three or more members, the first one after the race starts at the last racing member's hedge delay, which can be later than the old cut-off (by up to 3 × the difference between the last and the first racing member's EWMA, less 40 ms). Tested by ups_005_parallel_racing_members_are_patient, ups_006_probe_and_last_resort_never_patient, ups_006_one_at_a_time_strategies_patient_only_last_closed and ups_005_parallel_members_each_wait_for_a_slow_answer.
  • Correction (2026-11-23, the end of a query): a patient attempt's timeout ends at the query's deadline. A query that ended there with only a SERVFAIL or REFUSED in hand, or with nothing, returned and dropped its attempts, which aborted those still running before they recorded an outcome: a dead sole upstream cost the full budget on every query and its breaker never opened (only the active checks could bench it), and the same held for a silent member behind a SERVFAIL and for every member of a parallel group in a total outage. Attempts still running when resolve returns now finish in the background, as the losers of an answered query already did, and record their outcome. The client's answer is not delayed: the query still returns at its deadline. Each attempt ends at its own timeout, which was set from what was left of the budget when it started, so at most one attempt per member is outstanding for each resolve started in about the last 2 s (one client cache miss can start several: DNSSEC validation looks up keys and proofs through the same group); a retry over TCP after a truncated answer (up to timeout_ms of its own) and DNSCrypt's rounds can run past that. One consequence: a name the upstream takes longer than the budget to answer (over 2 s) now counts as a timeout against the patient member, where the aborted attempt recorded nothing. Three of those in a row, with no answer from it in between (a NOERROR, NXDOMAIN, SERVFAIL or REFUSED resets the count), bench even a healthy sole upstream for 10 s (doubling, up to 5 minutes, while its probes fail). While benched it is a last resort with its timeout_ms, so cold names slower than that (400 ms by default) get SERVFAIL until a probe succeeds. That is bounded by the breaker's backoff, and narrower than 0.7.0, which cut every attempt at min(timeout_ms, 3 × EWMA + 50 ms, 1 s), so that names slower than about 70–400 ms counted the same way. Tested by ups_006_silent_member_behind_a_servfail_is_benched, ups_006_dead_sole_upstream_is_benched, ups_006_query_ends_at_its_deadline_while_its_attempt_finishes and ups_006_burst_of_misses_leaves_no_attempt_behind.
  • What the parallel correction costs: a racing member that goes silent. Its attempts now run for the budget (2 s) instead of about 3 × EWMA + 50 ms, in the background while the other member answers, so its three timeouts, and its open breaker, come about 2 s after it goes quiet instead of almost at once, and until then every cache miss leaves a 2 s attempt to it running. After that it is a last resort with its timeout_ms (400 ms by default; the recorded timeouts lift its EWMA above that): started with the admitted members when fewer than parallel_fanout are admitted (as in a group of two), else after them, once the hedge delay has passed or one of them has failed. In a local test at 100 cache misses a second, the breaker opened after 2.0 s instead of 79 ms, with up to 201 attempts to the silent member outstanding instead of 44; clients still got the other member's answers in a few milliseconds. The recorded 2 s timeouts also raise its EWMA, so after it recovers it sorts behind the other member for longer. Clients don't wait while the other member answers NOERROR or NXDOMAIN; if it answers SERVFAIL or REFUSED quickly, that answer is kept as the fallback and the client waits for the silent member: up to the budget (serve-stale still answers at 1.8 s) until it is benched, then up to its timeout_ms. In the local test with the other member answering SERVFAIL in 5 ms, queries sent one after another: 2.0 s for each of the first three, then 0.40 s. Queries that start before the first three timeouts land (about 2 s after the member went quiet) each wait the full 2 s. Before, only the first such query got the SERVFAIL after the silent member's short timeout: in a group of two, the timeout recorded then sorted the silent member last, which made it the patient one, so the queries after it waited for it too. This is the trade this ADR made for the last member, now made for each racing one.

Consequences

a slow name is answered in the time it takes, up to the budget, for single-upstream setups too. A blackholed sole upstream makes clients wait up to 2 s for SERVFAIL, not 70–400 ms, until three timeouts in a row open its breaker (the first three queries when they come one after another; every query started in the 2 s before those timeouts land waits the full 2 s), and then up to its timeout_ms for as long as it doesn't answer, since last resorts and probes are never patient (measured, queries one after another: 2.0 s for each of the first three, then 0.40 s). Serve-stale (1.8 s) is unchanged. The patient attempt is at most the 2 s budget, under the 3 s after which a silent pooled connection is closed (ADR-148). Tested by ups_006_single_member_waits_for_a_slow_answer and ups_006_last_healthy_member_waits_for_a_slow_answer.

Builds on ADR-013 ADR-074 ADR-148

Referenced by ADR-197

ADR-166 UniFi: name offline clients from the console's client history and configured clientsAcceptedT8.2, ADR-080 ("not done: UniFi's offline known clients").

Context

T8.2, ADR-080 ("not done: UniFi's offline known clients"). stat/sta lists only connected clients, so a device that has since left (a phone off Wi-Fi, a laptop asleep) loses its name: its queries in the log and the top lists show a bare address, though UniFi still has its alias. Decision (proposed):

  • After stat/sta, each UniFi poll also reads the v2 client history (/v2/api/site/{site}/clients/history?withinHours=<offline_days × 24>, Network 7+, the clients the console remembers within the window, with their last_ip; it answers to an API key) and the configured clients (/api/s/{site}/rest/user: aliases and fixed addresses), with the same API key or login cookie.
  • Both are best effort: a console that can't answer either (an older Network application has no v2 API) still gives its connected clients, and the failure is logged at debug only, so the router isn't marked as failing.
  • A known client is used only if it has a name (an unnamed one adds nothing a bare address doesn't). Merged by MAC: a connected client keeps its address and takes a known name only when it has none. An offline client gets its last address, else its fixed one (only while use_fixedip is on: UniFi keeps fixed_ip after a reservation is turned off), and only if no connected client holds it; between offline clients claiming one address, the most recently seen wins.
  • Bounded (added in review; the first version asked for every remembered client, with no limit). (1) [[router]] offline_days (default 30, 0 for connected clients only, at most 365): the window goes to the console as withinHours, and every row with a last_seen older than it is dropped (a row with no date can't be judged and stays). (2) At most 1,024 offline clients per poll, most recently seen first (OFFLINE_MAX): they ride in every node's answer to devices.names (about 130 bytes each, against the cluster channel's 1 MiB frame) and sit in memory on every node. (3) An offline client is marked (Lease.offline) and is not "seen": it names an address in the query log, but device identification (ADR-117) doesn't count it. Counted there, a remembered device would never age out, and with identify.max_clients (1,024) the places taken by devices that aren't there could push out ones that are.
  • The default is not written to the replicated configuration and the mark is not written for a connected client, so a node on a build before this one (the [[router]] section refuses unknown fields) still reads the shared configuration and the devices.names answers. Roll every node before setting offline_days in the shared configuration.

Consequences

  • Offline devices keep their UniFi names in the UI and the query log. Two more read-only requests per poll (every interval_secs, 300 by default), for the last 30 days only: a site with thousands of remembered clients no longer makes an answer that grows with its whole history. This turns on for every existing UniFi integration at the default; offline_days = 0 restores the old behaviour.
  • A stale last address can name a device UniFi doesn't see now (a guest that left, its address since leased to something unnamed TelltaleDNS can't tell apart). Names configured in TelltaleDNS and its own DHCP leases still win.

Builds on ADR-080 ADR-117

Referenced by ADR-080 ADR-183

ADR-167 Domain icons: a brand tile or a monogram, drawn locally and never fetchedAcceptedA user asked for icons left of domain names, from https://icons.duckduckgo.com/ip3/&lt;domain&gt;.ico.

Context

A user asked for icons left of domain names, from https://icons.duckduckgo.com/ip3/<domain>.ico. The owner declined any dependency on a third-party icon service (2026-11-16). Measured that day: the endpoint is unofficial (no published terms, uptime, or rate limit), serves ICO only, and answers a 404 with a grey placeholder for a subdomain or a name with no site (api.github.com, time.nist.gov); and every icon request tells the service which names are in the query log, which shows work names, internal names, and trackers. The UI's content security policy allows images only from 'self' and data:, and at privacy level 1 and up names are hashed (ADR-102), so there would be nothing to look up. Fetching from the sites themselves, from the server, would connect a resolver host to names any client chooses, many of them blocked or malicious (an SSRF and egress risk; review 06-02 fixed one of this kind). A lab on a synthetic demo network, in light and dark and at 390 px, showed the design below on the real lists. Decision (the owner chose it on that lab, with rounded shapes, 2026-11-16):

  • The UI draws a mark left of a domain name in the dashboard's Top domains and Top blocked lists and in the query log's name column. All of it is drawn in the browser from data already in the UI: no request is made for an icon, the content security policy is unchanged, nothing about queries leaves the page, and the DNS path and the API are untouched.
  • A name that belongs to a brand in the map gets the brand's tile: its colour and glyph from Simple Icons (CC0-1.0, pinned at 16.38.0; the marks are their owners' trademarks and only identify the name). The map is curated, from a list in ui/scripts/brand-icons.mjs: 107 of the 133 brands listed have a glyph, mapped from 228 domains and hosts (CDN names too: nflxso.net is Netflix). The longest matching suffix of a name, on whole labels, wins, so notnetflix.com is not Netflix. The script writes the committed data files (brands.ts, map.data.ts): a build never needs the network or the package.
  • Every other name gets a monogram: the first letter of its owner's label, in a tint of a hue taken from a hash of the registrable domain (one lightness and one chroma for every hue, so none outweighs another; both themes). A name of the network itself (.arpa, .lan, .local, .home, .internal, .svc, one label) gets a quiet house. A name the privacy level hid (h and 16 hex digits) gets nothing, and must not pass for a name of the network.
  • A blocked name wears the same mark with most of its colour drained. A near-black mark flips to a light tile in the dark theme.
  • The glyphs are a separate lazy chunk (about 120 KB raw, 51 KiB gzipped), fetched when the first brand tile is needed. Monogram only and Off never fetch it.
  • The choice is Settings → Account → Domain icons: a style (Brand and monogram, the default; Monogram only; Off) and a size (Default, 20 px; Small, 16 px). It is kept per user in the browser (telltale.icons.<user>), like the detail level: no server state, no API, no configuration, nothing in the cluster.

Consequences

  • The open set has dropped several large companies' marks (Microsoft, Amazon and AWS, LinkedIn, Slack, Disney+, Hulu, OpenAI, Xbox, Minecraft, Nintendo, Adobe, the BBC, Bing; 25 of the 133 listed brands), so their names wear a monogram. 20 of the 27 service presets get a brand tile. A name outside the map is a monogram, never a guess.
  • The map is data we maintain: a brand is added to the list and the data regenerated. docs/third-party-notices.md carries the Simple Icons notice and the trademark disclaimer.
  • Cost: about 6 KiB gzipped in the main chunk and the 51 KiB lazy chunk (the UI is 295.6 KiB of its 400 KiB budget); no server work.
  • Other pages (Clients, a device, Analyze, Explain, Flow, the Traffic map, the Wall) don't carry the mark yet.

Amended 2026-11-17 (the owner: "go on adding the bootstrap icons pack as well as long as it doesn't create too much overhead"): a second pack, for the marks the first one dropped.

  • Bootstrap Icons 1.13.2 (MIT) is the second choice: when Simple Icons has none of a brand's candidate slugs, the generator takes the Bootstrap glyph named with a bi: prefix in the list. Eleven of the 25 missing brands have one: Microsoft (also used for Office, Azure, and Edge names, which have no mark of their own), Teams, Windows, Xbox, Bing, Skype, LinkedIn, Amazon, Slack, OpenAI, Nintendo. Disney+, Hulu, Minecraft, Adobe, the BBC, Walmart, and AWS are in neither pack and stay monograms. A glyph with no colour gets a brand colour chosen by hand in the generator (BOOTSTRAP), and its path sits on a 16 grid, so the data carries the grid size when it isn't 24 and the component reads it.
  • Overhead: none at run time, and the chunk is smaller. The generator now minifies path data with svgo to two decimals (a third of the bytes, under 1% difference at 16 and 20 px), which more than pays for the eleven added glyphs: the glyph data is 86.9 KiB raw and 35.4 KiB gzipped (it was about 118 and 51 for 107 glyphs). svgo, and both packs, are used only when the generator runs (npm i --no-save, pinned in the script, checked by it); nothing is added to package.json, to the build, or to the image.
  • docs/third-party-notices.md carries the Bootstrap Icons licence; the developer page site/dev-icons.html has the recipe for adding a brand or a pack.

Builds on ADR-102

Referenced by ADR-189 ADR-190

ADR-168 A leaner image: the OpenAPI document compiled in, a gzip-only embedded UI, no CA bundleAcceptedNFRThe image gate is 15 MiB compressed per architecture (NFR-001).

Context

The image gate is 15 MiB compressed per architecture (NFR-001). At 13bb27d the images were 14.84, 14.16, and 14.82 MiB (amd64, arm64, armv7), so one more feature of the size of the domain icons (+0.11 MiB) would have failed the gate on amd64 and armv7. A measured review (2026-11-17: the compressed layer sizes the gate sums, three release builds on the build VM, the BuildKit CI uses) found where the bytes are. The binary is about 97% of the image. Of it, utoipa's OpenAPI document builder was about 0.6 MiB, and the 677 KB document was rebuilt at every request. The embedded UI cost about twice its gzip size, because the build kept a raw copy beside each .gz and the layer's compression can only shrink the raw one. And a CA bundle (0.12 MiB) that no code reads. Decision (the owner chose these, 2026-11-17):

  • GET /api/v1/openapi.json serves docs/api/openapi.json, compiled in with include_str!, not a document built from ApiDoc while running. api_001_committed_openapi_matches_the_code still builds it from the code (a test-only function) and keeps the file equal to it; UPDATE_OPENAPI=1 regenerates the file.
  • npm run build replaces each text file in ui/dist with its .gz when that is smaller (ui/scripts/postbuild.mjs). The server sends the stored file unchanged to a client that accepts gzip, and inflates it for any other (curl without --compressed, a probe) with miniz_oxide, which is already in the tree. A file with no .gz is served as stored, and a damaged .gz is refused (500), never served half-read. This amends ADR-030's size-and-caching bullet ("so no compression crate on the server"): the server now has an inflater, and no new crate.
  • The image has no CA bundle (/etc/ssl/certs/ca-certificates.crt). Every TLS client (upstream DoT and DoH, list fetches, event sinks, SMTP) verifies against the Mozilla roots compiled in with webpki-roots; none reads the system store, and rustls-native-certs is not in the lockfile. A private CA is set with tls_ca as before, which doesn't depend on the bundle's path.

Not done (reviewed): zstd layers (about 2.1 MiB smaller, but Docker before 23.0 and containerd before 1.5 can't pull them, and Debian 12's docker.io is 20.10); removing .eh_frame (the watchdog's stack capture unwinds with it, ADR-163); the linker's identical-code-folding (the cross compiler rejects it); zopfli re-compression of the layer (pipeline and provenance cost); a smaller zoneinfo and SQLite without its unused full-text and R-tree modules (ADR-169); building crates off the DNS path for size (decided after a benchmark).

Consequences

  • The three changes took the images from 14.84, 14.16, and 14.82 MiB to 13.83, 13.08, and 13.54 (amd64, arm64, armv7; read from the size gate of the CI image job on 3027e71; measured per item on the build VM for amd64: OpenAPI -0.60, UI -0.29, CA bundle -0.12), and every future UI file costs about half what it did.
  • Serving the OpenAPI document is faster: no 677 KB document is built per request. The served document can't differ from the committed one, and the drift test is what keeps the committed one equal to the code.
  • A client that doesn't accept gzip costs one inflate of at most about 700 KB per request (rare: browsers always accept gzip).
  • spec/08 §2 no longer lists a CA bundle in the image.

Requirements NFR-001

Builds on ADR-030 ADR-163 ADR-169

Referenced by ADR-030 ADR-169 ADR-170 ADR-189 ADR-190

ADR-169 A compact zoneinfo and SQLite without its unused modulesAcceptedFLTADR-168 left two low-risk cuts undecided.

Context

ADR-168 left two low-risk cuts undecided. The owner chose both on 2026-11-17 ("do items 3 and 4 too") after T23.1 took the images to 13.83, 13.08, and 13.54 MiB. The review had measured them on amd64: a slim zoneinfo -0.25 MiB, SQLite without full-text search and the R-tree index -0.20 MiB. Neither is on the DNS path.

Decision

  • The image's zoneinfo is built by zic -b fat from the package's own tzdata.zi (Dockerfile) instead of copied from /usr/share/zoneinfo. Debian's package ships the database three times (the main directory, posix/, and right/, which carries leap seconds); the build writes it once, with each name a hard link to one file, and copies it with cp -a so the layer stores each file once. Measured with tar and gzip on the build VM (tzdata 2025b): 347 KB for the distribution's directory, 151 KB built this way. The build fails if a zone name the distribution's directory has is missing from it (the host's own localtime and posixrules links and the two extra trees aside). jiff is the only reader (schedule time zones, FLT-010). crates/telltale-config/tests/zoneinfo.rs builds a directory the same way from the host's tzdata.zi and checks that jiff reads every file, that every name is present, and that the offset, abbreviation, and daylight-saving flag agree with the host's directory for every zone (weekly) and for twelve zones with every kind of rule (every six hours), from 2020 to 2075.
  • zic -b slim was built, tested, and is not used. It is 87 KB, 0.06 MiB smaller still, but jiff 0.2.37 refuses one of its 598 files: America/Ojinaga from tzdata 2025b ("expected last transition in TZif file to have DST offset matching the offset derived from the POSIX time zone transition rule"), so a schedule in that zone would be rejected as an unknown time zone. The first version of this change was slim; the test found it. The fat files, which are what distributions ship, are all accepted. If a later jiff accepts the slim file, the 0.06 MiB can be taken, and the test is the check.
  • SQLite is built without FTS3, FTS5, the R-tree index, and the dbstat table, by LIBSQLITE3_FLAGS (-U flags, which the bundled SQLite's build script applies after its own -D defaults). The flags are in the repository's .cargo/config.toml, not in the Dockerfile, so cargo test runs against the SQLite the image ships and anyone building from source gets the same one. crates/telltale-store/tests/sqlite_build.rs asserts the four modules are gone and that foreign keys on by default, the JSON functions, STAT4, column metadata, and thread safety stay. No code here uses a virtual table, MATCH, or dbstat. A real image build confirmed it: none of the four option strings is in the shipped binary, and STAT4, column metadata, and the foreign-key default are.

Not done

a slim zoneinfo (above); dropping the other optional parts of the bundled build (load-extension support, soundex, API armor): they cost little and are harder to be sure of.

Consequences

  • About 0.4 MiB less on amd64. A real image build with the slim variant printed 13.32 MiB against 13.83; the fat variant adds about 0.06 MiB. The size gate in CI prints the real numbers.
  • A zone that only a posix/ or right/ path named (nothing here uses one) is no longer in the image. A time zone added to the database later is picked up by rebuilding the image, as before.
  • A SQLite file that defines a full-text or R-tree table still opens (SQLite looks a module up when the table is used); using such a table fails with "no such module".
  • spec/08 §2 says the image carries a compact zoneinfo.

Requirements FLT-010

Builds on ADR-168

Referenced by ADR-168 ADR-170

ADR-170 Crates off the DNS path are built for sizeAcceptedAfter ADR-168 and ADR-169 the images were 13.39, 12.66, and 13.10 MiB of the 15 MiB gate.

Context

After ADR-168 and ADR-169 the images were 13.39, 12.66, and 13.10 MiB of the 15 MiB gate. The 2026-11-17 review found that building the crates that are not on the DNS path with opt-level = "s" instead of 3 makes the binary smaller, and asked for a benchmark first, because performance ranks above footprint. The owner chose to take it if it was safe ("Yes", 2026-11-17) and to measure SQLite's C code at -Os separately. Measured (the build VM; release profile with fat LTO; binaries built from 938c9a9, stripped and gzipped as a stand-in for the layer):

  • The off-path list (26 package specs in the measurement, rusqlite among them): 13,116 to 12,746 KiB, -0.36 MiB. Of the 1,737 functions in the DNS-path crates (telltale-proto, -net, -cache, -filter, -policy, -telemetry, -upstream), 1,724 are identical in size and 13 differ: startup and configuration code (the preset deserializers, a once-cell initializer, a telemetry drain), none per query. Rotated bench-smoke with an identical-binary control, five rounds, cache-hot median: baseline 526k queries/s, control 500k (-5.0%), this list 510k (-3.2%), inside the control's spread. Miss-heavy: flat.
  • The same list plus telltale-config: -1.0 MiB in all, but ClientTable::identify (per query) grew from 3,428 to 4,039 bytes, the query handler changed, and cache-hot throughput was 474k (-9.9%, median p50 95 µs against 55). Not taken.
  • SQLite's C code (libsqlite3-sys) at -Os: a further -0.31 MiB, but on the rollup store's own tables and queries (hour_top and rollup_minute, in memory, a copy of the binary as control within 0.5%) the dashboard's week-wide top list was 10.5% slower, minute-blob range reads 11%, hourly point reads 22%, and bulk insert 38%. Not taken.
  • The rusqlite wrapper at "s": top list -0.8%, blobs -0.8%, bulk insert +0.5%, point reads +4.6% (the control's spread was about 4%). The saving is small and it is on that same query path. Not taken.

Decision

the 25 package specs in [profile.release.package.*] of the root Cargo.toml (the HTTP API and its OIDC, OpenAPI, and certificate parts, cluster replication, the git source, the support package, and the config-file parsers) are built with opt-level = "s". telltale-config, rusqlite, libsqlite3-sys, and every crate that runs per query stay at the release profile's 3. crates/telltale-config/tests/profile.rs fails if a hot-path crate is added to the list, if an entry is not exactly opt-level = "s", or if an entry no longer matches Cargo.lock (a name@version entry that a dependency update outdates is only a cargo warning, and the saving would be gone without anyone noticing).

Consequences

  • About 0.35 MiB less on every architecture (the size gate in CI prints the real numbers).
  • The API, OIDC, and replication code is somewhat slower per call. It runs per request and per replication message, not per DNS query, and the dashboard's own queries run in SQLite, which is unchanged.
  • A new crate on the DNS path is not on the list by default; one that is added to the list has to pass the test, which names the crates known to be hot.

Builds on ADR-168 ADR-169