Merged in fix/warmup-not-throwing (pull request #3179)
fix: warmup threw error * fix: warmup threw error * . Approved-by: Linus Flood
This commit is contained in:
21
apps/scandic-web/netlify/utils/initSentry.ts
Normal file
21
apps/scandic-web/netlify/utils/initSentry.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import Sentry from "@sentry/nextjs"
|
||||
|
||||
export const denyUrls: (string | RegExp)[] = [
|
||||
// Ignore preview urls
|
||||
/\/.{2}\/preview\//,
|
||||
]
|
||||
|
||||
export const onRequestError = Sentry.captureRequestError
|
||||
|
||||
export async function configureSentry() {
|
||||
const sentryEnvironment = Netlify.env.get("SENTRY_ENVIRONMENT")
|
||||
const sampleRate = Number(Netlify.env.get("SENTRY_SERVER_SAMPLERATE") ?? 0.01)
|
||||
Sentry.init({
|
||||
dsn: "https://fe39c070b4154e2f9cc35f0e5de0aedb@o4508102497206272.ingest.de.sentry.io/4508102500286544",
|
||||
environment: sentryEnvironment,
|
||||
enabled: sentryEnvironment !== "development",
|
||||
tracesSampleRate: sampleRate,
|
||||
denyUrls: denyUrls,
|
||||
enableLogs: true,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user