Просмотр исходного кода

feat(new-trace): Adding additional context block to transaction detail in drawer (#68402)

Mobile event details were missing app and device context blocks:
<img width="940" alt="Screenshot 2024-04-08 at 12 14 56 AM"
src="https://github.com/getsentry/sentry/assets/60121741/b105653a-fdaf-4a83-9409-00fd185a0748">

---------

Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
Abdkhan14 11 месяцев назад
Родитель
Сommit
a2f47c3f89

+ 30 - 0
static/app/views/performance/newTraceDetails/traceDrawer/details/transaction.tsx

@@ -205,6 +205,35 @@ function ReplaySection({
   ) : null;
 }
 
+function AdditionalMobileEventContexts({event}: {event: EventTransaction}) {
+  if (!event.contexts) {
+    return null;
+  }
+  return (
+    <Fragment>
+      {Object.entries(omit(event.contexts ?? {}, ['feedback', 'response'])).map(
+        ([key, value]) => {
+          // Ignore profile as it's handled separately in the drawer.
+          if (key === 'profile') {
+            return null;
+          }
+
+          return (
+            <Chunk
+              key={key}
+              type={value?.type ?? ''}
+              alias={key}
+              group={undefined}
+              event={event}
+              value={value}
+            />
+          );
+        }
+      )}
+    </Fragment>
+  );
+}
+
 const LAZY_RENDER_PROPS: Partial<LazyRenderProps> = {
   observerOptions: {rootMargin: '50px'},
 };
@@ -496,6 +525,7 @@ export function TransactionNodeDetails({
           value={event.user}
         />
       ) : null}
+      <AdditionalMobileEventContexts event={event} />
       <EventExtraData event={event} />
       <EventSdk sdk={event.sdk} meta={event._meta?.sdk} />
       {event._metrics_summary ? (