feat: add requestId middleware for tracing#1401
Conversation
Closes h3js#1389 Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds built-in request ID generation and propagation middleware to h3. It introduces configurable ID generation with optional header name and custom generator support, automatic propagation to response and error headers, and integration with the event context for request tracing. ChangesRequest ID feature implementation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Summary
requestId()middleware to generate or propagate request IDsgetRequestId()helper andevent.context.requestIdCloses #1389
Usage
Test plan
pnpm vitest run test/request-id.test.ts(8/8)pnpm lintMade with Cursor
Summary by CodeRabbit