Ver Fonte

Reduce Sentry noise (#1606)

Manav Rathi há 1 ano atrás
pai
commit
e59e7436eb

+ 1 - 4
apps/auth/sentry.client.config.ts

@@ -1,6 +1,3 @@
 import { setupSentry } from '@ente/shared/sentry/config/sentry.config.base';
 
-const DEFAULT_SENTRY_DSN =
-    'https://e2ccc39d811640b49602323774220955@sentry.ente.io/13';
-
-setupSentry(DEFAULT_SENTRY_DSN);
+setupSentry('https://ad075e4713480307bb8bc0811547c65e@sentry.ente.io/8');

+ 1 - 3
apps/photos/sentry.client.config.ts

@@ -1,5 +1,3 @@
 import { setupSentry } from '@ente/shared/sentry/config/sentry.config.base';
 
-const DEFAULT_SENTRY_DSN =
-    'https://bd3656fc40d74d5e8f278132817963a3@sentry.ente.io/2';
-setupSentry(DEFAULT_SENTRY_DSN);
+setupSentry('https://cbed7333f2810fbbdb692dcd76d8ca1a@sentry.ente.io/2');

+ 0 - 2
packages/shared/apps/env.ts

@@ -7,6 +7,4 @@ export const isDisableSentryFlagSet = () => {
     return process.env.NEXT_PUBLIC_DISABLE_SENTRY === 'true';
 };
 
-export const getSentryDSN = () => process.env.NEXT_PUBLIC_SENTRY_DSN;
-
 export const getSentryRelease = () => process.env.SENTRY_RELEASE;

+ 0 - 4
packages/shared/network/api.ts

@@ -72,10 +72,6 @@ export const getFamilyPortalURL = () => {
     return `https://family.ente.io`;
 };
 
-export const getSentryTunnelURL = () => {
-    return `https://sentry-reporter.ente.io`;
-};
-
 /*
 It's a dev deployment (and should use the environment override for endpoints ) in three cases:
 1. when the URL opened is that of the staging web app, or

+ 4 - 10
packages/shared/sentry/config/sentry.config.base.ts

@@ -1,33 +1,27 @@
 import * as Sentry from '@sentry/nextjs';
-import { getSentryTunnelURL } from '@ente/shared/network/api';
 import { getSentryUserID } from '@ente/shared/sentry/utils';
 import { runningInBrowser } from '@ente/shared/platform';
 import { getHasOptedOutOfCrashReports } from '@ente/shared/storage/localStorage/helpers';
 import { getIsSentryEnabled } from '@ente/shared/sentry/utils';
-import {
-    getAppEnv,
-    getSentryDSN,
-    getSentryRelease,
-} from '@ente/shared/apps/env';
+import { getAppEnv, getSentryRelease } from '@ente/shared/apps/env';
 
-export const setupSentry = async (DEFAULT_SENTRY_DSN: string) => {
+export const setupSentry = async (dsn: string) => {
     const HAS_OPTED_OUT_OF_CRASH_REPORTING =
         runningInBrowser() && getHasOptedOutOfCrashReports();
 
     if (!HAS_OPTED_OUT_OF_CRASH_REPORTING) {
-        const SENTRY_DSN = getSentryDSN() ?? DEFAULT_SENTRY_DSN;
         const APP_ENV = getAppEnv();
         const IS_ENABLED = getIsSentryEnabled();
         const SENTRY_RELEASE = getSentryRelease();
 
         Sentry.init({
-            dsn: SENTRY_DSN,
+            dsn,
             enabled: IS_ENABLED,
             environment: APP_ENV,
             release: SENTRY_RELEASE,
             attachStacktrace: true,
             autoSessionTracking: false,
-            tunnel: getSentryTunnelURL(),
+            tunnel: 'https://sentry-reporter.ente.io',
             beforeSend(event) {
                 event.request = event.request || {};
                 const currentURL = new URL(document.location.href);

+ 1 - 3
turbo.json

@@ -28,8 +28,6 @@
         "NEXT_PUBLIC_IS_TEST_APP",
         "NODE_ENV",
         "SENTRY_RELEASE",
-        "SENTRY_AUTH_TOKEN",
-        "NEXT_PUBLIC_SENTRY_DSN",
-        "NEXT_PUBLIC_SENTRY_ENV"
+        "SENTRY_AUTH_TOKEN"
     ]
 }