The dashboard shows DNS and DHCP statistics as charts that follow the light and dark themes, for all nodes combined or for one node #110

Open
opened 2026-10-31 12:42:08 -04:00 by claude · 0 comments
Owner
  • Draft: PQ-12
  • Priority: high (the first screen home users expect)
  • Agent: none (epic)
  • Depends on: #101
  • Decisions: Q-PQ-1, Q-PQ-2, Q-PQ-3, Q-PQ-12, R2-STATS-NODE, R2-DHCP-RELAY

Why

  • The dashboard shows only four object counts (zones, forwarders, filter lists, webhooks) (src/angular/src/app/features/dashboard/dashboard-stats.service.ts:43-56).
  • MetricEntity (src/dotnet/src/Ninlil.Dns.Data.Abstractions/Entity/MetricEntity.cs:9-38) and IMetricRepository are registered, but nothing in src/ writes or reads them.
  • There is no statistics controller. DHCP has one live per-scope figure, GET api/dhcp/scopes/{id}/statistics (src/dotnet/src/Ninlil.Web/Controllers/DhcpScopesController.cs:107-132), computed on each call by DhcpScopeStatisticsService (src/dotnet/src/Ninlil.Dhcp.Server.Core/Statistics/DhcpScopeStatisticsService.cs:27-93). Nothing counts DHCP messages, relayed or local, and no lease count is kept over time.
  • The cluster dashboard already asks each peer for its live query statistics (src/dotnet/src/Ninlil.Dns.Server.Cluster/Channel/ClusterQueryStatsAggregator.cs:16-21); that stays as it is.

Technical call: statistics come from rollups written by a background writer, not from GROUP BY over the query log. The log is capped (QueryLoggingOptions.MaxRetainedEntries, 1,000,000) and can be disabled (QueryLoggingOptions.cs:36-51). Its privacy level may strip names. A 24-hour aggregate over a Large log is a full index range scan per dashboard load.

Owner decisions 2026-10-31:

  • Q-PQ-12: all four DNS chart sets, plus DHCP charts whenever DHCP runs:
    • DNS: queries over time (stacked allowed / blocked / cached); top-N bars (domains, blocked domains, clients); answer-mix doughnuts (query types, response codes, answer source); upstream latency over time.
    • DHCP: pool utilisation per scope; active leases over time; message rates (DHCPv4 DISCOVER/OFFER/REQUEST/ACK/NAK and the rest, DHCPv6 SOLICIT/ADVERTISE/REQUEST/REPLY and the rest), for v4 and v6.
  • R2-STATS-NODE: every statistics row carries the node that wrote it. The dashboard shows all nodes combined or one node through a filter, and the API takes a node parameter.
  • R2-DHCP-RELAY: relayed DHCP traffic is counted as its own series (requests and replies forwarded, v4 and v6). DHCP charts show when a local engine or the relay runs.

What changes

Children, in order:

  1. #111: storage for counters, gauges and top-N rollups, per node (DNS and DHCP).
  2. #112: the statistics project, the DNS accumulator and the writer.
  3. #113: the shared DHCP message counters, fed by the local engines.
  4. #114: the DHCP relay agents count what they forward.
  5. #115: lease storage counts active leases per scope in the database.
  6. #116: the writer adds the DHCP series (local and relayed).
  7. #117: the DNS statistics API, with the node filter.
  8. #118: the DHCP statistics API, with the node filter.
  9. #119: benchmark. This settles Q-PQ-3.
  10. #120: api-regen.
  11. #121: console chart foundation, node filter, tiles and queries over time.
  12. #122: console top-N bars and answer-mix doughnuts.
  13. #123: console upstream latency chart.
  14. #124: console DHCP charts.

Acceptance

  • Children closed; README dashboard section (including the node filter and what a separate-database cluster shows); ENVIRONMENT.md for the new options.

Source

  • audit-feature-parity.md §2A #1 (gap 5).
  • TimescaleDB decision, 2026-10-09 (memory/project_first_release_plan.md:47): not an engine; an opt-in query-log hypertable only with this gap and only if benchmarks show plain PostgreSQL falling short.
  • Owner decision 2026-10-31 (Q-PQ-12): "ALL four (queries over time, top-N bars, answer-mix doughnuts, upstream latency) PLUS DHCP charts when DHCP is on".
  • Owner decision 2026-10-31 (Q-PQ-2): "CoreUI Chart.js".
  • Owner decision 2026-10-31, round 2 (R2-STATS-NODE): "per node with a filter (node id stored per row; dashboard shows all nodes or one)".
  • Owner decision 2026-10-31, round 2 (R2-DHCP-RELAY): "count relayed too (separate relay series on relay nodes; charts show when a local engine or the relay runs)".
- **Draft:** PQ-12 - **Priority:** high (the first screen home users expect) - **Agent:** none (epic) - **Depends on:** #101 - **Decisions:** Q-PQ-1, Q-PQ-2, Q-PQ-3, Q-PQ-12, R2-STATS-NODE, R2-DHCP-RELAY ### Why - The dashboard shows only four object counts (zones, forwarders, filter lists, webhooks) (`src/angular/src/app/features/dashboard/dashboard-stats.service.ts:43-56`). - `MetricEntity` (`src/dotnet/src/Ninlil.Dns.Data.Abstractions/Entity/MetricEntity.cs:9-38`) and `IMetricRepository` are registered, but nothing in `src/` writes or reads them. - There is no statistics controller. DHCP has one live per-scope figure, `GET api/dhcp/scopes/{id}/statistics` (`src/dotnet/src/Ninlil.Web/Controllers/DhcpScopesController.cs:107-132`), computed on each call by `DhcpScopeStatisticsService` (`src/dotnet/src/Ninlil.Dhcp.Server.Core/Statistics/DhcpScopeStatisticsService.cs:27-93`). Nothing counts DHCP messages, relayed or local, and no lease count is kept over time. - The cluster dashboard already asks each peer for its live query statistics (`src/dotnet/src/Ninlil.Dns.Server.Cluster/Channel/ClusterQueryStatsAggregator.cs:16-21`); that stays as it is. **Technical call:** statistics come from rollups written by a background writer, not from `GROUP BY` over the query log. The log is capped (`QueryLoggingOptions.MaxRetainedEntries`, 1,000,000) and can be disabled (`QueryLoggingOptions.cs:36-51`). Its privacy level may strip names. A 24-hour aggregate over a Large log is a full index range scan per dashboard load. Owner decisions 2026-10-31: - Q-PQ-12: all four DNS chart sets, plus DHCP charts whenever DHCP runs: - DNS: queries over time (stacked allowed / blocked / cached); top-N bars (domains, blocked domains, clients); answer-mix doughnuts (query types, response codes, answer source); upstream latency over time. - DHCP: pool utilisation per scope; active leases over time; message rates (DHCPv4 DISCOVER/OFFER/REQUEST/ACK/NAK and the rest, DHCPv6 SOLICIT/ADVERTISE/REQUEST/REPLY and the rest), for v4 and v6. - R2-STATS-NODE: every statistics row carries the node that wrote it. The dashboard shows all nodes combined or one node through a filter, and the API takes a node parameter. - R2-DHCP-RELAY: relayed DHCP traffic is counted as its own series (requests and replies forwarded, v4 and v6). DHCP charts show when a local engine or the relay runs. ### What changes Children, in order: 1. #111: storage for counters, gauges and top-N rollups, per node (DNS and DHCP). 2. #112: the statistics project, the DNS accumulator and the writer. 3. #113: the shared DHCP message counters, fed by the local engines. 4. #114: the DHCP relay agents count what they forward. 5. #115: lease storage counts active leases per scope in the database. 6. #116: the writer adds the DHCP series (local and relayed). 7. #117: the DNS statistics API, with the node filter. 8. #118: the DHCP statistics API, with the node filter. 9. #119: benchmark. This settles Q-PQ-3. 10. #120: api-regen. 11. #121: console chart foundation, node filter, tiles and queries over time. 12. #122: console top-N bars and answer-mix doughnuts. 13. #123: console upstream latency chart. 14. #124: console DHCP charts. ### Acceptance - [ ] Children closed; README dashboard section (including the node filter and what a separate-database cluster shows); ENVIRONMENT.md for the new options. ### Source - `audit-feature-parity.md` §2A #1 (gap 5). - TimescaleDB decision, 2026-10-09 (`memory/project_first_release_plan.md:47`): not an engine; an opt-in query-log hypertable only with this gap and only if benchmarks show plain PostgreSQL falling short. - Owner decision 2026-10-31 (Q-PQ-12): "ALL four (queries over time, top-N bars, answer-mix doughnuts, upstream latency) PLUS DHCP charts when DHCP is on". - Owner decision 2026-10-31 (Q-PQ-2): "CoreUI Chart.js". - Owner decision 2026-10-31, round 2 (R2-STATS-NODE): "per node with a filter (node id stored per row; dashboard shows all nodes or one)". - Owner decision 2026-10-31, round 2 (R2-DHCP-RELAY): "count relayed too (separate relay series on relay nodes; charts show when a local engine or the relay runs)".
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#110
No description provided.