Skip to content

Commit 1390457

Browse files
committed
fix nest test
1 parent 63bb45f commit 1390457

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Sentry.init({
1313
});
1414

1515
import { Controller, Get, Injectable, Module } from '@nestjs/common';
16-
import { NestFactory } from '@nestjs/core';
16+
import { BaseExceptionFilter, HttpAdapterHost, NestFactory } from '@nestjs/core';
1717

1818
const port = 3450;
1919

@@ -48,6 +48,9 @@ class AppModule {}
4848
async function run(): Promise<void> {
4949
const app = await NestFactory.create(AppModule);
5050
await app.listen(port);
51+
52+
const { httpAdapter } = app.get(HttpAdapterHost);
53+
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
5154
sendPortToRunner(port);
5255
}
5356

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ conditionalTest({ min: 16 })('nestjs auto instrumentation', () => {
2525
'nestjs.callback': 'getHello',
2626
'nestjs.controller': 'AppController',
2727
'nestjs.type': 'request_context',
28-
'sentry.op': 'http',
28+
'sentry.op': 'request_context.nestjs',
29+
'sentry.origin': 'auto.http.otel.nestjs',
30+
component: '@nestjs/core',
31+
'http.method': 'GET',
32+
'http.route': '/',
33+
'http.url': '/',
2934
}),
3035
}),
3136
]),

0 commit comments

Comments
 (0)