[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. 🫖 Status page with uptime monitoring & API monitoring as code 🫖 openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor

perf: stream the dashboard tRPC batch response master

httpBatchLink holds every result in a batch until the slowest procedure settles, so a batch mixing cheap queries with a Tinybird pipe delivers nothing for seconds. Production P75 shows the same shell procedures at 16ms alone and 2.26s when batched alongside Tinybird. httpBatchStreamLink flushes each procedure as it resolves. Total request duration is unchanged — the request still ends with the slowest op — so the metric to watch is TTFB (P75 1.41s on this route), not Duration. Passing AppRouter as the type argument types the options directly, which removes the satisfies Partial<HTTPBatchLinkOptions<any>> workaround and its FIXME rather than relocating them. Tradeoff: headers flush before any procedure resolves, so per-procedure errors now arrive in-band on a 200 and this route's 4XX band disappears from Vercel. Sentry coverage is unaffected — createTRPCOnError and sentryLoggerLink both still fire — and timingMiddleware already logs per-procedure ok, which is finer-grained than a batch-level status. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>


Author Thibault Le Ouay Ducasse Co-author Claude Opus 5 (1M context) Date Commit 87e969d6 Parent a5bc7c8f Change ID rotyywyl
+8 -5
1 changed file