Lingui now offers an option to disable stripping even in prod mode so we can bring it back
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import * as Sentry from '@sentry/nestjs';
|
|
import { nodeProfilingIntegration } from '@sentry/profiling-node';
|
|
|
|
import { NodeEnvironment } from 'src/engine/core-modules/environment/interfaces/node-environment.interface';
|
|
|
|
import { ExceptionHandlerDriver } from 'src/engine/core-modules/exception-handler/interfaces';
|
|
import { WorkspaceCacheKeys } from 'src/engine/workspace-cache-storage/workspace-cache-storage.service';
|
|
|
|
if (process.env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry) {
|
|
Sentry.init({
|
|
environment: process.env.SENTRY_ENVIRONMENT,
|
|
release: process.env.SENTRY_RELEASE,
|
|
dsn: process.env.SENTRY_DSN,
|
|
integrations: [
|
|
// TODO: Redis integration doesn't seem to work - investigate why
|
|
Sentry.redisIntegration({
|
|
cachePrefixes: Object.values(WorkspaceCacheKeys).map(
|
|
(key) => `engine:${key}:`,
|
|
),
|
|
}),
|
|
Sentry.httpIntegration(),
|
|
Sentry.expressIntegration(),
|
|
Sentry.graphqlIntegration(),
|
|
Sentry.postgresIntegration(),
|
|
nodeProfilingIntegration(),
|
|
],
|
|
tracesSampleRate: 0.1,
|
|
profilesSampleRate: 0.3,
|
|
debug: process.env.NODE_ENV === NodeEnvironment.development,
|
|
});
|
|
}
|