Skip to content

Comments

[feature] 사용자 에러 추적을 위한 Sentry 적용#404

Merged
seongwon030 merged 4 commits intodevelop-fefrom
feature/#402-add-sentry-FE-113
May 14, 2025
Merged

[feature] 사용자 에러 추적을 위한 Sentry 적용#404
seongwon030 merged 4 commits intodevelop-fefrom
feature/#402-add-sentry-FE-113

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented May 14, 2025

#️⃣연관된 이슈

ex) #402

📝작업 내용

Sentry.init({
  dsn: process.env.SENTRY_DSN, //  Sentry 서버와 연결할 수 있는 프로젝트 식별자
  sendDefaultPii: true, // 개인정보 수집 여부
  release: process.env.SENTRY_RELEASE,
  tracesSampleRate: 0.1, // 성능 모니터링 샘플링 비율 
});
  • tracesSampleRate를 1로 설정하면 모든 사용자 액션을 추가하기 때문에 성능 부하를 줄이기 위해 0.1로 설정

에러 로그

스크린샷 2025-05-14 13 37 40

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • 신규 기능

    • 프론트엔드 애플리케이션에 Sentry 오류 추적 기능이 추가되었습니다.
  • 작업

    • Sentry 관련 환경설정 파일이 버전 관리에서 제외되도록 .gitignore가 업데이트되었습니다.
    • Sentry React SDK 및 Webpack 플러그인이 프로젝트 의존성에 추가되었습니다.

@seongwon030 seongwon030 requested a review from oesnuj May 14, 2025 04:40
@seongwon030 seongwon030 self-assigned this May 14, 2025
@seongwon030 seongwon030 added ✨ Feature 기능 개발 💻 FE Frontend labels May 14, 2025
@netlify
Copy link

netlify bot commented May 14, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 58b46db
🔍 Latest deploy log https://app.netlify.com/sites/moadong/deploys/68241ed50a72f70008a8cbbb
😎 Deploy Preview https://deploy-preview-404--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 45
Accessibility: 87
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 14, 2025

Walkthrough

프론트엔드 프로젝트에 Sentry 오류 추적 기능이 도입되었습니다. Sentry 관련 패키지들이 추가되고, 환경설정 파일이 git에서 제외되며, 애플리케이션 진입점에서 Sentry가 초기화됩니다.

Changes

파일/경로 변경 요약
frontend/.gitignore .env.sentry-build-plugin 파일을 git에서 제외하도록 항목 추가
frontend/package.json @sentry/react@sentry/webpack-plugin 패키지 의존성 추가
frontend/src/index.tsx Sentry를 환경변수 기반으로 초기화하는 코드 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReactApp
    participant Sentry

    User->>ReactApp: 앱 접속 및 실행
    ReactApp->>Sentry: Sentry.init(환경변수 기반 설정)
    ReactApp->>User: UI 렌더링
    Note over ReactApp,Sentry: 오류 발생 시 Sentry로 전송
Loading

Assessment against linked issues

Objective Addressed Explanation
Sentry를 통한 사용자 에러 추적 기능 적용 (FE-113)

Possibly related issues

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 831790a and 58b46db.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • frontend/.gitignore (1 hunks)
  • frontend/package.json (1 hunks)
  • frontend/src/index.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - moadong
  • GitHub Check: Header rules - moadong
  • GitHub Check: Pages changed - moadong
🔇 Additional comments (4)
frontend/package.json (1)

24-25: Sentry 의존성이 올바르게 추가되었습니다.

Sentry 기능 구현에 필요한 패키지들이 올바르게 추가되었습니다:

  • @sentry/react: React 애플리케이션 내 오류 추적을 위한 Sentry SDK
  • @sentry/webpack-plugin: 소스맵 업로드와 릴리스 관리를 위한 빌드 타임 통합 플러그인

이 의존성들은 에러 추적 시스템 구축에 필수적이며 적절한 버전으로 설치되었습니다.

frontend/src/index.tsx (2)

6-6: Sentry 모듈이 올바르게 임포트되었습니다.

Sentry React SDK가 적절하게 임포트되었습니다.


26-31: Sentry 구성 설정에 불일치가 있습니다.

Sentry 초기화가 올바르게 구현되었지만, PR 목표와 실제 구현 사이에 차이점이 있습니다:

  • PR 목표에서는 sendDefaultPii가 활성화된다고 명시되었지만, 코드에서는 false로 설정되어 있습니다.
  • 현재 구성에서는 개인 식별 정보가 수집되지 않습니다.

PII 수집이 필요한 경우 sendDefaultPii: true로 변경하세요.

 Sentry.init({
   dsn: process.env.SENTRY_DSN,
-  sendDefaultPii: false,
+  sendDefaultPii: true,
   release: process.env.SENTRY_RELEASE,
   tracesSampleRate: 0.1,
 });
frontend/.gitignore (1)

19-21: 적절한 파일이 .gitignore에 추가되었습니다.

두 가지 중요한 항목이 버전 관리에서 제외되었습니다:

  • coverage/: 테스트 커버리지 보고서는 생성된 아티팩트이므로 버전 관리가 필요하지 않습니다.
  • .env.sentry-build-plugin: Sentry 빌드 플러그인 구성 파일은 API 키와 같은 민감한 정보를 포함할 수 있으므로 버전 관리에서 제외하는 것이 좋은 보안 관행입니다.

이러한 변경 사항은 프로젝트의 보안 및 버전 관리 모범 사례를 따릅니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@seongwon030 seongwon030 changed the title [feature] 사용자 에러 추적을 위한 Sentry [feature] 사용자 에러 추적을 위한 Sentry 적용 May 14, 2025
@seongwon030 seongwon030 linked an issue May 14, 2025 that may be closed by this pull request
1 task
Copy link
Member

@oesnuj oesnuj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentry 설정 좋습니다~
적용 고생하셨습니다 👍

@seongwon030 seongwon030 merged commit 9b3b36b into develop-fe May 14, 2025
5 checks passed
@seongwon030 seongwon030 deleted the feature/#402-add-sentry-FE-113 branch May 14, 2025 09:30
@coderabbitai coderabbitai bot mentioned this pull request May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] FE-113 사용자 에러 추적을 위한 Sentry 적용

2 participants