feat: Sentry enabled only at production

This commit is contained in:
wonderlandpark 2021-05-06 10:47:33 +09:00
parent df52c91d0f
commit 2fec571c77
No known key found for this signature in database
GPG Key ID: E3E650B146478C64
3 changed files with 5 additions and 16 deletions

View File

@ -1,17 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const {
NEXT_PUBLIC_SENTRY_DSN: SENTRY_DSN,
SENTRY_ORG,
SENTRY_PROJECT,
SENTRY_AUTH_TOKEN,
SENTRY_RELEASE,
SOURCE_COMMIT,
SOURCE_BRANCH,
NODE_ENV
} = process.env
// const { withSentryConfig } = require('@sentry/nextjs')
const VERSION = require('./package.json').version
const basePath = ''
module.exports = {
env: {
@ -22,7 +12,5 @@ module.exports = {
},
experimental: {
scrollRestoration: true
},
basePath,
externalResolver: true
}
}

View File

@ -35,7 +35,8 @@ Router.events.on('routeChangeError', NProgress.done)
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0
tracesSampleRate: 1.0,
enabled: process.env.NODE_ENV === 'production'
})
const KoreanbotsApp = ({ Component, pageProps, err, cookie }: KoreanbotsProps): JSX.Element => {

View File

@ -13,7 +13,7 @@ Sentry.init({
new Sentry.Integrations.Http({ tracing: true })
],
tracesSampleRate: 1.0,
enabled: true
enabled: process.env.NODE_ENV === 'production'
})
const limiter = rateLimit({