Skip to content

Commit 867e3df

Browse files
authored
feat: 에러 추적을 위한 Sentry 연결 (#76)
* feat: 에러 추적을 위한 @sentry/react 의존성 추가 * feat: Sentry 연동 코드 추가 * feat: Workflow에 Sentry DSN 환경 변수 추가 * fix: Sentry DSN 환경 변수 이름 수정
1 parent 3696d9c commit 867e3df

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
VITE_API_URL: ${{ secrets.VITE_API_URL }}
3232
VITE_MIXPANEL_TOKEN: ${{ secrets.VITE_MIXPANEL_TOKEN }}
3333
VITE_CHANNEL_TALK_PLUGIN_KEY: ${{ secrets.VITE_CHANNEL_TALK_PLUGIN_KEY }}
34+
VITE_SENTRY_DSN: ${{secrets.VITE_SENTRY_DSN}}
3435

3536
- name: Configure AWS credentials
3637
uses: aws-actions/configure-aws-credentials@v4

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@channel.io/channel-web-sdk-loader": "^2.0.0",
1515
"@radix-ui/react-popover": "^1.1.5",
1616
"@radix-ui/react-toast": "^1.2.6",
17+
"@sentry/react": "^9.0.1",
1718
"@stackflow/core": "^1.1.1",
1819
"@stackflow/plugin-basic-ui": "^1.11.1",
1920
"@stackflow/plugin-history-sync": "^1.7.1",

pnpm-lock.yaml

+80
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { StrictMode } from 'react';
44
import { createRoot } from 'react-dom/client';
55
import App from './App';
66
import './index.css';
7+
import './utils/channelTalk';
8+
import './utils/mixpanel';
9+
import './utils/sentry';
710

811
const queryClient = new QueryClient();
912

src/utils/sentry.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as Sentry from '@sentry/react';
2+
3+
Sentry.init({
4+
dsn: import.meta.env.VITE_SENTRY_DSN,
5+
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
6+
// Tracing
7+
tracesSampleRate: 1.0, // Capture 100% of the transactions
8+
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
9+
tracePropagationTargets: [],
10+
// Session Replay
11+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
12+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
13+
});

0 commit comments

Comments
 (0)