-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from SaekKkanDa/feature/169
feature: sentry, nextjs로 변경
- Loading branch information
Showing
10 changed files
with
432 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,6 @@ dist-ssr | |
*.sw? | ||
*.env | ||
|
||
*.cache | ||
*.cache | ||
# Sentry Auth Token | ||
.sentryclirc |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { withSentryConfig } from '@sentry/nextjs'; | ||
|
||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
compiler: { | ||
styledComponents: true, | ||
}, | ||
// HJ TODO: 학습 필요 | ||
sentry: { | ||
autoInstrumentServerFunctions: false, | ||
}, | ||
}; | ||
|
||
/** | ||
* @type {import('@sentry/nextjs/types/config/types').SentryWebpackPluginOptions}> | ||
*/ | ||
const sentryWebpackPluginOptions = { | ||
// For all available options, see: | ||
// https://github.com/getsentry/sentry-webpack-plugin#options | ||
|
||
// Suppresses source map uploading logs during build | ||
silent: true, | ||
|
||
org: 'saekkkanda-m0', | ||
project: 'omct-next', | ||
}; | ||
|
||
/** | ||
* @type {import('@sentry/nextjs/types/config/types').UserSentryOptions}> | ||
*/ | ||
const sentryOptions = { | ||
// 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, | ||
|
||
// Transpiles SDK to be compatible with IE11 (increases bundle size) | ||
transpileClientSDK: true, | ||
|
||
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load) | ||
tunnelRoute: '/monitoring', | ||
|
||
// Hides source maps from generated client bundles | ||
hideSourceMaps: true, | ||
|
||
// Automatically tree-shake Sentry logger statements to reduce bundle size | ||
disableLogger: true, | ||
}; | ||
|
||
export default withSentryConfig( | ||
nextConfig, | ||
sentryWebpackPluginOptions, | ||
sentryOptions | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file configures the initialization of Sentry on the client. | ||
// The config you add here will be used whenever a users loads a page in their browser. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://9a3b5d02657d4031b2f5f2c1b33f0e44@o4504803405332480.ingest.sentry.io/4505216542572544', | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
|
||
replaysOnErrorSampleRate: 1.0, | ||
|
||
// This sets the sample rate to be 10%. You may want this to be 100% while | ||
// in development and sample at a lower rate in production | ||
replaysSessionSampleRate: 0.1, | ||
|
||
// You can remove this option if you're not planning to use the Sentry Session Replay feature: | ||
integrations: [ | ||
new Sentry.Replay({ | ||
// Additional Replay configuration goes in here, for example: | ||
maskAllText: true, | ||
blockAllMedia: true, | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). | ||
// The config you add here will be used whenever one of the edge features is loaded. | ||
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
Sentry.init({ | ||
dsn: "https://9a3b5d02657d4031b2f5f2c1b33f0e44@o4504803405332480.ingest.sentry.io/4505216542572544", | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This file configures the initialization of Sentry on the server. | ||
// The config you add here will be used whenever the server handles a request. | ||
// https://docs.sentry.io/platforms/javascript/guides/nextjs/ | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
Sentry.init({ | ||
dsn: "https://9a3b5d02657d4031b2f5f2c1b33f0e44@o4504803405332480.ingest.sentry.io/4505216542572544", | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 1, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.