feat(SPG-126) Monitoring APM
parent
9ce4c58dc1
commit
b945ef1e10
|
@ -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: [],
|
||||||
|
|
11
src/main.ts
11
src/main.ts
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue