Skip to content

Add chat completion concurrency logging#733

Merged
jahooma merged 1 commit into
mainfrom
jahooma/render-traffic-crashes
May 23, 2026
Merged

Add chat completion concurrency logging#733
jahooma merged 1 commit into
mainfrom
jahooma/render-traffic-crashes

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented May 23, 2026

Summary

Adds sampled per-instance concurrency logging around /api/v1/chat/completions so Render incidents can be correlated with active streaming request pressure.
The helper tracks every request in-process, logs sampled start/finish pairs with duration and end reason, and keeps streaming requests counted until completion, cancellation, or error.
This should make it easier to decide whether permanently increasing instance count is enough or whether stream concurrency needs dedicated autoscaling.

Validation

  • bun run typecheck from web/
  • bun test web/src/app/api/v1/chat/completions/__tests__/completions.test.ts web/src/app/api/v1/chat/completions/__tests__/request-metrics.test.ts

@jahooma jahooma merged commit b22d244 into main May 23, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/render-traffic-crashes branch May 23, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant