mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-29 15:25:45 +03:00
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:
parent
f47fe62742
commit
a6b38d76ce
@ -152,7 +152,10 @@ import TabItem from '@theme/TabItem';
|
|||||||
['LOGGER_IS_BUFFER_ENABLED', 'true', 'Buffer the logs before sending them to the logging driver'],
|
['LOGGER_IS_BUFFER_ENABLED', 'true', 'Buffer the logs before sending them to the logging driver'],
|
||||||
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
||||||
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
||||||
|
['SENTRY_ENVIRONMENT', 'main', 'The sentry environment used if sentry logging driver is selected'],
|
||||||
|
['SENTRY_RELEASE', 'latest', 'The sentry release used if sentry logging driver is selected'],
|
||||||
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
||||||
|
['SENTRY_FRONT_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used by the frontend if sentry logging driver is selected'],
|
||||||
]}></OptionTable>
|
]}></OptionTable>
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,10 @@ SIGN_IN_PREFILLED=true
|
|||||||
# LOGGER_DRIVER=console
|
# LOGGER_DRIVER=console
|
||||||
# LOGGER_IS_BUFFER_ENABLED=true
|
# LOGGER_IS_BUFFER_ENABLED=true
|
||||||
# EXCEPTION_HANDLER_DRIVER=sentry
|
# EXCEPTION_HANDLER_DRIVER=sentry
|
||||||
|
# SENTRY_ENVIRONMENT=main
|
||||||
|
# SENTRY_RELEASE=latest
|
||||||
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
||||||
|
# SENTRY_FRONT_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
||||||
# LOG_LEVELS=error,warn
|
# LOG_LEVELS=error,warn
|
||||||
# MESSAGE_QUEUE_TYPE=pg-boss
|
# MESSAGE_QUEUE_TYPE=pg-boss
|
||||||
# REDIS_HOST=127.0.0.1
|
# REDIS_HOST=127.0.0.1
|
||||||
|
@ -41,7 +41,7 @@ export class ClientConfigResolver {
|
|||||||
sentry: {
|
sentry: {
|
||||||
environment: this.environmentService.get('SENTRY_ENVIRONMENT'),
|
environment: this.environmentService.get('SENTRY_ENVIRONMENT'),
|
||||||
release: this.environmentService.get('SENTRY_RELEASE'),
|
release: this.environmentService.get('SENTRY_RELEASE'),
|
||||||
dsn: this.environmentService.get('SENTRY_DSN_FRONT'),
|
dsn: this.environmentService.get('SENTRY_FRONT_DSN'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ export class EnvironmentVariables {
|
|||||||
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,
|
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,
|
||||||
)
|
)
|
||||||
@IsString()
|
@IsString()
|
||||||
SENTRY_DSN_FRONT: string;
|
SENTRY_FRONT_DSN: string;
|
||||||
|
|
||||||
@ValidateIf(
|
@ValidateIf(
|
||||||
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,
|
(env) => env.EXCEPTION_HANDLER_DRIVER === ExceptionHandlerDriver.Sentry,
|
||||||
|
@ -14,6 +14,7 @@ export class ExceptionHandlerSentryDriver
|
|||||||
{
|
{
|
||||||
constructor(options: ExceptionHandlerSentryDriverFactoryOptions['options']) {
|
constructor(options: ExceptionHandlerSentryDriverFactoryOptions['options']) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
|
environment: options.environment,
|
||||||
release: options.release,
|
release: options.release,
|
||||||
dsn: options.dsn,
|
dsn: options.dsn,
|
||||||
integrations: [
|
integrations: [
|
||||||
@ -25,7 +26,6 @@ export class ExceptionHandlerSentryDriver
|
|||||||
],
|
],
|
||||||
tracesSampleRate: 0.1,
|
tracesSampleRate: 0.1,
|
||||||
profilesSampleRate: 0.3,
|
profilesSampleRate: 0.3,
|
||||||
environment: options.debug ? 'development' : 'production',
|
|
||||||
debug: options.debug,
|
debug: options.debug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user