Skip to content

Commit 0beb0fc

Browse files
authored
fix(agent-insights): format zero cost as dash (#95322)
1 parent 5ed0d98 commit 0beb0fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {formatLLMCosts} from 'sentry/views/insights/agentMonitoring/utils/formatLLMCosts';
22

33
interface LLMCostsProps {
4-
cost: number | string;
4+
cost: number | string | null;
55
className?: string;
66
}
77

@@ -15,7 +15,7 @@ export function LLMCosts({cost, className}: LLMCostsProps) {
1515
maximumFractionDigits: 8,
1616
})}
1717
>
18-
{formatLLMCosts(cost)}
18+
{cost ? formatLLMCosts(cost) : '-'}
1919
</span>
2020
);
2121
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface TableData {
4444
llmCalls: number;
4545
timestamp: number;
4646
toolCalls: number;
47-
totalCost: number;
47+
totalCost: number | null;
4848
totalTokens: number;
4949
traceId: string;
5050
transaction: string;
@@ -164,7 +164,7 @@ export function TracesTable() {
164164
llmCalls: spanDataMap[span.trace]?.llmCalls ?? 0,
165165
toolCalls: spanDataMap[span.trace]?.toolCalls ?? 0,
166166
totalTokens: spanDataMap[span.trace]?.totalTokens ?? 0,
167-
totalCost: spanDataMap[span.trace]?.totalCost ?? 0,
167+
totalCost: spanDataMap[span.trace]?.totalCost ?? null,
168168
timestamp: span.start,
169169
isSpanDataLoading: spansRequest.isLoading,
170170
}));

0 commit comments

Comments
 (0)