diff --git a/static/app/views/insights/agents/components/aiSpanList.tsx b/static/app/views/insights/agents/components/aiSpanList.tsx index c959afa51a12a8..f05153f76969a9 100644 --- a/static/app/views/insights/agents/components/aiSpanList.tsx +++ b/static/app/views/insights/agents/components/aiSpanList.tsx @@ -386,10 +386,15 @@ function hasError(node: AITraceSpanNode) { } if (isEAPSpanNode(node)) { - const status = node.value.additional_attributes?.[SpanFields.SPAN_STATUS]; - if (typeof status === 'string') { + const spanStatus = node.value.additional_attributes?.[SpanFields.SPAN_STATUS]; + if (!!spanStatus && typeof spanStatus === 'string') { + return spanStatus.includes('error'); + } + const status = node.value.additional_attributes?.status; + if (!!status && typeof status === 'string') { return status.includes('error'); } + return false; } diff --git a/static/app/views/insights/agents/hooks/useAITrace.tsx b/static/app/views/insights/agents/hooks/useAITrace.tsx index 79b6ee8bb131cf..38d714e7e2465c 100644 --- a/static/app/views/insights/agents/hooks/useAITrace.tsx +++ b/static/app/views/insights/agents/hooks/useAITrace.tsx @@ -44,6 +44,7 @@ export function useAITrace(traceSlug: string): UseAITraceResult { SpanFields.GEN_AI_USAGE_TOTAL_COST, SpanFields.GEN_AI_TOOL_NAME, SpanFields.SPAN_STATUS, + 'status', ], });