Skip to content

Commit 3b70bbb

Browse files
authored
fix(agents-insights): Use fallback attributes in AI IO sections (#93519)
The helper function `getTraceNodeAttribute` was not yet falling back to old attribute names. Using the `getAttribute` helper internally fixes this.
1 parent 42d9aad commit 3b70bbb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

static/app/views/insights/agentMonitoring/utils/highlightedSpanAttributes.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,16 @@ export function getTraceNodeAttribute(
147147
}
148148

149149
if (isEAPSpanNode(node) && attributes) {
150-
return attributes.find(attribute => attribute.name === name)?.value;
150+
const attributeObject = ensureAttributeObject(attributes);
151+
return getAttribute(attributeObject, name);
151152
}
152153

153154
if (isTransactionNode(node) && event) {
154-
return event.contexts.trace?.data?.[name];
155+
return getAttribute(event.contexts.trace?.data || {}, name);
155156
}
156157

157158
if (isSpanNode(node)) {
158-
return node.value.data?.[name];
159+
return getAttribute(node.value.data || {}, name);
159160
}
160161

161162
return undefined;

static/app/views/performance/newTraceDetails/traceDrawer/details/span/eapSections/aiInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export function AIInputSection({
143143
event,
144144
attributes
145145
);
146-
promptMessages = transformInputMessages(inputMessages);
146+
promptMessages = inputMessages && transformInputMessages(inputMessages);
147147
}
148148

149-
const aiInput = defined(promptMessages) && parseAIMessages(promptMessages as string);
149+
const aiInput = defined(promptMessages) && parseAIMessages(promptMessages);
150150

151151
if (!aiInput) {
152152
return null;

0 commit comments

Comments
 (0)