feat(supervisor): wide events + warm-start trace propagation

DE
5mo ago
+203716-18804

Adds wide events system to supervisor for better event propagation across worker restarts.

Changes

  • New \wideEvents\ module with emit, middleware, record, state modules
  • Traceparent propagation for warm-start runs
  • Socket lifecycle management with noisy-routes flag
  • Workload server integration for wide events

Files changed (17)

  • apps/supervisor/src/index.ts
  • apps/supervisor/src/wideEvents/* (7 new files)
  • apps/supervisor/src/workloadServer/index.ts

Test

  • Added wideEvents tests: emit.test.ts, middleware.test.ts, new.test.ts, record.test.ts, traceparent.test.ts

Closes #3669


Summary by cubic

Adds wide-event instrumentation to supervisor and propagates traceparent on warm-start runs so traces stay connected across worker restarts. Improves visibility of workload routes and run socket lifecycle; feature is disabled by default.

  • New Features
    • New wide-events pipeline (emit, middleware, record, state) for cross-restart observability.
    • Warm-start trace context propagation for continuous end-to-end tracing.
    • Socket lifecycle tracking with a “noisy routes” toggle.
    • Workload server integration to emit wide events.
    • Gated behind TRIGGER_WIDE_EVENTS_ENABLED (off by default).