-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nextjs): Remove
client.(server|client).config.ts
functionality…
… in favor of `instrumentation.ts` (#11059)
- Loading branch information
Showing
26 changed files
with
287 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dev-packages/e2e-tests/test-applications/create-next-app/instrumentation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
declare global { | ||
namespace globalThis { | ||
var transactionIds: string[]; | ||
} | ||
} | ||
|
||
export function register() { | ||
if (process.env.NEXT_RUNTIME === 'nodejs') { | ||
Sentry.init({ | ||
environment: 'qa', // dynamic sampling bias to keep transactions | ||
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, | ||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 1.0, | ||
integrations: [Sentry.localVariablesIntegration()], | ||
}); | ||
|
||
Sentry.addEventProcessor(event => { | ||
global.transactionIds = global.transactionIds || []; | ||
|
||
if (event.type === 'transaction') { | ||
const eventId = event.event_id; | ||
|
||
if (eventId) { | ||
global.transactionIds.push(eventId); | ||
} | ||
} | ||
|
||
return event; | ||
}); | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
dev-packages/e2e-tests/test-applications/create-next-app/sentry.server.config.ts
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
export function register() { | ||
if (process.env.NEXT_RUNTIME === 'nodejs' || process.env.NEXT_RUNTIME === 'edge') { | ||
Sentry.init({ | ||
environment: 'qa', // dynamic sampling bias to keep transactions | ||
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, | ||
tunnel: `http://localhost:3031/`, // proxy server | ||
tracesSampleRate: 1.0, | ||
sendDefaultPii: true, | ||
}); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
dev-packages/e2e-tests/test-applications/nextjs-14/sentry.edge.config.ts
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
dev-packages/e2e-tests/test-applications/nextjs-14/sentry.server.config.ts
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
export function register() { | ||
if (process.env.NEXT_RUNTIME === 'nodejs' || process.env.NEXT_RUNTIME === 'edge') { | ||
Sentry.init({ | ||
environment: 'qa', // dynamic sampling bias to keep transactions | ||
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN, | ||
tunnel: `http://localhost:3031/`, // proxy server | ||
tracesSampleRate: 1.0, | ||
sendDefaultPii: true, | ||
}); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
dev-packages/e2e-tests/test-applications/nextjs-app-dir/sentry.edge.config.ts
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
dev-packages/e2e-tests/test-applications/nextjs-app-dir/sentry.server.config.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.