Skip to content

Commit cff6e78

Browse files
authored
chore(analytics): Add experimental analytics for new streamlined orgs (#83390)
Adds a few analytics to measure for new orgs locked in to streamline/legacy UI: - Issue details viewed - Comments created/updated/removed - Group Actions (archive, resolve, etc.) Plus a few bonus ones I think might be interesting to see if the new streamline features are used by new organizations: - Searches performed - Sections folded - Sidebar collapsing
1 parent 18740fe commit cff6e78

File tree

10 files changed

+42
-5
lines changed

10 files changed

+42
-5
lines changed

static/app/utils/analytics/issueAnalyticsEvents.tsx

+13-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,18 @@ export type IssueEventParameters = {
9696
'issue.search_sidebar_clicked': {};
9797
'issue.share_from_icon': {};
9898
'issue.shared_publicly': {};
99-
'issue_details.comment_created': {streamline: boolean};
100-
'issue_details.comment_deleted': {streamline: boolean};
101-
'issue_details.comment_updated': {streamline: boolean};
99+
'issue_details.comment_created': {
100+
org_streamline_only: boolean | undefined;
101+
streamline: boolean;
102+
};
103+
'issue_details.comment_deleted': {
104+
org_streamline_only: boolean | undefined;
105+
streamline: boolean;
106+
};
107+
'issue_details.comment_updated': {
108+
org_streamline_only: boolean | undefined;
109+
streamline: boolean;
110+
};
102111
'issue_details.copy_event_id_clicked': StreamlineGroupEventParams;
103112
'issue_details.copy_event_link_clicked': StreamlineGroupEventParams;
104113
'issue_details.escalating_feedback_received': {
@@ -130,6 +139,7 @@ export type IssueEventParameters = {
130139
};
131140
'issue_details.section_fold': {
132141
open: boolean;
142+
org_streamline_only: boolean | undefined;
133143
sectionKey: string;
134144
};
135145
'issue_details.set_priority': SetPriorityParams;

static/app/utils/analytics/workflowAnalyticsEvents.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export type TeamInsightsEventParameters = {
9898
| 'open_in_discover'
9999
| 'assign'
100100
| GroupStatus;
101+
org_streamline_only: boolean | undefined;
101102
action_status_details?: string;
102103
action_substatus?: string;
103104
assigned_suggestion_reason?: string;

static/app/views/issueDetails/actions/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export function GroupActions({group, project, disabled, event}: GroupActionsProp
158158
alert_type: typeof alert_type === 'string' ? alert_type : undefined,
159159
...getAnalyticsDataForGroup(group),
160160
...getAnalyicsDataForProject(project),
161+
org_streamline_only: organization.streamlineOnly ?? undefined,
161162
});
162163
};
163164

static/app/views/issueDetails/activitySection.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function ActivitySection(props: Props) {
4949
onCreate(n, me);
5050
trackAnalytics('issue_details.comment_created', {
5151
organization,
52+
org_streamline_only: organization.streamlineOnly ?? undefined,
5253
streamline: false,
5354
});
5455
setInputId(uniqueId());
@@ -76,6 +77,7 @@ function ActivitySection(props: Props) {
7677
trackAnalytics('issue_details.comment_deleted', {
7778
organization,
7879
streamline: false,
80+
org_streamline_only: organization.streamlineOnly ?? undefined,
7981
});
8082
}}
8183
onUpdate={n => {
@@ -84,6 +86,7 @@ function ActivitySection(props: Props) {
8486
trackAnalytics('issue_details.comment_updated', {
8587
organization,
8688
streamline: false,
89+
org_streamline_only: organization.streamlineOnly ?? undefined,
8790
});
8891
}}
8992
{...noteProps}

static/app/views/issueDetails/groupDetails.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,11 @@ function useTrackView({
448448
event,
449449
project,
450450
tab,
451+
organization,
451452
}: {
452453
event: Event | null;
453454
group: Group | null;
455+
organization: Organization;
454456
tab: Tab;
455457
project?: Project;
456458
}) {
@@ -476,6 +478,7 @@ function useTrackView({
476478
ref_fallback,
477479
group_event_type: groupEventType,
478480
prefers_streamlined_ui: user?.options?.prefersIssueDetailsStreamlinedUI ?? false,
481+
org_streamline_only: organization.streamlineOnly ?? undefined,
479482
});
480483
// Set default values for properties that may be updated in subcomponents.
481484
// Must be separate from the above values, otherwise the actual values filled in
@@ -613,7 +616,7 @@ function GroupDetailsContent({
613616
openIssueActivityDrawer,
614617
]);
615618

616-
useTrackView({group, event, project, tab: currentTab});
619+
useTrackView({group, event, project, tab: currentTab, organization});
617620

618621
const isDisplayingEventDetails = [
619622
Tab.DETAILS,

static/app/views/issueDetails/groupSidebar.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export default function GroupSidebar({
104104
typeof alert_date === 'string' ? getUtcDateString(Number(alert_date)) : undefined,
105105
alert_rule_id: typeof alert_rule_id === 'string' ? alert_rule_id : undefined,
106106
alert_type: typeof alert_type === 'string' ? alert_type : undefined,
107+
org_streamline_only: organization.streamlineOnly ?? undefined,
107108
...getAnalyticsDataForGroup(group),
108109
...getAnalyicsDataForProject(project),
109110
});

static/app/views/issueDetails/streamline/eventSearch.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {parseQueryBuilderValue} from 'sentry/components/searchQueryBuilder/utils
1111
import {joinQuery, Token} from 'sentry/components/searchSyntax/parser';
1212
import {t} from 'sentry/locale';
1313
import type {Group, Tag, TagCollection} from 'sentry/types/group';
14+
import {defined} from 'sentry/utils';
1415
import {
1516
FieldKind,
1617
getFieldDefinition,
@@ -186,6 +187,16 @@ export function EventSearch({
186187

187188
const filterKeySections = useMemo(() => getFilterKeySections(filterKeys), [filterKeys]);
188189

190+
const experimentSearchSource = hasStreamlinedUI
191+
? 'new_org_issue_details_header'
192+
: 'new_org_issue_events_tab';
193+
194+
const searchSource = defined(organization.streamlineOnly)
195+
? experimentSearchSource
196+
: hasStreamlinedUI
197+
? 'issue_details_header'
198+
: 'issue_events_tab';
199+
189200
return (
190201
<SearchQueryBuilder
191202
initialQuery={query}
@@ -195,7 +206,7 @@ export function EventSearch({
195206
getTagValues={getTagValues}
196207
placeholder={hasStreamlinedUI ? t('Filter events\u2026') : t('Search events\u2026')}
197208
label={hasStreamlinedUI ? t('Filter events\u2026') : t('Search events')}
198-
searchSource={hasStreamlinedUI ? 'issue_details_header' : 'issue_events_tab'}
209+
searchSource={searchSource}
199210
className={className}
200211
showUnsubmittedIndicator
201212
{...queryBuilderProps}

static/app/views/issueDetails/streamline/foldSection.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const FoldSection = forwardRef<HTMLElement, FoldSectionProps>(function Fo
114114
sectionKey,
115115
organization,
116116
open: !isCollapsed,
117+
org_streamline_only: organization.streamlineOnly ?? undefined,
117118
});
118119
setIsCollapsed(!isCollapsed);
119120
},

static/app/views/issueDetails/streamline/sidebar/activitySection.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export default function StreamlinedActivitySection({
166166
trackAnalytics('issue_details.comment_deleted', {
167167
organization,
168168
streamline: true,
169+
org_streamline_only: organization.streamlineOnly ?? undefined,
169170
});
170171
addSuccessMessage(t('Comment removed'));
171172
},
@@ -188,6 +189,7 @@ export default function StreamlinedActivitySection({
188189
trackAnalytics('issue_details.comment_updated', {
189190
organization,
190191
streamline: true,
192+
org_streamline_only: organization.streamlineOnly ?? undefined,
191193
});
192194
},
193195
});
@@ -209,6 +211,7 @@ export default function StreamlinedActivitySection({
209211
trackAnalytics('issue_details.comment_created', {
210212
organization,
211213
streamline: true,
214+
org_streamline_only: organization.streamlineOnly ?? undefined,
212215
});
213216
addSuccessMessage(t('Comment posted'));
214217
},

static/app/views/issueDetails/streamline/sidebar/toggleSidebar.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import {Button} from 'sentry/components/button';
44
import {IconChevron} from 'sentry/icons/iconChevron';
55
import {t} from 'sentry/locale';
66
import {space} from 'sentry/styles/space';
7+
import useOrganization from 'sentry/utils/useOrganization';
78
import {useIssueDetails} from 'sentry/views/issueDetails/streamline/context';
89

910
export function ToggleSidebar({size = 'lg'}: {size?: 'lg' | 'sm'}) {
11+
const organization = useOrganization();
1012
const {isSidebarOpen, dispatch} = useIssueDetails();
1113
const direction = isSidebarOpen ? 'right' : 'left';
1214
return (
@@ -22,6 +24,7 @@ export function ToggleSidebar({size = 'lg'}: {size?: 'lg' | 'sm'}) {
2224
analyticsEventName="Issue Details: Sidebar Toggle"
2325
analyticsParams={{
2426
sidebar_open: !isSidebarOpen,
27+
org_streamline_only: organization.streamlineOnly ?? undefined,
2528
}}
2629
>
2730
<LeftChevron direction={direction} />

0 commit comments

Comments
 (0)