Skip to content

docs: logs, providers and a read-only rule list - #6

Open
Zakkaus wants to merge 13 commits into
daeuniverse:honkfrom
Zakkaus:observability-endpoints
Open

Zakkaus wants to merge 13 commits into
daeuniverse:honkfrom
Zakkaus:observability-endpoints

Conversation

@Zakkaus

@Zakkaus Zakkaus commented Sep 16, 2026

Copy link
Copy Markdown

Three read-side additions the doona UI needs, stacked on #4 (ui-findings); independent of #5.

  • GET /api/v1/logs: SSE event: log records {ts, level, target, message, fields} with level/target filters and the same cursor rules as /events (stream.ready, Last-Event-ID, 409 event_cursor_expired). Messages are sanitised.
  • GET /api/v1/providers, GET /providers/{id}, POST /providers/{id}/refresh (202 operation provider_refresh); Node.provider_id (nullable) for grouping.
  • GET /api/v1/rules: the running generation's rules with rule_id identical to what POST /routing/trace and FlowSummary.rule_id use; refetch on generation.changed. Editing goes through the configuration sources (docs: effective configuration and dry-run validation #5), not a rule-level write.
  • Capabilities resources.logs, resources.providers, resources.rules; discovery links; docs pages; eight tests.

Second and fourth commits, runtime settings and retention:

  • GET/PATCH /api/v1/runtime/settings: the log level and replay ring, the DNS log ring and flow retention in one place, each bounded by the matching capability value; resources.runtime_settings.fields lists what a backend lets a PATCH change. Applies without a reload, is not written to the configuration file; restart or the next activation returns to the configured values and source says which is in effect. Out of range is 400 with nothing changed.
  • logs.md gets a table of every retained record (logs, DNS log, flows, traffic and memory samples, operations), its ceiling and whether it is adjustable at runtime.

Third commit, DNS log:

  • GET /api/v1/dns/log: a bounded ring of the resolutions the engine performed for clients (diagnostic /dns/query calls excluded), newest first, filtered by name substring, record type and client source IP, cursor paging within dns_log.max_page_size. Each record: client socket address (IPv6 in brackets), question, RCODE or engine outcome, cache hit or upstream, routing decision in the /dns/query shape, elapsed time, answers. Not durable.

npm run check:contract: 40 pass.

glassyiris and others added 9 commits August 15, 2026 19:34
Coherent connection and flow examples; open base objects so generators
can extend them; sampled_at on traffic; src and connection_id filters;
GroupSummary.config_revision; probe queue-full 503 with Retry-After;
health identity carries measurement; decision-time names in selection
paths; CORS, datapath and cursor rules stated once.
Example timestamps fall after instance start; the preflight rule is
stated in api-config and common; health identity keeps warmth; wording.
chain, rule, ingress and domain source with provenance on Connection
and FlowSummary; GET /runtime/outbounds; bounded GET
/runtime/traffic/history; no-close and out-of-scope statements.
ErrorCode enum on HTTP error bodies (ApiError); errors embedded in
resources keep adapter-defined codes; /events 409 names
event_cursor_expired and carries an example.
GET /api/v1/logs streams sanitised engine log records over SSE with
the events cursor rules; GET /api/v1/providers, GET /providers/{id}
and POST /providers/{id}/refresh (202) expose subscriptions, with
Node.provider_id; GET /api/v1/rules lists the running generation's
rules with the ids routing trace and flows use. Eight tests.
GET and PATCH /logs/settings: the level the engine emits at and the
replay ring size, changeable at runtime under control when
resources.logs.settings is true. A change applies without a reload and
is not written to the configuration; restart or the next activation
returns to the configured values, which `source` reports. Level is
bounded by the advertised levels, the ring by [64, max_buffered_records];
out of range is 400 with nothing changed.

logs.md gains a table of every retained record, its bound and whether it
is adjustable at runtime; honk mapping row; one test.
@Zakkaus
Zakkaus force-pushed the observability-endpoints branch from 7ec2b3d to 43afe37 Compare September 16, 2026 16:23
GET /dns/log: the engine records each resolution it performs for
clients (not diagnostic /dns/query calls) into a ring of at most
resources.dns_log.max_records; newest first, filters by name substring,
record type and client source IP, cursor paging within max_page_size.
A record carries the client socket address (IPv6 in brackets), the
question, RCODE or engine outcome, whether the cache answered, the
upstream, the routing decision in the /dns/query shape, elapsed time
and the answers. Not durable; clears on restart. Doc section on the
DNS cache page, honk mapping row, one test.
GET and PATCH /runtime/settings replace /logs/settings: the log level
and replay ring, the DNS log ring and flow retention in one place,
each bounded by the matching capability value as its ceiling.
resources.runtime_settings.fields lists what a backend lets a PATCH
change; anything else is 400. A change applies without a reload, is
not written to the configuration, and the next activation or a restart
resets it; source reports which is in effect. The retention table on
the logs page now says which rings are adjustable. One test.
POST /providers and DELETE /providers/{id} add and remove subscription
providers in the managed main source; POST /nodes and DELETE /nodes/{id}
do the same for inline nodes from share links. GET /geodata reports the
loaded geosite and geoip files and POST /geodata/update queues a
geodata_update operation that downloads, verifies and reloads them.
Capabilities gain providers.can_manage, nodes.can_manage and a geodata
resource; discovery links geodata. Also names the body example the
runtime settings page renders.
@Zakkaus
Zakkaus force-pushed the observability-endpoints branch from 3992801 to f31f6c6 Compare September 17, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants