|
@@ -1,5 +1,7 @@
|
|
|
import diagramApdex from 'sentry-images/spot/alerts-wizard-apdex.svg';
|
|
|
import diagramCLS from 'sentry-images/spot/alerts-wizard-cls.svg';
|
|
|
+import diagramCrashFreeSessions from 'sentry-images/spot/alerts-wizard-crash-free-sessions.svg';
|
|
|
+import diagramCrashFreeUsers from 'sentry-images/spot/alerts-wizard-crash-free-users.svg';
|
|
|
import diagramCustom from 'sentry-images/spot/alerts-wizard-custom.svg';
|
|
|
import diagramErrors from 'sentry-images/spot/alerts-wizard-errors.svg';
|
|
|
import diagramFailureRate from 'sentry-images/spot/alerts-wizard-failure-rate.svg';
|
|
@@ -11,6 +13,7 @@ import diagramTransactionDuration from 'sentry-images/spot/alerts-wizard-transac
|
|
|
import diagramUsers from 'sentry-images/spot/alerts-wizard-users-experiencing-errors.svg';
|
|
|
|
|
|
import {t} from 'app/locale';
|
|
|
+import {Organization} from 'app/types';
|
|
|
import {Dataset, EventTypes} from 'app/views/alerts/incidentRules/types';
|
|
|
|
|
|
export type AlertType =
|
|
@@ -24,7 +27,9 @@ export type AlertType =
|
|
|
| 'lcp'
|
|
|
| 'fid'
|
|
|
| 'cls'
|
|
|
- | 'custom';
|
|
|
+ | 'custom'
|
|
|
+ | 'crash_free_sessions'
|
|
|
+ | 'crash_free_users';
|
|
|
|
|
|
export const WebVitalAlertTypes = new Set(['lcp', 'fid', 'cls', 'fcp']);
|
|
|
|
|
@@ -40,16 +45,24 @@ export const AlertWizardAlertNames: Record<AlertType, string> = {
|
|
|
fid: t('First Input Delay'),
|
|
|
cls: t('Cumulative Layout Shift'),
|
|
|
custom: t('Custom Metric'),
|
|
|
+ crash_free_sessions: t('Crash Free Session Rate'),
|
|
|
+ crash_free_users: t('Crash Free User Rate'),
|
|
|
};
|
|
|
|
|
|
-export const AlertWizardOptions: {
|
|
|
- categoryHeading: string;
|
|
|
- options: AlertType[];
|
|
|
-}[] = [
|
|
|
+type AlertWizardCategory = {categoryHeading: string; options: AlertType[]};
|
|
|
+export const getAlertWizardCategories = (org: Organization): AlertWizardCategory[] => [
|
|
|
{
|
|
|
categoryHeading: t('Errors'),
|
|
|
options: ['issues', 'num_errors', 'users_experiencing_errors'],
|
|
|
},
|
|
|
+ ...(org.features.includes('crash-rate-alerts')
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ categoryHeading: t('Sessions'),
|
|
|
+ options: ['crash_free_sessions', 'crash_free_users'] as AlertType[],
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : []),
|
|
|
{
|
|
|
categoryHeading: t('Performance'),
|
|
|
options: [
|
|
@@ -181,6 +194,24 @@ export const AlertWizardPanelContent: Record<AlertType, PanelContent> = {
|
|
|
],
|
|
|
illustration: diagramCustom,
|
|
|
},
|
|
|
+ crash_free_sessions: {
|
|
|
+ description: t(
|
|
|
+ 'A session begins when a user starts the application and ends when it’s closed or sent to the background. A crash is when a session ends due to an error and this type of alert lets you monitor when those crashed sessions exceed a threshold. This lets you get a better picture of the health of your app.'
|
|
|
+ ),
|
|
|
+ examples: [
|
|
|
+ t('When the Crash Free Rate is below 98%, send a Slack notification to the team.'),
|
|
|
+ ],
|
|
|
+ illustration: diagramCrashFreeSessions,
|
|
|
+ },
|
|
|
+ crash_free_users: {
|
|
|
+ description: t(
|
|
|
+ 'Crash Free Users is the percentage of distinct users that haven’t experienced a crash and so this type of alert tells you when the overall user experience dips below a certain unacceptable threshold.'
|
|
|
+ ),
|
|
|
+ examples: [
|
|
|
+ t('When the Crash Free Rate is below 97%, send an email notification to yourself.'),
|
|
|
+ ],
|
|
|
+ illustration: diagramCrashFreeUsers,
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
export type WizardRuleTemplate = {
|
|
@@ -190,7 +221,7 @@ export type WizardRuleTemplate = {
|
|
|
};
|
|
|
|
|
|
export const AlertWizardRuleTemplates: Record<
|
|
|
- Exclude<AlertType, 'issues'>,
|
|
|
+ Exclude<AlertType, 'issues' | 'crash_free_sessions' | 'crash_free_users'>,
|
|
|
WizardRuleTemplate
|
|
|
> = {
|
|
|
num_errors: {
|