Skip to content

Commit

Permalink
feat: github actions 및 Sentry 설정 및 에러 추적 코드 추가
Browse files Browse the repository at this point in the history
* sentry.client.config.ts, sentry.edge.config.ts, sentry.server.config.ts: Sentry 설정 완료
* src/app/global-error.tsx: 글로벌 에러 발생 시 Sentry에 보고하도록 수정
* src/app/sentry-example-page/page.tsx: 예시 페이지에 Sentry 이벤트 발생 코드 추가

production 환경에서 발생하는 에러를 추적하고 분석하기 위해 Sentry를 설정했습니다.
  • Loading branch information
deipanema committed Oct 14, 2024
1 parent f16dd83 commit 88da9c0
Show file tree
Hide file tree
Showing 12 changed files with 2,846 additions and 116 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ yarn-error.log*
next-env.d.ts

#.vscode
.vscode
.vscode
# Sentry Config File
.env.sentry-build-plugin
59 changes: 49 additions & 10 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
import {withSentryConfig} from "@sentry/nextjs";
// next.config.mjs
export default {
async redirects() {
return [
{
source: "/board",
destination: "/",
permanent: true, // true일 경우 308 Permanent Redirect, false일 경우 307 Temporary Redirect
},
];
export default withSentryConfig({
async redirects() {
return [
{
source: "/board",
destination: "/",
permanent: true, // true일 경우 308 Permanent Redirect, false일 경우 307 Temporary Redirect
},
};
];
}
}, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: "codeit-qw",
project: "javascript-nextjs-3x",

// 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,
});
Loading

0 comments on commit 88da9c0

Please sign in to comment.