Skip to content

Commit 5f7549a

Browse files
author
Luca Forstner
authored
feat(node): Deprecate nestIntegration and setupNestErrorHandler in favor of using @sentry/nestjs (#14374)
1 parent e35dc22 commit 5f7549a

File tree

16 files changed

+53
-11
lines changed

16 files changed

+53
-11
lines changed

dev-packages/node-integration-tests/suites/tracing/nestjs-errors-no-express/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class AppModule {}
4848
async function run(): Promise<void> {
4949
const app = await NestFactory.create(AppModule);
5050
const { httpAdapter } = app.get(HttpAdapterHost);
51+
// eslint-disable-next-line deprecation/deprecation
5152
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
5253
await app.listen(port);
5354
sendPortToRunner(port);

dev-packages/node-integration-tests/suites/tracing/nestjs-errors/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class AppModule {}
4646
async function run(): Promise<void> {
4747
const app = await NestFactory.create(AppModule);
4848
const { httpAdapter } = app.get(HttpAdapterHost);
49+
// eslint-disable-next-line deprecation/deprecation
4950
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
5051
await app.listen(port);
5152
sendPortToRunner(port);

dev-packages/node-integration-tests/suites/tracing/nestjs-no-express/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class AppModule {}
4848
async function run(): Promise<void> {
4949
const app = await NestFactory.create(AppModule);
5050
const { httpAdapter } = app.get(HttpAdapterHost);
51+
// eslint-disable-next-line deprecation/deprecation
5152
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
5253
await app.listen(port);
5354
sendPortToRunner(port);

dev-packages/node-integration-tests/suites/tracing/nestjs/scenario.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ async function run(): Promise<void> {
4848
await app.listen(port);
4949

5050
const { httpAdapter } = app.get(HttpAdapterHost);
51+
// eslint-disable-next-line deprecation/deprecation
5152
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
5253
sendPortToRunner(port);
5354
}

docs/migration/draft-v9-migration-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@
3737
## Server-side SDKs (`@sentry/node` and all dependents)
3838

3939
- Deprecated `processThreadBreadcrumbIntegration` in favor of `childProcessIntegration`. Functionally they are the same.
40+
- Deprecated `nestIntegration`. Use the NestJS SDK (`@sentry/nestjs`) instead.
41+
- Deprecated `setupNestErrorHandler`. Use the NestJS SDK (`@sentry/nestjs`) instead.

packages/astro/src/index.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export {
8484
mysql2Integration,
8585
mysqlIntegration,
8686
nativeNodeFetchIntegration,
87+
// eslint-disable-next-line deprecation/deprecation
8788
nestIntegration,
8889
NodeClient,
8990
nodeContextIntegration,
@@ -118,6 +119,7 @@ export {
118119
setupExpressErrorHandler,
119120
setupHapiErrorHandler,
120121
setupKoaErrorHandler,
122+
// eslint-disable-next-line deprecation/deprecation
121123
setupNestErrorHandler,
122124
setUser,
123125
spanToBaggageHeader,

packages/aws-serverless/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export {
101101
mysql2Integration,
102102
redisIntegration,
103103
tediousIntegration,
104+
// eslint-disable-next-line deprecation/deprecation
104105
nestIntegration,
106+
// eslint-disable-next-line deprecation/deprecation
105107
setupNestErrorHandler,
106108
postgresIntegration,
107109
prismaIntegration,

packages/bun/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ export {
124124
mysql2Integration,
125125
redisIntegration,
126126
tediousIntegration,
127+
// eslint-disable-next-line deprecation/deprecation
127128
nestIntegration,
129+
// eslint-disable-next-line deprecation/deprecation
128130
setupNestErrorHandler,
129131
postgresIntegration,
130132
prismaIntegration,

packages/google-cloud-serverless/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export {
101101
mysql2Integration,
102102
redisIntegration,
103103
tediousIntegration,
104+
// eslint-disable-next-line deprecation/deprecation
104105
nestIntegration,
106+
// eslint-disable-next-line deprecation/deprecation
105107
setupNestErrorHandler,
106108
postgresIntegration,
107109
prismaIntegration,

packages/nestjs/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
import { nestIntegration as nestIntegrationAlias } from '@sentry/node';
2+
13
export * from '@sentry/node';
24

5+
/**
6+
* Integration capturing tracing data for NestJS.
7+
*/
8+
// eslint-disable-next-line deprecation/deprecation
9+
export const nestIntegration = nestIntegrationAlias;
10+
11+
// TODO(v9): Export custom `getDefaultIntegrations` from this SDK that automatically registers the `nestIntegration`.
12+
313
export { init } from './sdk';
414

515
export {

0 commit comments

Comments
 (0)