From f3962fccc0d5685b512c644af17925a0a6ebef47 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:21:17 +0200 Subject: [PATCH 1/2] fix(ai-trace): query for both status and span.status --- .../app/views/insights/agents/components/aiSpanList.tsx | 9 +++++++-- static/app/views/insights/agents/hooks/useAITrace.tsx | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) 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..14e9f7e2254a82 100644 --- a/static/app/views/insights/agents/hooks/useAITrace.tsx +++ b/static/app/views/insights/agents/hooks/useAITrace.tsx @@ -43,7 +43,8 @@ export function useAITrace(traceSlug: string): UseAITraceResult { SpanFields.GEN_AI_USAGE_TOTAL_TOKENS, SpanFields.GEN_AI_USAGE_TOTAL_COST, SpanFields.GEN_AI_TOOL_NAME, - SpanFields.SPAN_STATUS, + 'span.status', + 'status', ], }); From 17768693c5ad894377e3b0167ee92fde4551ef28 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:22:28 +0200 Subject: [PATCH 2/2] fix --- static/app/views/insights/agents/hooks/useAITrace.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/insights/agents/hooks/useAITrace.tsx b/static/app/views/insights/agents/hooks/useAITrace.tsx index 14e9f7e2254a82..38d714e7e2465c 100644 --- a/static/app/views/insights/agents/hooks/useAITrace.tsx +++ b/static/app/views/insights/agents/hooks/useAITrace.tsx @@ -43,7 +43,7 @@ export function useAITrace(traceSlug: string): UseAITraceResult { SpanFields.GEN_AI_USAGE_TOTAL_TOKENS, SpanFields.GEN_AI_USAGE_TOTAL_COST, SpanFields.GEN_AI_TOOL_NAME, - 'span.status', + SpanFields.SPAN_STATUS, 'status', ], });