Browse Source

chore(suspect-spans): Query for necessary columns in span details page (#30893)

Analogous to #30885, this adds the necessary columns to the query explicitly.
Tony Xiao 3 years ago
parent
commit
af22935bcd

+ 15 - 1
static/app/views/performance/transactionSummary/transactionSpans/spanDetails/content.tsx

@@ -41,6 +41,7 @@ type Props = {
 
 export default function SpanDetailsContentWrapper(props: Props) {
   const {location, organization, eventView, projectId, transactionName, spanSlug} = props;
+
   return (
     <Fragment>
       <Layout.Header>
@@ -74,7 +75,7 @@ export default function SpanDetailsContentWrapper(props: Props) {
                 <SuspectSpansQuery
                   location={location}
                   orgSlug={organization.slug}
-                  eventView={eventView}
+                  eventView={getSpansEventView(eventView)}
                   perSuspect={0}
                   spanOps={[spanSlug.op]}
                   spanGroups={[spanSlug.group]}
@@ -259,6 +260,19 @@ function SpanDetailsHeader(props: HeaderProps) {
   );
 }
 
+function getSpansEventView(eventView: EventView): EventView {
+  eventView = eventView.clone();
+  eventView.fields = [
+    {field: 'count()'},
+    {field: 'count_unique(id)'},
+    {field: 'sumArray(spans_exclusive_time)'},
+    {field: 'percentileArray(spans_exclusive_time, 0.75)'},
+    {field: 'percentileArray(spans_exclusive_time, 0.95)'},
+    {field: 'percentileArray(spans_exclusive_time, 0.99)'},
+  ];
+  return eventView;
+}
+
 const ContentHeader = styled('div')`
   display: grid;
   grid-template-columns: 1fr;