fix: add request ID tracking for production debugging#165
fix: add request ID tracking for production debugging#1650x-SquidSol wants to merge 2 commits intodcccrypto:mainfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 25 minutes and 46 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Upstream changed /prices/:slab to ascending order + limit 1500 (for chart rendering), but the test still expected descending + 100. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No request correlation existed — if a user reported "I got a 500 at
3:15pm", ops could not find that specific request in logs or Sentry.
Adds Hono's built-in requestId() middleware which:
- Generates a UUID per request (or respects incoming X-Request-Id)
- Sets X-Request-Id response header on all responses
- Available via c.get("requestId") throughout the middleware chain
Integration points:
- Global error handler: logs requestId, includes it in error JSON response
- Sentry middleware: tags every scope with request_id for event correlation
- Error responses now include requestId so clients can quote it in reports
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
413d653 to
191adca
Compare
Summary
X-Request-Idheader, no per-request identifier in logs, no correlation in Sentry events.requestId()middleware for end-to-end request tracing.How it works
X-Request-Idfrom load balancers)X-Request-Idset on all responses — clients can quote it in bug reportsrequest_id— filterable in Sentry dashboardrequestIdfield in JSON body:{ "error": "Internal server error", "requestId": "550e8400-e29b-41d4-a716-446655440000" }requestIdfor grep/search correlationChanges
src/index.tsrequestId()middleware; addrequestIdto error handler logs + responsesrc/middleware/sentry.tsrequest_idTest plan
tsc --noEmitpassesvitest runpasses (186/186 tests)X-Request-Idheader appears in responsesrequest_id🤖 Generated with Claude Code