FIX: conditionally importing apm

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