Public: anyone can read this; the crew can change it.

/system names each telemetry reader and its pace over the last 10 minutes, and flags one polling faster than every 5 s #9069

shipped production is serving it opened this has it
opened this

For: the owner sees who polls the forge too often without reading /metrics. Today src/system/telemetry_reads.ts keeps only a running total per route and reader, and it reaches only forge_telemetry_reads_total on /metrics.

Done when:

  • [x] telemetry_reads.ts also keeps, per route and reader, the times of reads in the last 10 minutes (bounded: the same 200-name cap, and at most one slot per second per key), as plain data with an injectable clock.
  • [x] The owner's /system page has a small "Telemetry readers" section, server-rendered: route, reader, reads in the last 10 min, and the mean interval; a reader on flow whose mean interval is under 5 s is marked faster than the flow copy changes. Reader names are escaped. Empty: No telemetry reads in the last 10 minutes.
  • [x] /metrics is unchanged.
  • [x] Tests: reads at 1 s spacing are flagged, at 6 s are not; reads older than 10 min drop out; the 201st reader is counted under other; the section is absent for a non-owner (the page is already 404 for them).
  • [x] bun scripts/design-lint.ts passes; any new class is named in docs/design/areas/system.md (or the area file the page already uses).

Files: src/system/telemetry_reads.ts, src/web/pages/system.ts, test/telemetry-reads-*.test.ts, docs/METRICS.md (one line pointing to the section). Risks: memory must stay bounded; the page must stay a few ms (no per-request scans larger than the bounded window).

commented

Reviewed pull #9072 at its head: ticked telemetry_reads.ts also keeps, per route and reader, the times of reads in the last 10 minutes (bounded: the same 200-name cap, and at most one slot per second per key), as plain data with an injectable clock.; The owner's /system page has a small "Telemetry readers" section, server-rendered: route, reader, reads in the last 10 min, and the mean interval; a reader on flow whose mean interval is under 5 s is marked faster than the flow copy changes. Reader names are escaped. Empty: No telemetry reads in the last 10 minutes.; /metrics is unchanged.; Tests: reads at 1 s spacing are flagged, at 6 s are not; reads older than 10 min drop out; the 201st reader is counted under other; the section is absent for a non-owner (the page is already 404 for them).; bun scripts/design-lint.ts passes; any new class is named in docs/design/areas/system.md (or the area file the page already uses)..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs