summaryrefslogtreecommitdiffhomepage
path: root/packages/host-bin/src/collector-supervisor.ts
AgeCommit message (Collapse)Author
9 daysstyle: switch from tabs to 2-space indentationAdam Malczewski
2026-06-05feat(observability): host-bin supervises the collector (spawn-first / ↵Adam Malczewski
drain-last / restart) — 288 tests host-bin spawns the out-of-process collector before serving (real Bun.spawn adapted to a ChildHandle), restarts on unexpected exit (backoff + restart-guard cap), drains on SIGINT/SIGTERM (collector final-drain, SIGKILL fallback on timeout). createCollectorSupervisor takes an injected spawn so the lifecycle is unit-tested with a fake (no real subprocess). Collector failures never crash the app (D3 subordinate/fail-safe). New env DISPATCH_TRACE_DB (default ./.dispatch-data/traces.db). Verified: tsc -b clean, 288 tests (279 + 9 supervisor), biome 0/0. Live (clean single run): 1 collector during, trace DB auto-populated (nested easy-view), 0 collectors after shutdown.