fix: sentry init is using the wrong environment (#4940)

In the previous PR #4912 it seems that I forgot to pass the environment
on the backend.
Here is a quick fix!

I also added some "doc" in the the .env.example
This commit is contained in:
Quentin G
2024-04-12 12:27:35 +02:00
committed by GitHub
parent f47fe62742
commit a6b38d76ce
5 changed files with 9 additions and 3 deletions

View File

@ -235,7 +235,7 @@ export class EnvironmentVariables {
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,
)
@IsString()
SENTRY_DSN_FRONT: string;
SENTRY_FRONT_DSN: string;
@ValidateIf(
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,

View File

@ -14,6 +14,7 @@ export class ExceptionHandlerSentryDriver
{
constructor(options: ExceptionHandlerSentryDriverFactoryOptions['options']) {
Sentry.init({
environment: options.environment,
release: options.release,
dsn: options.dsn,
integrations: [
@ -25,7 +26,6 @@ export class ExceptionHandlerSentryDriver
],
tracesSampleRate: 0.1,
profilesSampleRate: 0.3,
environment: options.debug ? 'development' : 'production',
debug: options.debug,
});
}