Skip to content

Commit ed8fa4d

Browse files
Abdkhan14Abdullah Khan
andauthored
feat(trace-eap-waterfall): Exclude missing instrumentation nodes from FE traces (#97879)
- node.event is undefined for eap span nodes since it corresponds to the nodestore transaction event json in non-eap span nodes - we can just use sdk name from the `/trace/` response Co-authored-by: Abdullah Khan <[email protected]>
1 parent 1e0b6c8 commit ed8fa4d

File tree

1 file changed

+18
-2
lines changed
  • static/app/views/performance/newTraceDetails/traceModels

1 file changed

+18
-2
lines changed

static/app/views/performance/newTraceDetails/traceModels/traceTree.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export declare namespace TraceTree {
174174
profiler_id: string;
175175
project_id: number;
176176
project_slug: string;
177+
sdk_name: string;
177178
start_timestamp: number;
178179
transaction: string;
179180
transaction_id: string;
@@ -882,14 +883,17 @@ export class TraceTree extends TraceTreeEventDispatcher {
882883
let missingInstrumentationCount = 0;
883884

884885
TraceTree.ForEachChild(root, child => {
886+
const childSdkName = getSdkName(child);
887+
const previousSdkName = previous ? getSdkName(previous) : undefined;
888+
885889
if (
886890
previous &&
887891
child &&
888892
((isSpanNode(previous) && isSpanNode(child)) ||
889893
(isNonTransactionEAPSpanNode(previous) &&
890894
isNonTransactionEAPSpanNode(child))) &&
891-
shouldAddMissingInstrumentationSpan(child.event?.sdk?.name ?? '') &&
892-
shouldAddMissingInstrumentationSpan(previous.event?.sdk?.name ?? '') &&
895+
shouldAddMissingInstrumentationSpan(childSdkName) &&
896+
shouldAddMissingInstrumentationSpan(previousSdkName) &&
893897
child.space[0] - previous.space[0] - previous.space[1] >=
894898
TraceTree.MISSING_INSTRUMENTATION_THRESHOLD_MS
895899
) {
@@ -2578,3 +2582,15 @@ export function getNodeDescriptionPrefix(
25782582
isSpanNode(node) && node.value.data && !!node.value.data['http.request.prefetch'];
25792583
return isPrefetch ? '(prefetch) ' : '';
25802584
}
2585+
2586+
function getSdkName(node: TraceTreeNode<TraceTree.NodeValue>): string | undefined {
2587+
if (isSpanNode(node)) {
2588+
return node.event?.sdk?.name ?? undefined;
2589+
}
2590+
2591+
if (isEAPSpanNode(node) || isTransactionNode(node)) {
2592+
return node.value.sdk_name ?? undefined;
2593+
}
2594+
2595+
return undefined;
2596+
}

0 commit comments

Comments
 (0)