Skip to content

Commit

Permalink
feat: add sentry (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
KagamiChan authored Oct 12, 2024
1 parent ee24180 commit 4150a38
Show file tree
Hide file tree
Showing 9 changed files with 1,977 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/

# Sentry Config File
.env.sentry-build-plugin
44 changes: 43 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import { withSentryConfig } from '@sentry/nextjs'

await import('./src/env.js')

/** @type {import("next").NextConfig} */
Expand All @@ -29,4 +31,44 @@ const config = {
},
}

export default config
// Injected content via Sentry wizard below

export default withSentryConfig(config, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: 'poi',
project: 'poi-web-kai',

// Only print logs for uploading source maps in CI
silent: !process.env.CI,

// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},

// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: '/monitoring',

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@sentry/nextjs": "^8.34.0",
"@t3-oss/env-nextjs": "^0.11.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
Loading

0 comments on commit 4150a38

Please sign in to comment.