From 8a6270cf9d9b7be5a419fbb489b012772dabaa0e Mon Sep 17 00:00:00 2001 From: chrisweb Date: Thu, 15 Aug 2024 22:13:07 +0200 Subject: [PATCH] sentry files update --- instrumentation.ts | 32 +++----------------------------- sentry.client.config.ts | 2 +- sentry.edge.config.ts | 16 ++++++++++++++++ sentry.server.config.ts | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 sentry.edge.config.ts create mode 100644 sentry.server.config.ts diff --git a/instrumentation.ts b/instrumentation.ts index c83fe57b..d0bbdc0d 100644 --- a/instrumentation.ts +++ b/instrumentation.ts @@ -1,35 +1,9 @@ -import * as Sentry from '@sentry/nextjs' - -export function register() { +export async function register() { if (process.env.NEXT_RUNTIME === 'nodejs') { - Sentry.init({ - dsn: 'https://daf0befe66519725bbe2ad707a11bbb3@o4504017992482816.ingest.us.sentry.io/4506763918770176', - - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, - - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, - - // Uncomment the line below to enable Spotlight (https://spotlightjs.com) - // spotlight: process.env.NODE_ENV === 'development', - - environment: process.env.NODE_ENV ? process.env.NODE_ENV : '', - - }) + await import('./sentry.server.config') } if (process.env.NEXT_RUNTIME === 'edge') { - Sentry.init({ - dsn: 'https://daf0befe66519725bbe2ad707a11bbb3@o4504017992482816.ingest.us.sentry.io/4506763918770176', - - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, - - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, - - environment: process.env.NODE_ENV ? process.env.NODE_ENV : '', - }) + await import('./sentry.edge.config') } } diff --git a/sentry.client.config.ts b/sentry.client.config.ts index e46a6bfa..9d7e7f18 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -16,7 +16,7 @@ if (process.env.NODE_ENV === 'development') { } Sentry.init({ - dsn: 'https://daf0befe66519725bbe2ad707a11bbb3@o4504017992482816.ingest.us.sentry.io/4506763918770176', + dsn: 'https://o4504017992482816.ingest.us.sentry.io/api/4506763918770176/security/?sentry_key=daf0befe66519725bbe2ad707a11bbb3', // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: tracesSampleRate, diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts new file mode 100644 index 00000000..006736bd --- /dev/null +++ b/sentry.edge.config.ts @@ -0,0 +1,16 @@ +// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). +// The config you add here will be used whenever one of the edge features is loaded. +// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import * as Sentry from '@sentry/nextjs' + +Sentry.init({ + dsn: 'https://o4504017992482816.ingest.us.sentry.io/api/4506763918770176/security/?sentry_key=daf0befe66519725bbe2ad707a11bbb3', + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, +}) diff --git a/sentry.server.config.ts b/sentry.server.config.ts new file mode 100644 index 00000000..c3387a94 --- /dev/null +++ b/sentry.server.config.ts @@ -0,0 +1,19 @@ +// This file configures the initialization of Sentry on the server. +// The config you add here will be used whenever the server handles a request. +// https://docs.sentry.io/platforms/javascript/guides/nextjs/ + +import * as Sentry from '@sentry/nextjs' + +Sentry.init({ + dsn: 'https://o4504017992482816.ingest.us.sentry.io/api/4506763918770176/security/?sentry_key=daf0befe66519725bbe2ad707a11bbb3', + + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, + + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, + + // Uncomment the line below to enable Spotlight (https://spotlightjs.com) + // spotlight: process.env.NODE_ENV === 'development', + +})