Browse Source

feat(new-trace): Updated group hash for span summary route (#73967)

For the new span summary UI we pass the `group` hash from `sentry_tags`
if it exists and nothing otherwise:
<img width="1265" alt="Screenshot 2024-07-08 at 1 57 01 PM"
src="https://github.com/getsentry/sentry/assets/60121741/0489f63b-1a88-4957-9aa6-5785ecf53e23">

Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
Abdullah Khan 8 months ago
parent
commit
8c1b0cb4fe

+ 8 - 1
static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/generalInfo.tsx

@@ -72,6 +72,13 @@ export function GeneralInfo(props: GeneralnfoProps) {
     span.sentry_tags?.category
     span.sentry_tags?.category
   );
   );
 
 
+  const hasNewSpansUIFlag =
+    props.organization.features.includes('performance-spans-new-ui') &&
+    props.organization.features.includes('insights-initial-modules');
+
+  // The new spans UI relies on the group hash assigned by Relay, which is different from the hash available on the span itself.
+  const groupHash = hasNewSpansUIFlag ? span.sentry_tags?.group ?? '' : span.hash ?? '';
+
   if (
   if (
     ![ModuleName.DB, ModuleName.RESOURCE].includes(resolvedModule) &&
     ![ModuleName.DB, ModuleName.RESOURCE].includes(resolvedModule) &&
     span.description
     span.description
@@ -87,7 +94,7 @@ export function GeneralInfo(props: GeneralnfoProps) {
               orgSlug: props.organization.slug,
               orgSlug: props.organization.slug,
               transaction: event.title,
               transaction: event.title,
               query: props.location.query,
               query: props.location.query,
-              spanSlug: {op: span.op, group: span.hash},
+              spanSlug: {op: span.op, group: groupHash},
               projectID: event.projectID,
               projectID: event.projectID,
             })}
             })}
             linkText={t('View Similar Spans')}
             linkText={t('View Similar Spans')}

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

@@ -2,7 +2,7 @@ import type {Query} from 'history';
 
 
 import type {SpanSlug} from 'sentry/utils/performance/suspectSpans/types';
 import type {SpanSlug} from 'sentry/utils/performance/suspectSpans/types';
 
 
-export function generateSpanDetailsRoute({
+function generateSpanDetailsRoute({
   orgSlug,
   orgSlug,
   spanSlug,
   spanSlug,
 }: {
 }: {