forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sentry.constants.mjs
45 lines (40 loc) · 1.41 KB
/
sentry.constants.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { BASE_URL, IS_DEVELOPMENT, VERCEL_ENV } from './next.constants.mjs';
/**
* This is the Sentry DSN for the Node.js Website Project
*/
export const SENTRY_DSN =
'https://02884d0745aecaadf5f780278fe5fe70@o4506191161786368.ingest.sentry.io/4506191307735040';
/**
* This states if Sentry should be enabled and bundled within our App
*
* We enable sentry by default if we're om development mode or deployed
* on Vercel (either production or preview branches)
*/
export const SENTRY_ENABLE = IS_DEVELOPMENT || !!VERCEL_ENV;
/**
* This configures the sampling rate for Sentry
*
* We always want to capture 100% on Vercel Preview Branches
* and not when it's on Production Mode (nodejs.org)
*/
export const SENTRY_CAPTURE_RATE =
SENTRY_ENABLE && VERCEL_ENV && BASE_URL !== 'https://nodejs.org' ? 1.0 : 0.01;
/**
* Provides the Route for Sentry's Server-Side Tunnel
*
* This is a `@sentry/nextjs` specific feature
*/
export const SENTRY_TUNNEL = (components = '') =>
SENTRY_ENABLE ? `/monitoring${components}` : undefined;
/**
* This configures which Sentry features to tree-shake/remove from the Sentry bundle
*
* @see https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/
*/
export const SENTRY_EXTENSIONS = {
__SENTRY_DEBUG__: false,
__SENTRY_TRACING__: false,
__RRWEB_EXCLUDE_IFRAME__: true,
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
};