diff --git a/packages/spotlight/src/ui/telemetry/components/insights/Queries.tsx b/packages/spotlight/src/ui/telemetry/components/insights/Queries.tsx index 913f130d..f197e5e4 100644 --- a/packages/spotlight/src/ui/telemetry/components/insights/Queries.tsx +++ b/packages/spotlight/src/ui/telemetry/components/insights/Queries.tsx @@ -51,7 +51,7 @@ const Queries = () => { const compareQueryInfo = COMPARATORS[sort.active] || COMPARATORS[QUERIES_SORT_KEYS.totalTime]; const spans = allSpans; const onlyDBSpans = spans.filter((span: Span) => DB_SPAN_REGEX.test(span.op || "")); - const uniqueSpansSet = new Set(onlyDBSpans.map(span => String(span?.description).trim())); + const uniqueSpansSet = new Set(onlyDBSpans.map(span => (span.description ?? "").trim())); // Clear out empty ones (they collapse as a single empty string since this is a set) uniqueSpansSet.delete(""); return [...uniqueSpansSet] diff --git a/packages/spotlight/src/ui/telemetry/components/insights/Resources.tsx b/packages/spotlight/src/ui/telemetry/components/insights/Resources.tsx index 5fc4d479..35d35744 100644 --- a/packages/spotlight/src/ui/telemetry/components/insights/Resources.tsx +++ b/packages/spotlight/src/ui/telemetry/components/insights/Resources.tsx @@ -73,7 +73,7 @@ const Resources = () => { const resources = useMemo(() => { const filteredResourceSpans = getResourceSpans(allSpans, { regex: /resource\.[A-Za-z]+/ }); - const uniqueResourceDescriptionsSet = new Set(filteredResourceSpans.map(span => String(span?.description).trim())); + const uniqueResourceDescriptionsSet = new Set(filteredResourceSpans.map(span => (span.description ?? "").trim())); // Clear out empty ones (they collapse as a single empty string since this is a set) uniqueResourceDescriptionsSet.delete(""); const uniqueResourceDescriptions: string[] = [...uniqueResourceDescriptionsSet];