feat(SPG-126) Monitoring APM

pull/2/head
ashar 2024-05-31 11:07:34 +07:00
parent 9ce4c58dc1
commit b945ef1e10
2 changed files with 14 additions and 6 deletions

View File

@ -15,6 +15,7 @@ import { CouchModule } from './modules/configuration/couch/couch.module';
@Module({ @Module({
imports: [ imports: [
ApmModule.register(),
ConfigModule.forRoot({ ConfigModule.forRoot({
isGlobal: true, isGlobal: true,
}), }),
@ -26,16 +27,14 @@ import { CouchModule } from './modules/configuration/couch/couch.module';
username: process.env.DEFAULT_DB_USER, username: process.env.DEFAULT_DB_USER,
password: process.env.DEFAULT_DB_PASS, password: process.env.DEFAULT_DB_PASS,
database: process.env.DEFAULT_DB_NAME, database: process.env.DEFAULT_DB_NAME,
entities: [ entities: [UserPrivilegeModel],
UserPrivilegeModel,
],
synchronize: true, synchronize: true,
}), }),
CqrsModule, CqrsModule,
SessionModule, SessionModule,
AuthModule, AuthModule,
CouchModule, CouchModule,
UserPrivilegeModule, UserPrivilegeModule,
], ],
controllers: [], controllers: [],

View File

@ -1,9 +1,18 @@
import { apm } from './core/apm';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common'; import { ValidationPipe } from '@nestjs/common';
import { DocumentBuilder, SwaggerCustomOptions, SwaggerModule } from '@nestjs/swagger'; import {
DocumentBuilder,
SwaggerCustomOptions,
SwaggerModule,
} from '@nestjs/swagger';
async function bootstrap() { async function bootstrap() {
if (apm.isStarted()) {
console.log('apm start');
}
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1');