Skip to content

Commit c16d87f

Browse files
authored
fix(trace-view): Link list of profiles to right thread (#103850)
We need to fetch the thread id for the span and link to that directly.
1 parent a29b035 commit c16d87f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

static/app/views/performance/newTraceDetails/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ function TraceViewImpl({traceSlug}: {traceSlug: string}) {
114114
const hideTraceWaterfallIfEmpty = (logsData?.length ?? 0) > 0;
115115

116116
const meta = useTraceMeta([{traceSlug, timestamp: queryParams.timestamp}]);
117-
const trace = useTrace({traceSlug, timestamp: queryParams.timestamp});
117+
const trace = useTrace({
118+
traceSlug,
119+
timestamp: queryParams.timestamp,
120+
additionalAttributes: ['thread.id'],
121+
});
118122
const tree = useTraceTree({traceSlug, trace, replay: null});
119123

120124
useTraceStateAnalytics({

static/app/views/performance/newTraceDetails/traceDrawer/tabs/traceProfiles.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,22 @@ export function TraceProfiles({tree}: {tree: TraceTree}) {
6565
return null;
6666
}
6767

68+
const threadId = isEAPSpanNode(node)
69+
? (node.value.additional_attributes?.['thread.id'] ?? undefined)
70+
: undefined;
71+
const tid = typeof threadId === 'string' ? threadId : undefined;
72+
6873
const query = isTransactionNode(node)
6974
? {
7075
eventId: node.value.event_id,
76+
tid,
7177
}
7278
: isSpanNode(node)
7379
? {
7480
eventId: TraceTree.ParentTransaction(node)?.value?.event_id,
81+
tid,
7582
}
76-
: {};
83+
: {tid};
7784

7885
const link =
7986
'profiler_id' in profile

0 commit comments

Comments
 (0)