Skip to content

Commit f418d2a

Browse files
authored
feat(analytics): Add Seer feature tracking to issue_details.seer_opened event (#104547)
add `has_summary`, `has_root_cause`, `has_solution`, `has_coded_solution`, and `has_pr` properties to the "Issue Details: Seer Opened" analytics event to track which Seer features are available when users open the panel. This PR was created with claude code, given the linear ticket as a prompt via Linear-MCP. Fixes https://linear.app/getsentry/issue/AIML-1994/track-seer-panel-fields-in-seer-opened-event
1 parent f927dbf commit f418d2a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

static/app/utils/analytics/workflowAnalyticsEvents.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ export type TeamInsightsEventParameters = {
134134
group_id: string | undefined;
135135
resource: string;
136136
};
137+
'issue_details.seer_opened': {
138+
autofix_exists: boolean;
139+
autofix_step_type: string | null;
140+
has_coded_solution: boolean;
141+
has_pr: boolean;
142+
has_root_cause: boolean;
143+
has_solution: boolean;
144+
has_streamlined_ui: boolean;
145+
has_summary: boolean;
146+
};
137147
'issue_details.suspect_commits.commit_clicked': IssueDetailsWithAlert & {
138148
has_pull_request: boolean;
139149
suspect_commit_calculation: string;
@@ -233,6 +243,7 @@ export const workflowEventMap: Record<TeamInsightsEventKey, string | null> = {
233243
'issue_details.issue_tab.trace_timeline_more_events_clicked':
234244
'Issue Details: Trace Timeline More Events Clicked',
235245
'issue_details.resources_link_clicked': 'Issue Details: Resources Link Clicked',
246+
'issue_details.seer_opened': 'Issue Details: Seer Opened',
236247
'issue_details.suspect_commits.commit_clicked': 'Issue Details: Suspect Commit Clicked',
237248
'issue_details.suspect_commits.pull_request_clicked':
238249
'Issue Details: Suspect Pull Request Clicked',

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ import {
1010
type AutofixStep,
1111
} from 'sentry/components/events/autofix/types';
1212
import {useAiAutofix, useAutofixData} from 'sentry/components/events/autofix/useAutofix';
13-
import {getAutofixRunExists} from 'sentry/components/events/autofix/utils';
13+
import {
14+
getAutofixRunExists,
15+
getCodeChangesDescription,
16+
getRootCauseDescription,
17+
getSolutionDescription,
18+
hasPullRequest,
19+
} from 'sentry/components/events/autofix/utils';
20+
import {useGroupSummaryData} from 'sentry/components/group/groupSummary';
1421
import LoadingIndicator from 'sentry/components/loadingIndicator';
1522
import Placeholder from 'sentry/components/placeholder';
1623
import {IconChevron} from 'sentry/icons';
@@ -56,6 +63,8 @@ export function SeerSectionCtaButton({
5663
pollInterval: 1500,
5764
});
5865

66+
const {data: summaryData, isPending: isSummaryPending} = useGroupSummaryData(group);
67+
5968
const {openSeerDrawer} = useOpenSeerDrawer({
6069
group,
6170
project,
@@ -143,6 +152,13 @@ export function SeerSectionCtaButton({
143152
const hasStepType = (type: AutofixStepType) =>
144153
autofixData?.steps?.some(step => step.type === type);
145154

155+
const rootCauseDescription = autofixData ? getRootCauseDescription(autofixData) : null;
156+
const solutionDescription = autofixData ? getSolutionDescription(autofixData) : null;
157+
const codeChangesDescription = autofixData
158+
? getCodeChangesDescription(autofixData)
159+
: null;
160+
const hasPr = hasPullRequest(autofixData);
161+
146162
const getButtonText = () => {
147163
if (!aiConfig.hasAutofix) {
148164
return t('Open Resources');
@@ -205,6 +221,11 @@ export function SeerSectionCtaButton({
205221
has_streamlined_ui: hasStreamlinedUI,
206222
autofix_exists: Boolean(autofixData?.steps?.length),
207223
autofix_step_type: lastStep?.type ?? null,
224+
has_summary: Boolean(summaryData && !isSummaryPending),
225+
has_root_cause: Boolean(rootCauseDescription),
226+
has_solution: Boolean(solutionDescription),
227+
has_coded_solution: Boolean(codeChangesDescription),
228+
has_pr: hasPr,
208229
}}
209230
priority="primary"
210231
>

0 commit comments

Comments
 (0)