2023-03-18 02:34:07 +00:00
|
|
|
import * as Sentry from "@sentry/nextjs"
|
2023-02-05 12:42:32 +00:00
|
|
|
|
|
|
|
// Importing @sentry/tracing patches the global hub for tracing to work.
|
|
|
|
import "@sentry/tracing"
|
2019-06-03 11:12:23 +00:00
|
|
|
|
2019-06-27 01:06:26 +00:00
|
|
|
if (process.env.SENTRY_DSN) {
|
2023-02-05 12:42:32 +00:00
|
|
|
|
|
|
|
const { NOW_GITHUB_COMMIT_REF, NOW_GITHUB_COMMIT_SHA } = process.env
|
|
|
|
|
2019-06-03 11:12:23 +00:00
|
|
|
Sentry.init({
|
2019-06-27 01:06:26 +00:00
|
|
|
dsn: process.env.SENTRY_DSN,
|
2023-02-05 12:42:32 +00:00
|
|
|
tracesSampleRate: 1.0,
|
|
|
|
release: `${NOW_GITHUB_COMMIT_REF || '-'}@${NOW_GITHUB_COMMIT_SHA || '-'}`
|
2019-06-03 11:12:23 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Sentry
|