feat(a2ui): add server stream performance logs#2721
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds comprehensive structured instrumentation and performance event logging across the A2UI server stack. JSON body metrics (size and timing) are collected at the shared parsing layer, exposed through updated return types, and logged by route handlers. The service layer emits performance events at key points (cache hits/misses, message preparation, stream invocation), and both action and standard stream routes wire callback handlers to capture and log these events alongside request lifecycle checkpoints. ChangesA2UI Server Instrumentation and Performance Event Logging
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance
Comparing Footnotes
|
React Example#8719 Bundle Size — 238KiB (0%).054575f(current) vs 6a293cb main#8718(baseline) Bundle metrics
|
| Current #8719 |
Baseline #8718 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
204 |
204 |
|
81 |
81 |
|
44.59% |
44.59% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #8719 |
Baseline #8718 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
92.24KiB |
92.24KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-server-perf... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example with Element Template#987 Bundle Size — 204.36KiB (0%).054575f(current) vs 6a293cb main#986(baseline) Bundle metrics
|
| Current #987 |
Baseline #986 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
124 |
124 |
|
50 |
50 |
|
45.19% |
45.19% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #987 |
Baseline #986 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
58.61KiB |
58.61KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-server-perf... Project dashboard
Generated by RelativeCI Documentation Report issue
React External#1834 Bundle Size — 699.5KiB (0%).054575f(current) vs 6a293cb main#1833(baseline) Bundle metrics
|
| Current #1834 |
Baseline #1833 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
17 |
17 |
|
5 |
5 |
|
7.13% |
7.13% |
|
0 |
0 |
|
0 |
0 |
Bundle analysis report Branch Sherry-hue:feat/a2ui-server-perf... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#10295 Bundle Size — 903.53KiB (0%).054575f(current) vs 6a293cb main#10294(baseline) Bundle metrics
Bundle size by type
|
| Current #10295 |
Baseline #10294 |
|
|---|---|---|
499.15KiB |
499.15KiB |
|
402.16KiB |
402.16KiB |
|
2.22KiB |
2.22KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-server-perf... Project dashboard
Generated by RelativeCI Documentation Report issue
React MTF Example#1853 Bundle Size — 208.94KiB (0%).054575f(current) vs 6a293cb main#1852(baseline) Bundle metrics
|
| Current #1853 |
Baseline #1852 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
199 |
199 |
|
78 |
78 |
|
44.08% |
44.08% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #1853 |
Baseline #1852 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
97.71KiB |
97.71KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-server-perf... Project dashboard
Generated by RelativeCI Documentation Report issue
Summary
Add targeted server-side performance logs around the A2UI streaming APIs so production latency can be broken down by request body handling, validation, agent setup, upstream stream invocation, and first streamed chunk.
Details
readJsonBodyWithLimit, including declared/raw byte size plus read and JSON parse timings./a2ui/streamand/a2ui/action/streamphases from request receipt through validation, agent connection, first upstream chunk, validation, repair, and completion.agent.stream()invocation timing.Validation
pnpm -C packages/genui/server exec tsc --noEmitpnpm dprint check packages/genui/server/app/a2ui/_shared.ts packages/genui/server/app/a2ui/stream/route.ts packages/genui/server/app/a2ui/action/stream/route.ts packages/genui/server/service/a2ui-agent.tseslint --cache --fix,biome lint --write, anddprint fmton staged filesSummary by CodeRabbit
Release Notes