FIX: conditionally importing apm

This commit is contained in:
Gabriel Rosa
2022-07-07 18:18:53 -03:00
parent 9f009309cb
commit d288a4f357
2 changed files with 6 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
export const startAPm = async () => {
if (process.env.ENV !== 'local')
return await import('elastic-apm-node/start');
};
startAPm();
+1 -3
View File
@@ -1,6 +1,6 @@
import './apm';
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { writeFileSync } from 'fs';
import helmet from 'helmet';
import { DadosferaLogger } from 'dadosfera-logs';
@@ -9,8 +9,6 @@ import documentEmpty from '../swagger_empty.json';
import { AppModule } from './app.module';
async function bootstrap() {
if (process.env.ENV !== 'local') await import('elastic-apm-node/start');
DadosferaLogger.setupLogger({
serviceName: 'maestro',
serviceEnvironment: process.env.ENV,