feat(observability): add exception filter, logging interceptor, and CodeExecutorModule

- add HttpExceptionFilter logging BadRequestException at warn and InternalServerErrorException at error with cause chain
- add LoggingInterceptor logging request/response pairs at debug level with method, path, body, status, and duration
- extract CodeExecutorService into standalone CodeExecutorModule imported by BrowserModule and McpModule
- thread { cause: err } into all catch blocks across auth, browser, and code-executor services
This commit is contained in:
2026-04-07 13:49:02 +03:00
parent bf1b6249a9
commit 5ac26ecb3a
13 changed files with 168 additions and 19 deletions
+4
View File
@@ -3,6 +3,8 @@ import { ConfigService } from '@nestjs/config';
import { Logger, ValidationPipe } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { HttpExceptionFilter } from './filters/http-exception.filter';
import { LoggingInterceptor } from './interceptors/logging.interceptor';
import { name as pkgName, version as pkgVersion } from '../package.json';
async function bootstrap() {
@@ -10,6 +12,8 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe({ transform: true }));
app.useGlobalFilters(new HttpExceptionFilter());
app.useGlobalInterceptors(new LoggingInterceptor());
const config = app.get(ConfigService);
const port = config.get<number>('PORT', 3000);