feat(node): Update vercel ai integration attributes#16721
feat(node): Update vercel ai integration attributes#16721AbhiPrasad merged 4 commits intodevelopfrom
Conversation
size-limit report π¦
|
55520e2 to
e3cfd57
Compare
ArthurKnaus
left a comment
There was a problem hiding this comment.
π thx for the quick changes!
|
note: This may conflict with #16732, whatever we merge first needs to be adjusted accordingly! |
efdf029 to
6750b12
Compare
There was a problem hiding this comment.
Bug: Span Attribute Modification Bug
The processToolCallSpan function incorrectly uses renameAttributeKey to modify a local attributes object, which is a snapshot of the span's data (from spanToJSON(span).data). This prevents the gen_ai.tool.name and gen_ai.tool.call.id attributes from being set on the actual span, unlike the previous direct span.setAttribute() calls. This also creates an inconsistency with other attributes correctly set on the span, and impacts the span's name update which relies on the gen_ai.tool.name attribute.
packages/core/src/utils/vercel-ai.ts#L118-L120
sentry-javascript/packages/core/src/utils/vercel-ai.ts
Lines 118 to 120 in c4f69a3
Was this report helpful? Give feedback by reacting with π or π
Make changes to the Vercel AI integration as per https://www.notion.so/sentry/Agent-Monitoring-SDK-differences-21c8b10e4b5d80bcab51f72ae1418ea8
AI summary:
Key Improvements:
gen_ai.tool.inputandgen_ai.tool.outputattributesgen_ai.tool.type: 'function'for tool callsTechnical Changes:
renameAttributeKey()consistently instead of duplicating attributesai.*attributes after creating newgen_ai.*ones