-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(node): Update vercel ai integration attributes #16721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report 📦
|
55520e2
to
e3cfd57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'gen_ai.execute_tool'); | |
renameAttributeKey(attributes, AI_TOOL_CALL_NAME_ATTRIBUTE, 'gen_ai.tool.name'); | |
renameAttributeKey(attributes, AI_TOOL_CALL_ID_ATTRIBUTE, 'gen_ai.tool.call.id'); |
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.input
andgen_ai.tool.output
attributesgen_ai.tool.type: 'function'
for tool callsTechnical Changes:
renameAttributeKey()
consistently instead of duplicating attributesai.*
attributes after creating newgen_ai.*
ones