Browse Source

feat(uptime): Add FE project setting for disabling automatic uptime checks

davidenwang 8 months ago
parent
commit
3c669cc13d

+ 8 - 0
static/app/data/forms/projectGeneralSettings.tsx

@@ -180,4 +180,12 @@ export const fields: Record<string, Field> = {
     label: t('Verify TLS/SSL'),
     help: t('Outbound requests will verify TLS (sometimes known as SSL) connections'),
   },
+  uptimeAutodetection: {
+    name: 'uptimeAutodetection',
+    type: 'boolean',
+    label: t('Enable Automatic Uptime Checks'),
+    help: t(
+      'Sentry will attempt to auto-detect important urls to monitor for any downtime'
+    ),
+  },
 };

+ 1 - 0
static/app/types/project.tsx

@@ -66,6 +66,7 @@ export type Project = {
   subjectTemplate: string;
   team: Team;
   teams: Team[];
+  uptimeAutodetection: boolean;
   verifySSL: boolean;
   builtinSymbolSources?: string[];
   defaultEnvironment?: string;

+ 8 - 1
static/app/views/settings/projectGeneralSettings/index.tsx

@@ -8,6 +8,7 @@ import {
   transferProject,
 } from 'sentry/actionCreators/projects';
 import {hasEveryAccess} from 'sentry/components/acl/access';
+import Feature from 'sentry/components/acl/feature';
 import {Button} from 'sentry/components/button';
 import Confirm from 'sentry/components/confirm';
 import FieldGroup from 'sentry/components/forms/fieldGroup';
@@ -376,8 +377,14 @@ class ProjectGeneralSettings extends DeprecatedAsyncView<Props, State> {
               </PanelAlert>
             )}
           />
+          <Feature features="organizations:uptime-settings">
+            <JsonForm
+              {...jsonFormProps}
+              title={t('Uptime Checks')}
+              fields={[fields.uptimeAutodetection]}
+            />
+          </Feature>
         </Form>
-
         <Panel>
           <PanelHeader>{t('Project Administration')}</PanelHeader>
           {this.renderRemoveProject()}

+ 1 - 0
tests/js/fixtures/project.ts

@@ -58,6 +58,7 @@ export function ProjectFixture(params: Partial<Project> = {}): Project {
     scrubIPAddresses: false,
     sensitiveFields: [],
     subjectTemplate: '',
+    uptimeAutodetection: true,
     verifySSL: false,
     extrapolateMetrics: false,
     ...params,