Skip to content

Commit 6f3809a

Browse files
authored
fix(ai-insights): use span status to query for errors (#101239)
1 parent cafa7f4 commit 6f3809a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,12 @@ function hasError(node: AITraceSpanNode) {
386386
return true;
387387
}
388388

389-
// spans with status unknown are errors
390389
if (isEAPSpanNode(node)) {
391-
return node.value.additional_attributes?.[SpanFields.SPAN_STATUS] === 'unknown';
390+
const status = node.value.additional_attributes?.[SpanFields.SPAN_STATUS];
391+
if (typeof status === 'string') {
392+
return status.includes('error');
393+
}
394+
return false;
392395
}
393396

394397
return false;

static/app/views/insights/agents/components/tracesTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function TracesTable() {
127127
const traceErrorRequest = useSpans(
128128
{
129129
// Get all generations and tool calls with status unknown
130-
search: `has:span.status !span.status:ok trace:[${tracesRequest.data?.data.map(span => span.trace).join(',')}]`,
130+
search: `has:span.status span.status:*error trace:[${tracesRequest.data?.data.map(span => span.trace).join(',')}]`,
131131
fields: ['trace', ...AI_AGENT_SUB_OPS],
132132
limit: tracesRequest.data?.data.length ?? 0,
133133
enabled: Boolean(tracesRequest.data && tracesRequest.data.data.length > 0),

0 commit comments

Comments
 (0)