Skip to content

Commit c606f7a

Browse files
Abdkhan14Abdullah Khan
andauthored
Abdk/trace details profile spans (#93845)
- Helps us link to a specific span in the profile page. - Adds a profile section to eligible spans <img width="1237" alt="Screenshot 2025-06-18 at 2 58 53 PM" src="https://github.com/user-attachments/assets/b9b366bd-7215-438d-b18a-21840b980e2b" /> --------- Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
1 parent 6224e34 commit c606f7a

File tree

1 file changed

+14
-4
lines changed
  • static/app/views/performance/newTraceDetails/traceDrawer/details/span

1 file changed

+14
-4
lines changed

static/app/views/performance/newTraceDetails/traceDrawer/details/span/index.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import {
6565
isEAPSpanNode,
6666
isEAPTransactionNode,
6767
} from 'sentry/views/performance/newTraceDetails/traceGuards';
68-
import type {TraceTree} from 'sentry/views/performance/newTraceDetails/traceModels/traceTree';
68+
import {TraceTree} from 'sentry/views/performance/newTraceDetails/traceModels/traceTree';
6969
import type {TraceTreeNode} from 'sentry/views/performance/newTraceDetails/traceModels/traceTreeNode';
7070
import {useTraceState} from 'sentry/views/performance/newTraceDetails/traceState/traceStateProvider';
7171
import {ProfileGroupProvider} from 'sentry/views/profiling/profileGroupProvider';
@@ -389,12 +389,17 @@ function EAPSpanNodeDetails({
389389
enabled: true,
390390
});
391391

392+
// EAP spans with is_transaction=false don't have an associated transaction_id that maps to the nodestore transaction.
393+
// In that case we use the transaction id attached to the direct parent EAP span where is_transaction=true.
394+
const transaction_event_id =
395+
node.value.transaction_id ??
396+
TraceTree.ParentEAPTransaction(node)?.value.transaction_id;
392397
const {
393398
data: eventTransaction,
394399
isLoading: isEventTransactionLoading,
395400
isError: isEventTransactionError,
396401
} = useTransaction({
397-
event_id: node.value.transaction_id,
402+
event_id: transaction_event_id,
398403
project_slug: node.value.project_slug,
399404
organization,
400405
});
@@ -438,7 +443,12 @@ function EAPSpanNodeDetails({
438443
return (
439444
<StyledLink
440445
data-test-id="view-profile"
441-
to={target}
446+
to={{
447+
pathname: target,
448+
query: {
449+
spanId: node.value.event_id,
450+
},
451+
}}
442452
onClick={() =>
443453
trackAnalytics('profiling_views.go_to_flamegraph', {
444454
organization,
@@ -558,7 +568,7 @@ function EAPSpanNodeDetails({
558568

559569
<LogDetails />
560570

561-
{isTransaction && organization.features.includes('profiling') ? (
571+
{eventTransaction && organization.features.includes('profiling') ? (
562572
<ProfileDetails
563573
organization={organization}
564574
project={project}

0 commit comments

Comments
 (0)