Skip to content

Commit

Permalink
fix nest test
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Aug 12, 2024
1 parent 96db2ad commit 4b9bfa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sentry.init({
});

import { Controller, Get, Injectable, Module } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { BaseExceptionFilter, HttpAdapterHost, NestFactory } from '@nestjs/core';

const port = 3450;

Expand Down Expand Up @@ -48,6 +48,9 @@ class AppModule {}
async function run(): Promise<void> {
const app = await NestFactory.create(AppModule);
await app.listen(port);

const { httpAdapter } = app.get(HttpAdapterHost);
Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));
sendPortToRunner(port);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ conditionalTest({ min: 16 })('nestjs auto instrumentation', () => {
'nestjs.callback': 'getHello',
'nestjs.controller': 'AppController',
'nestjs.type': 'request_context',
'sentry.op': 'http',
'sentry.op': 'request_context.nestjs',
'sentry.origin': 'auto.http.otel.nestjs',
component: '@nestjs/core',
'http.method': 'GET',
'http.route': '/',
'http.url': '/',
}),
}),
]),
Expand Down

0 comments on commit 4b9bfa0

Please sign in to comment.