Skip to content

Commit abbf402

Browse files
authored
feat(dapp): Sentry enabled only in mainnet (#1066)
* feat(dapp): Sentry enabled only in mainnet * feat(dapp): Sentry enabled only in mainnet
1 parent fea069a commit abbf402

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

dapp/sentry.common.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
export const IS_PROD = process.env.NEXT_PUBLIC_BUILD_ENV === 'production';
5+
export const IS_SENTRY_ENABLED = process.env.NEXT_PUBLIC_SENTRY_ENABLED === 'true';
56

6-
export const SENTRY_DSN = IS_PROD
7-
? 'https://880b00b12c5d12e3fbabfc2f9dc83344@o4508279186718720.ingest.de.sentry.io/4510205355360337'
8-
: 'https://de5a2b44cc967804379ecefe61281ccb@o4508279186718720.ingest.de.sentry.io/4510205404643408';
7+
export const SENTRY_DSN = IS_SENTRY_ENABLED
8+
? IS_PROD
9+
? 'https://880b00b12c5d12e3fbabfc2f9dc83344@o4508279186718720.ingest.de.sentry.io/4510205355360337'
10+
: 'https://de5a2b44cc967804379ecefe61281ccb@o4508279186718720.ingest.de.sentry.io/4510205404643408'
11+
: undefined;
912

1013
export const SENTRY_PROJECT_NAME = IS_PROD ? 'iota-names-dapp' : 'iota-names-dapp-dev';
1114
export const SENTRY_ORG_NAME = 'iota-foundation-eu';

dapp/sentry.edge.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
import * as Sentry from '@sentry/nextjs';
1010

11-
import { IS_PROD, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from './sentry.common.config.mjs';
11+
import { IS_SENTRY_ENABLED, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from './sentry.common.config.mjs';
1212

1313
Sentry.init({
14-
enabled: IS_PROD && Boolean(SENTRY_DSN),
14+
enabled: IS_SENTRY_ENABLED && Boolean(SENTRY_DSN),
1515
dsn: SENTRY_DSN,
1616

1717
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.

dapp/sentry.server.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import * as Sentry from '@sentry/nextjs';
99

10-
import { IS_PROD, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from './sentry.common.config.mjs';
10+
import { IS_SENTRY_ENABLED, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from './sentry.common.config.mjs';
1111

1212
Sentry.init({
13-
enabled: IS_PROD && Boolean(SENTRY_DSN),
13+
enabled: IS_SENTRY_ENABLED && Boolean(SENTRY_DSN),
1414
dsn: SENTRY_DSN,
1515

1616
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.

dapp/src/instrumentation-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import * as Sentry from '@sentry/nextjs';
99

10-
import { IS_PROD, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from '../sentry.common.config.mjs';
10+
import { IS_SENTRY_ENABLED, SENTRY_DSN, SENTRY_IGNORE_ERRORS } from '../sentry.common.config.mjs';
1111

1212
Sentry.init({
13-
enabled: IS_PROD && Boolean(SENTRY_DSN),
13+
enabled: IS_SENTRY_ENABLED && Boolean(SENTRY_DSN),
1414
dsn: SENTRY_DSN,
1515

1616
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.

0 commit comments

Comments
 (0)