A statistics service aggregates every answered query in memory and writes this node's counters, answer mix, upstream latency and top-N rollups each minute #112
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
Reference
lantea-one/ninlil#112
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
This is the writer for #111. It must not touch the database per query, the same rule as
DnsQueryLogSubscriber(DnsQueryLogSubscriber.cs:26-31).What changes
src/dotnet/src/Ninlil.Dns.Server.Statisticsand its tests projectsrc/dotnet/tests/Ninlil.Dns.Server.Statistics.Tests, added toNinlil.slnx. It holds the DNS accumulator, the writer and the retention pass for every statistics row, DNS and DHCP (#116 adds the DHCP part).ServiceCollectionStatisticsExtension, wired inProgram.cs.ClusterOptions.NodeId.Program.cssets it on every start, fromcluster-node-id.txt, whether clustering is on or not (src/dotnet/src/Ninlil.Web/Program.cs:234-245;src/dotnet/src/Ninlil.Dns.Server.Cluster/Options/ClusterOptions.cs:27-33).Program.cshands it to the statistics project through a smallIStatisticsNodeIdentitysingleton, so the project does not referenceNinlil.Dns.Server.Cluster.DnsServerEventPublisher.InstanceId, which is a newGuidper process (src/dotnet/src/Ninlil.Dns.Server.Core/Events/DnsServerEventPublisher.cs:90), so every restart would look like a new node.DnsQueryAnsweredEventsubscriber feeds an in-memory accumulator:dns:queries.total,queries.blocked,queries.cached,queries.nxdomain,queries.servfail,latency.sum.us,latency.count. The console derives "allowed, not cached" as total minus blocked minus cached.qtype.<TYPE>,rcode.<RCODE>,source.<AnswerSource>. A query type outsideDnsResourceRecordTypeEnumcounts asqtype.OTHER, so the name set stays bounded.upstream.<name>.latency.sum.usandupstream.<name>.count, from the #101Upstreamfield (forwarder names, orrecursive). Technical call: sums and counts, not averages or percentiles, because only sums add up correctly across buckets and nodes.FlushIntervalthrough #111: each counter goes to its minute row and its hour row. The answer mix is written to hour rows only (the doughnuts cover 24 h or more). It runs retention once an hour.DomainRedactedor above: noDomainorBlockedDomaintop items.ClientAnonymized:Clientkeys are the subnet the query log stores (last IPv4 octet or last 64 IPv6 bits zeroed).FullyAnonymous: noClienttop items.StatisticsOptions, sectionStatistics(it covers DNS and DHCP):Enable(default true),MinuteRetention(default 2 days),HourlyRetention(default 90 days),MaxKeysPerHour(default 10,000),FlushInterval(default 1 minute).src/dotnet/src/Ninlil.Web/EnvironmentVariables/OptionsEnvironmentVariableRegistry.cs.ClusterQueryStatsAggregator) is unchanged. README says both.Acceptance
queries.total = 10,queries.blocked = 3under the fake node id, and the top blocked domain count is 3.qtype.AAAA = 2andqtype.MX = 1hour rows.upstream.quad.latency.sum.us = 4000andupstream.quad.count = 2.MaxKeysPerHour = 2, a third distinct key goes to the overflow bucket.DomainRedactedno domain top item is written; atFullyAnonymousno client top item is written; counters are written at every level.src/dotnet/tests/Ninlil.Web.Tests: the registeredIStatisticsNodeIdentityequals the host'sClusterOptions.NodeId.Events/) before and after, in the PR.Source
audit-feature-parity.md§2A #1.