Part of epic #8286 (Phase 1 — Errors).
Current state
The hosted ORB Worker path attaches Sentry via middleware: src/api/routes.ts imports sentry from @sentry/hono/cloudflare and, only when running in a real Workers isolate (isCloudflareWorkerRuntime) with WORKER_SENTRY_DSN set, registers app.use(sentry(...)) (env vars WORKER_SENTRY_DSN/WORKER_SENTRY_ENVIRONMENT, documented in src/env.d.ts as deliberately separate from self-host's SENTRY_DSN to avoid cross-wiring).
Deliverables
Boundaries
- Only the Worker path — the self-host server swap is its own sub-issue.
Resources
Part of epic #8286 (Phase 1 — Errors).
Current state
The hosted ORB Worker path attaches Sentry via middleware:
src/api/routes.tsimportssentryfrom@sentry/hono/cloudflareand, only when running in a real Workers isolate (isCloudflareWorkerRuntime) withWORKER_SENTRY_DSNset, registersapp.use(sentry(...))(env varsWORKER_SENTRY_DSN/WORKER_SENTRY_ENVIRONMENT, documented insrc/env.d.tsas deliberately separate from self-host'sSENTRY_DSNto avoid cross-wiring).Deliverables
$exceptioncapture over PostHog's capture HTTP API — no SDK in the Worker bundle (epic principle;posthog-nodeis documented as too heavy for Workers). Pattern: feat(observability): add PostHog error tracking via raw $exception capture metagraphed#7777 (src/usage-telemetry.tsraw-capture approach).WORKER_POSTHOG_*naming mirroring the existingWORKER_SENTRY_*split (and the same cross-wire warning ported tosrc/env.d.ts).waitUntil, mirroring thesrc/mcp/server.tstelemetry chokepoint's MCP tool-call telemetry fires without waitUntil, unlike this repo's own scheduleAfterResponse pattern #7233 approach (never block the response on telemetry).Boundaries
Resources