Repository navigation
feat(api): Report field sizes of the conversation feed response - #3814
Merged
Merged
Conversation
The feed serializer writes activityPreview, annotations, participants, and threads on their own and splices them into each row, so the response is still serialized once and the serialize span gets the chars of each field, the row count, and the nested Thread count. The count of waiting rows from outside the page goes on the request span. Co-Authored-By: BYK <[email protected]>
The read reports the count to the route, which passes it to the feed serializer, so every feed size attribute is on one span. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Nov 19, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
I feel like these should be metrics rather than span attributes? Or maybe both?
BYK
enabled auto-merge (squash)
November 19, 2026 18:11
Spans are sampled, so the field sizes also go to distribution metrics. Every feed response then counts in the aggregate. The span attributes stay for per-trace diagnosis.
…d-field-size-telemetry # Conflicts: # packages/junior/src/api/conversations/routes.ts
22 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GET /api/conversationsresponses can reach millions of chars, and no telemetry shows which row fields fill them.serializeConversationFeed(api/conversations/feed-response.ts) replaces the plainJSON.stringifyfor the feed. It serializesactivityPreview,annotations,participantsandthreadson their own and splices them into each row, so the response is still serialized only once.Key order: values do not change, but those four keys now come last in each top-level row object. JSON clients that read by key are not affected.
jsonResponsetakes an optional serializer that returns the body and extra span attributes. The default is unchanged.New attributes on the
serializespan of the feed response:app.api.response.field_chars.{activity_preview,annotations,participants,threads}: total chars of each field across the page's top-level rows.threadsincludes the nested Threads with all their fields.app.conversation_feed.rows: top-level rows.app.conversation_feed.threads: nested Threads, counted recursively.app.conversation_feed.waiting_rows: waiting rows added from outside the page. The feed does not mark them, soreadConversationFeedreports the count to the route throughonWaitingRows.TELEMETRY.mdgets a Domains row for these attributes.Conflict risk: #3808 also edits
readConversationFeedinlist.ts, in lines next to these. Whichever PR merges second needsmainmerged in.via @BYK.
--
View Session [Sentry]