Server statistics, multi-view record commands, and rc.3 fixes

Added:
- Server statistics: named's memory and CPU (from /proc), cache size,
  sockets and client counts against their limits (statistics channel,
  rndc status), host memory and load, and free disk space. Memory and
  CPU are kept over time as gauges (sum and sample count, averaged in
  timelines). Statistics page Server section, jarl stats server,
  GET /stats/server.
- jarl record add|set|delete|disable|enable --view a,b | all: the same
  change in each view, applied as one changeset.
- Blocking can be paused until resumed (jarl block pause indefinitely,
  "Until I resume", {"indefinitely": true}).

Changed:
- List options (allow-transfer, forwarders, ...) get their braces added
  when given without them.
- The dashboard lists named-checkconf's warnings about the running
  configuration; the CLI prints them after an apply.
- Stats page: tile and card rows fill their width, and the queries and
  failed answers charts share margins so their time axes line up.
- Dashboard: options have their own tile.
- 24-hour times in the web UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-10-11 18:03:05 +01:00
1 parent b097e10bef
commit 7be0762f48
48 files changed
+1346 -128

No files matched your search

+16 -1
View File
@@ -47,6 +47,9 @@ type Options struct {
Anonymize bool
Exclude []netip.Prefix
Location *time.Location // for days and log timestamps (default: local time)
// MainConfig is named's main configuration file; it tells named's
// process apart from other named processes (for its memory and CPU).
MainConfig string
// EnsureLogging turns named's response logging on (rndc responselog
// on). It is called at start and when named answers queries but no
// log lines arrive.
@@ -107,6 +110,10 @@ type Collector struct {
// rewritten holds queries named blocked (client#port|name) until their
// response line arrives.
rewritten map[string]bool
// proc is the last sample of named's process, server the latest server
// statistics (server.go).
proc *namedProc
server *Server
}
// maxKeys bounds the per-hour maps; rarely seen keys are dropped first.
@@ -235,13 +242,17 @@ func (c *Collector) start(ctx context.Context) {
}
c.ensureLogging(ctx)
// The first poll is the baseline for the counters.
if snap, err := c.poller.Poll(ctx); err == nil {
snap, err := c.poller.Poll(ctx)
if err == nil {
c.prev = snap
t := c.now()
c.status.LastPoll = &t
} else {
c.status.PollError = err.Error()
}
c.mu.Lock()
c.sampleServer(-1, c.now(), snap)
c.mu.Unlock()
c.prune(ctx)
c.log.Info("statistics collector started", "query_log", c.opts.QueryLog, "statistics_channel", c.opts.StatisticsChannel)
}
@@ -470,6 +481,10 @@ func (c *Collector) flush(ctx context.Context, final bool) {
}
c.prev = snap
}
if !final {
// Gauges are sampled once a minute, for the minute that ended.
c.sampleServer(cur-60, now, snap)
}
b := &Batch{}
first := c.status.FirstData == nil
for m, vals := range c.minutes {