Repository navigation
feat(mesh-dns): split nodata from answered and bucket the query type - #598
Merged
Merged
Conversation
Completes the deferred qtype/nodata half of the mesh-DNS query-metric breakdown. #596 already gave aether.mesh_dns.queries its proto attribute and the responses_truncated_total counter; this is the rest. The `answered` result conflated two operationally different things: a real A hit, and the NODATA reply a known mesh name gets for a non-A type (AAAA), which exists so the name consistently EXISTS for c-ares. A healthy mesh shows a steady NODATA trickle from the AAAA half of every dual-stack lookup, so conflated, NODATA rising against real hits — clients failing over to IPv6, or a record table that stopped producing usable A records — is invisible. They are now separate result values. NODATA still counts as an answer for last_answered_timestamp_seconds: it is an authoritative reply produced from the record table by a handler that ran end to end. The new qtype attribute is BUCKETED, never raw. DNS defines ~90 query types and the CNI DNATs every managed pod's :53 straight at this resolver, so an arbitrary client could otherwise inflate the counter's series count at will. Everything unrecognised collapses to `other`, bounding the counter at 8 qtype x 6 result x 2 proto = 96 series per node. qtype is deliberately NOT added to the duration histogram: 15 explicit buckets make each extra dimension expensive, and latency here is decided by the path taken — which `result` already names — not by the type asked for. Metrics-only: no resolver semantics change (EDNS0 echo, NODATA-for-non-A, never-forward-the-mesh-zone, SO_REUSEPORT, the self-check watchdog, TCP forwarding and the snapshot envelope are all untouched). Follows #586. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #586, completes the deferred qtype/nodata split. #596 already delivered the other half of that item (the
protoattribute +aether.mesh_dns.responses_truncated_total); this is the rest. Metrics-only.1.
nodatasplit out ofansweredserveMeshrecordedansweredfor BOTH a real A hit and the NODATA reply a known mesh name gets for a non-A type (AAAA → NOERROR + empty answer, deliberate so the name consistently EXISTS for c-ares). Those are operationally different: a healthy mesh shows a steady NODATA trickle from the AAAA half of every dual-stack lookup, so conflated, a rise in NODATA against real hits — clients failing over to IPv6, or a record table that stopped producing usable A records — is invisible.The reply is byte-for-byte unchanged; only the metric result differs. An A query whose stored record is not a parseable IPv4 also lands in
nodata, which is the point: a record-table defect showing up as unexpectednodataonqtype="a"is exactly the signal wanted.NODATA still counts as an answer for
last_answered_timestamp_seconds— it is an authoritative reply derived from the record table, produced by a handler that ran end to end (so watchdog/staleness semantics are unchanged).2. Bucketed
qtypeattributeCardinality was the whole risk, so the value set is closed. DNS defines ~90 query types and the CNI DNATs every managed pod's
:53straight at this resolver, so untrusted queries genuinely reach it and a rawqtypewould let any pod on the node inflate the counter's series count at will.queryQTypemaps into a fixed set and everything unrecognised collapses toother:aaaaanodatatrickle, and the IPv6-failover signalhttpsotherwould bury the genuinely exotic queriesotherexists to exposesrvptrtxtcnamedig CNAME) and some client libraries ask directly; separates an operator/tool pattern from workload trafficotherWorst case is bounded at 8 qtype x 6 result x 2 proto = 96 series per node, no matter what is asked; in practice only a handful are ever non-zero.
qtypeis NOT added to the duration histogram. Its 15 explicit buckets make every extra dimension expensive (proto would double it, qtype would multiply it by eight), and neither buys anything: latency here is decided by the PATH taken, whichresultalready names. A mesh hit and an AAAA NODATA do the same map lookup under the same lock; a forwarded SRV costs the same kube-dns round trip as a forwarded A.qtype/protoanswer "what is being asked, over what" — a counter question.Not changed
EDNS0 OPT echo, NODATA-for-non-A, authoritative never-forward-the-mesh-zone, SO_REUSEPORT, the #596 self-check watchdog and TCP-forward logic, the snapshot envelope/heartbeat. No chart change, so no Chart.yaml bump.
Verification
Slim dep graph re-proven — both
somepathqueries from//agent/cmd/mesh-dns:mesh-dnsare empty:bazel build //agent/... //charts/...green;bazel test //agent/...28/28 passbazel build --config=ci //agent/...green (gocognit)bazel run //:format+make format-checkclean; BUILD.bazel viamake gazelle(no new external deps)New
metrics_test.godrives the real handler through a manual OTel reader and asserts on the attributes actually exported: A hit →answered/qtype=a; AAAA on a known name →nodata/qtype=aaaa; NAPTR/ANY/CAA/61234 all collapse to a singleotherseries;protostill splits udp vs tcp; miss/cold results keep their qtype; plus a table pinning the closed bucket set.🤖 Generated with Claude Code
https://claude.ai/code/session_01EioJVuoepwStjHoRLB52WR