Skip to content

Commit 2f28a2c

Browse files
authored
fix(agents-insights): Fix eap request in ai spans tab (#94168)
As page filters are not available in the trace view we need to pass custom values to the hook.
1 parent 6d78a40 commit 2f28a2c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

static/app/views/insights/agentMonitoring/components/aiSpanList.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ function useEAPSpanAttributes(nodes: Array<TraceTreeNode<TraceTree.NodeValue>>)
173173
const spans = useMemo(() => {
174174
return nodes.filter(node => isEAPSpanNode(node));
175175
}, [nodes]);
176+
const projectIds = spans.map(span => span.value.project_id);
177+
176178
const spanAttributesRequest = useEAPSpans(
177179
{
178180
search: `span_id:[${spans.map(span => span.value.event_id).join(',')}]`,
@@ -181,9 +183,19 @@ function useEAPSpanAttributes(nodes: Array<TraceTreeNode<TraceTree.NodeValue>>)
181183
keyToTag(AI_MODEL_ID_ATTRIBUTE, 'string'),
182184
keyToTag(AI_TOTAL_TOKENS_ATTRIBUTE, 'number'),
183185
keyToTag(AI_TOOL_NAME_ATTRIBUTE, 'string'),
184-
keyToTag(AI_AGENT_NAME_ATTRIBUTE, 'string'),
185186
] as EAPSpanProperty[],
186187
limit: 100,
188+
// Pass custom values as the page filters are not available in the trace view
189+
pageFilters: {
190+
projects: projectIds,
191+
environments: [],
192+
datetime: {
193+
period: '90d',
194+
start: null,
195+
end: null,
196+
utc: true,
197+
},
198+
},
187199
},
188200
Referrer.TRACE_DRAWER
189201
);

0 commit comments

Comments
 (0)