Browse Source

fix(trace): fix collapsing of android spans (#68243)

Dont collapse android http spans that have trace continuation
Jonas 11 months ago
parent
commit
f915116951

+ 2 - 0
static/app/views/performance/newTraceDetails/trace.tsx

@@ -1990,6 +1990,8 @@ const TraceStylingWrapper = styled('div')`
     right: 0;
     top: 0;
     transform: translateX(calc(var(--translate-x) * 1px));
+    z-index: 10;
+    pointer-events: none;
   }
 
   .TraceIndicator {

+ 1 - 1
static/app/views/performance/newTraceDetails/traceDrawer/traceDrawer.tsx

@@ -374,7 +374,7 @@ function TraceDrawerTab(props: TraceDrawerTabProps) {
         }}
       >
         {/* A trace is technically an entry in the list, so it has a color */}
-        {node === 'trace' ? null : (
+        {props.tab.node === 'trace' || props.tab.node === 'vitals' ? null : (
           <TabButtonIndicator
             backgroundColor={makeTraceNodeBarColor(props.theme, root)}
           />

+ 7 - 2
static/app/views/performance/newTraceDetails/traceTree.tsx

@@ -256,8 +256,13 @@ export function makeTraceNodeBarColor(
 
 function shouldCollapseNodeByDefault(node: TraceTreeNode<TraceTree.NodeValue>) {
   if (isSpanNode(node)) {
-    // Android creates TCP connection spans which are noisy and not useful in most cases
-    if (node.value.op === 'http.client' && node.value.origin === 'auto.http.okhttp') {
+    // Android creates TCP connection spans which are noisy and not useful in most cases.
+    // Unless the span has a child txn which would indicate a continuaton of the trace, we collapse it.
+    if (
+      node.value.op === 'http.client' &&
+      node.value.origin === 'auto.http.okhttp' &&
+      !node.value.childTransaction
+    ) {
       return true;
     }
   }