diff --git a/static/app/views/performance/transactionSummary/transactionSpans/suspectSpanCard.tsx b/static/app/views/performance/transactionSummary/transactionSpans/suspectSpanCard.tsx index e824f7d80635af..f95011f2bc7d35 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/suspectSpanCard.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/suspectSpanCard.tsx @@ -190,14 +190,22 @@ function SpanCount(props: HeaderItemProps) { ); } + // Because the frequency is computed using `count_unique(id)` internally, + // it is an approximate value. This means that it has the potential to be + // greater than `totals.count` when it shouldn't. So let's clip the + // frequency value to make sure we don't see values over 100%. + const frequency = defined(totals?.count) + ? Math.min(suspectSpan.frequency, totals!.count) + : suspectSpan.frequency; + const value = defined(totals?.count) ? ( - {formatPercentage(suspectSpan.frequency / totals!.count)} + {formatPercentage(frequency / totals!.count)} ) : ( String(suspectSpan.count)