Reduce Sentry DSN noise

We don't need to customize this, so reduce all the indirection and dance around it.
This commit is contained in:
Manav Rathi 2024-02-09 13:31:23 +05:30
parent e5f8b5faa8
commit 9289bbd0d0
4 changed files with 5 additions and 17 deletions

View file

@ -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://e2ccc39d811640b49602323774220955@sentry.ente.io/13');

View file

@ -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://bd3656fc40d74d5e8f278132817963a3@sentry.ente.io/2');

View file

@ -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;

View file

@ -4,24 +4,19 @@ 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,