Browse Source

feat(new-trace): Removed unwanted analytics and updated analytics con… (#67443)

We don't want to be sending the wrong source for analytics from the new
view. Will be adding new analytics seperately.

Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
Abdkhan14 11 months ago
parent
commit
6330cb9821

+ 2 - 12
static/app/components/events/interfaces/spans/newTraceDetailsSpanDetails.tsx

@@ -22,7 +22,6 @@ import type {Organization} from 'sentry/types';
 import type {EventTransaction} from 'sentry/types/event';
 import {assert} from 'sentry/types/utils';
 import {defined} from 'sentry/utils';
-import {trackAnalytics} from 'sentry/utils/analytics';
 import EventView from 'sentry/utils/discover/eventView';
 import {generateEventSlug} from 'sentry/utils/discover/urls';
 import getDynamicText from 'sentry/utils/getDynamicText';
@@ -105,19 +104,10 @@ function NewTraceDetailsSpanDetail(props: SpanDetailProps) {
   );
 
   useLayoutEffect(() => {
-    const {span, organization, event} = props;
-    if (!('op' in span)) {
+    if (!('op' in props.span)) {
       return;
     }
-
-    trackAnalytics('performance_views.event_details.open_span_details', {
-      organization,
-      operation: span.op ?? 'undefined',
-      origin: span.origin ?? 'undefined',
-      project_platform: event.platform ?? 'undefined',
-    });
-    // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, []);
+  }, [props.span]);
 
   function renderTraversalButton(): React.ReactNode {
     if (!props.childTransactions) {

+ 3 - 8
static/app/views/performance/newTraceDetails/traceDrawer/details/transaction.tsx

@@ -181,14 +181,14 @@ function ReplaySection({
     <ReplaySectionContainer>
       <ReplaySectionTitle>{t('Session Replay')}</ReplaySectionTitle>
       <ReplayClipPreview
-        analyticsContext="issue_details"
+        analyticsContext="trace-view"
         replaySlug={replayId}
         orgSlug={organization.slug}
         eventTimestampMs={eventTimestampMs}
         clipOffsets={REPLAY_CLIP_OFFSETS}
         fullReplayButtonProps={{
-          analyticsEventKey: 'issue_details.open_replay_details_clicked',
-          analyticsEventName: 'Issue Details: Open Replay Details Clicked',
+          analyticsEventKey: 'trace-view.drawer-open-replay-details-clicked',
+          analyticsEventName: 'Trace View: Open Replay Details Clicked',
           analyticsParams: {
             ...getAnalyticsDataForEvent(event),
             organization,
@@ -300,11 +300,6 @@ export function TransactionNodeDetails({
             icon={<IconOpen />}
             href={`/api/0/projects/${organization.slug}/${node.value.project_slug}/events/${node.value.event_id}/json/`}
             external
-            onClick={() =>
-              trackAnalytics('performance_views.event_details.json_button_click', {
-                organization,
-              })
-            }
           >
             {t('JSON')} (<FileSize bytes={event?.size} />)
           </Button>