Skip to content

feat(web): Sentry 에러 모니터링 연동#42

Merged
bbbang105 merged 1 commit intodevfrom
feat/sentry-web-integration
Mar 13, 2026
Merged

feat(web): Sentry 에러 모니터링 연동#42
bbbang105 merged 1 commit intodevfrom
feat/sentry-web-integration

Conversation

@bbbang105
Copy link
Copy Markdown
Owner

Summary

  • Sentry SDK(@sentry/nextjs) 연동으로 웹 에러 실시간 모니터링 구축
  • 에러 바운더리 3곳(user/admin/global) Sentry 전송 + Discord 알림 파이프라인 완성
  • 4개 리뷰(코드/보안/웹디자인/React 베스트프랙티스) P0~P1 전수 해결

Changes

파일 변경 내용
sentry.client.config.ts 클라이언트 SDK 초기화 (DSN 가드, PII 스크러빙, breadcrumb 필터)
sentry.server.config.ts 서버 SDK 초기화 (sendDefaultPii: false)
sentry.edge.config.ts Edge SDK 초기화
instrumentation.ts Next.js instrumentation hook + onRequestError
next.config.js → next.config.ts ESM 변환 + withSentryConfig 래핑
global-error.tsx 전역 에러 바운더리 (다크모드 인라인 스타일, 접근성)
(user)/error.tsx Sentry.captureException() 추가
(admin)/error.tsx Sentry.captureException() 추가
.env.example SENTRY DSN/AUTH_TOKEN 항목 추가
CLAUDE.md 기술 스택, 핵심 파일, 환경 변수 섹션 최신화
ARCHITECTURE.md Sentry 모니터링 노드 + 에러 처리 테이블 업데이트

Design Decisions

결정 이유
tunnelRoute: '/api/_sentry-tunnel' ad-blocker 우회 + 추측 어려운 경로명 (보안 리뷰 P1 반영)
beforeSend PII 스크러빙 cookies, query_string 필터링으로 GDPR 대응 (보안 리뷰 P1)
DSN 가드 (if (!dsn) return) CI/로컬에서 DSN 없을 때 불필요한 Sentry 경고 방지
environment: VERCEL_ENV production/preview/development 환경 분리
next.config.ts ESM 변환 require() lint 에러 해결
CSP 도메인 축소 *.sentry.io → 특정 ingest 도메인만 허용 (보안 리뷰 P1)

Test Plan

  • pnpm lint — 에러 0
  • pnpm --filter web typecheck — 통과
  • pnpm --filter web build — 성공
  • Vercel 배포 후 Sentry 대시보드에서 이벤트 수신 확인
  • /sentry-example-page 또는 의도적 에러로 캡처 테스트

🤖 Generated with Claude Code

@bbbang105 bbbang105 requested a review from choihooo as a code owner March 13, 2026 06:11
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
study-admin-web Ready Ready Preview, Comment Mar 13, 2026 6:15am

@bbbang105 bbbang105 added the 🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정 label Mar 13, 2026
- @sentry/nextjs SDK 추가 (클라이언트/서버/엣지 초기화)
- DSN 가드, beforeSend PII 스크러빙, environment 태깅
- 에러 바운더리 3곳 Sentry.captureException() 연동
- next.config.js → next.config.ts 변환 + withSentryConfig 래핑
- tunnelRoute(/api/_sentry-tunnel)로 ad-blocker 우회
- CSP connect-src에 Sentry ingest 도메인 추가
- CLAUDE.md, ARCHITECTURE.md 최신화

Co-Authored-By: Claude <noreply@anthropic.com>
@bbbang105 bbbang105 force-pushed the feat/sentry-web-integration branch from 393112c to e7269c0 Compare March 13, 2026 06:14
@bbbang105 bbbang105 merged commit 3a719a3 into dev Mar 13, 2026
7 checks passed
@bbbang105 bbbang105 deleted the feat/sentry-web-integration branch March 13, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant