diff --git a/static/app/views/performance/newTraceDetails/index.tsx b/static/app/views/performance/newTraceDetails/index.tsx index 9705ad095dd8fc..4bf58637ebd592 100644 --- a/static/app/views/performance/newTraceDetails/index.tsx +++ b/static/app/views/performance/newTraceDetails/index.tsx @@ -114,7 +114,11 @@ function TraceViewImpl({traceSlug}: {traceSlug: string}) { const hideTraceWaterfallIfEmpty = (logsData?.length ?? 0) > 0; const meta = useTraceMeta([{traceSlug, timestamp: queryParams.timestamp}]); - const trace = useTrace({traceSlug, timestamp: queryParams.timestamp}); + const trace = useTrace({ + traceSlug, + timestamp: queryParams.timestamp, + additionalAttributes: ['thread.id'], + }); const tree = useTraceTree({traceSlug, trace, replay: null}); useTraceStateAnalytics({ diff --git a/static/app/views/performance/newTraceDetails/traceDrawer/tabs/traceProfiles.tsx b/static/app/views/performance/newTraceDetails/traceDrawer/tabs/traceProfiles.tsx index 65db1867bf76b8..1a6066d029f788 100644 --- a/static/app/views/performance/newTraceDetails/traceDrawer/tabs/traceProfiles.tsx +++ b/static/app/views/performance/newTraceDetails/traceDrawer/tabs/traceProfiles.tsx @@ -65,15 +65,22 @@ export function TraceProfiles({tree}: {tree: TraceTree}) { return null; } + const threadId = isEAPSpanNode(node) + ? (node.value.additional_attributes?.['thread.id'] ?? undefined) + : undefined; + const tid = typeof threadId === 'string' ? threadId : undefined; + const query = isTransactionNode(node) ? { eventId: node.value.event_id, + tid, } : isSpanNode(node) ? { eventId: TraceTree.ParentTransaction(node)?.value?.event_id, + tid, } - : {}; + : {tid}; const link = 'profiler_id' in profile