feat: add sentry only after app module
This commit is contained in:
parent
0eed2571fe
commit
3127dd1b6f
|
|
@ -1,6 +1,3 @@
|
|||
// import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
// initializeSentry('backend', true);
|
||||
|
||||
import { loadSwagger } from '@gitroom/helpers/swagger/load.swagger';
|
||||
|
||||
process.env.TZ = 'UTC';
|
||||
|
|
@ -9,6 +6,10 @@ import cookieParser from 'cookie-parser';
|
|||
import { Logger, ValidationPipe } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
initializeSentry('backend', true);
|
||||
|
||||
import { SubscriptionExceptionFilter } from '@gitroom/backend/services/auth/permissions/subscription.exception';
|
||||
import { HttpExceptionFilter } from '@gitroom/nestjs-libraries/services/exception.filter';
|
||||
import { ConfigurationChecker } from '@gitroom/helpers/configuration/configuration.checker';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
// initializeSentry('cron');
|
||||
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { CronModule } from './cron.module';
|
||||
|
||||
import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
initializeSentry('cron');
|
||||
|
||||
async function bootstrap() {
|
||||
// some comment again
|
||||
await NestFactory.createApplicationContext(CronModule);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
// initializeSentry('workers');
|
||||
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
|
||||
import { MicroserviceOptions } from '@nestjs/microservices';
|
||||
import { BullMqServer } from '@gitroom/nestjs-libraries/bull-mq-transport-new/strategy';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { initializeSentry } from '@gitroom/nestjs-libraries/sentry/initialize.sentry';
|
||||
initializeSentry('workers');
|
||||
|
||||
async function bootstrap() {
|
||||
process.env.IS_WORKER = 'true';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const OpenAI = require('openai').default;
|
||||
import OpenAI from 'openai';
|
||||
import { shuffle } from 'lodash';
|
||||
import { zodResponseFormat } from 'openai/helpers/zod';
|
||||
import { z } from 'zod';
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ export const initializeSentry = (appName: string, allowLogs = false) => {
|
|||
integrations: [
|
||||
// Add our Profiling integration
|
||||
nodeProfilingIntegration(),
|
||||
...allowLogs ? [Sentry.consoleLoggingIntegration({ levels: ['log', 'error', 'warn'] })] : [],
|
||||
Sentry.consoleLoggingIntegration({ levels: ['log', 'error', 'warn'] }),
|
||||
],
|
||||
tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.3,
|
||||
enableLogs: allowLogs,
|
||||
enableLogs: true,
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
|
|
|||
Loading…
Reference in New Issue