diff --git a/src/sentry/incidents/charts.py b/src/sentry/incidents/charts.py index cf7df6e442e2..0207605929fa 100644 --- a/src/sentry/incidents/charts.py +++ b/src/sentry/incidents/charts.py @@ -30,6 +30,8 @@ SESSION_AGGREGATE_TO_FIELD = { CRASH_FREE_SESSIONS: "sum(session)", CRASH_FREE_USERS: "count_unique(user)", + "percentage(sessions_crashed, sessions)": "sum(session)", + "percentage(users_crashed, users)": "count_unique(user)", } diff --git a/static/app/views/alerts/utils/index.tsx b/static/app/views/alerts/utils/index.tsx index 8d2217990dea..95195492b864 100644 --- a/static/app/views/alerts/utils/index.tsx +++ b/static/app/views/alerts/utils/index.tsx @@ -110,12 +110,18 @@ export function getQueryDatasource( } export function isSessionAggregate(aggregate: string) { - return Object.values(SessionsAggregate).includes(aggregate as SessionsAggregate); + return ( + Object.values(SessionsAggregate).includes(aggregate as SessionsAggregate) || + aggregate === 'percentage(sessions_crashed, sessions)' || + aggregate === 'percentage(users_crashed, users)' + ); } export const SESSION_AGGREGATE_TO_FIELD: Record = { [SessionsAggregate.CRASH_FREE_SESSIONS]: SessionFieldWithOperation.SESSIONS, [SessionsAggregate.CRASH_FREE_USERS]: SessionFieldWithOperation.USERS, + 'percentage(sessions_crashed, sessions)': SessionFieldWithOperation.SESSIONS, + 'percentage(users_crashed, users)': SessionFieldWithOperation.USERS, }; export function alertAxisFormatter(value: number, seriesName: string, aggregate: string) {