From b945ef1e10b583041afd5d26457dcc2136b00a94 Mon Sep 17 00:00:00 2001 From: ashar Date: Fri, 31 May 2024 11:07:34 +0700 Subject: [PATCH] feat(SPG-126) Monitoring APM --- src/app.module.ts | 9 ++++----- src/main.ts | 11 ++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app.module.ts b/src/app.module.ts index 2c8fa5f..5d12b5b 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -15,6 +15,7 @@ import { CouchModule } from './modules/configuration/couch/couch.module'; @Module({ imports: [ + ApmModule.register(), ConfigModule.forRoot({ isGlobal: true, }), @@ -26,16 +27,14 @@ import { CouchModule } from './modules/configuration/couch/couch.module'; username: process.env.DEFAULT_DB_USER, password: process.env.DEFAULT_DB_PASS, database: process.env.DEFAULT_DB_NAME, - entities: [ - UserPrivilegeModel, - ], + entities: [UserPrivilegeModel], synchronize: true, }), CqrsModule, - SessionModule, + SessionModule, AuthModule, CouchModule, - + UserPrivilegeModule, ], controllers: [], diff --git a/src/main.ts b/src/main.ts index 193843f..c867b6c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,18 @@ +import { apm } from './core/apm'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { ValidationPipe } from '@nestjs/common'; -import { DocumentBuilder, SwaggerCustomOptions, SwaggerModule } from '@nestjs/swagger'; +import { + DocumentBuilder, + SwaggerCustomOptions, + SwaggerModule, +} from '@nestjs/swagger'; async function bootstrap() { + if (apm.isStarted()) { + console.log('apm start'); + } + const app = await NestFactory.create(AppModule); app.setGlobalPrefix('api/v1');