λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

React

[ Sentry ] F.Eμ—μ„œ Sentryλ₯Ό ν™œμš©ν•˜μ—¬ 디버깅 ν•˜κΈ°.

sentry.io

 

 

ν”„λ‘ νŠΈμ—”λ“œμ—μ„œ 개발 및 μš΄μ˜μ„ ν•˜λŠ” κ³Όμ •μ—μ„œ λ°œμƒν•˜λŠ” μ—λŸ¬λ₯Ό λͺ¨λ‹ˆν„°λ§ν•˜λŠ” 방법은 λ‹€μ–‘ν•˜λ‹€. ν˜„μž¬ 우리 νšŒμ‚¬λŠ” ν”„λ‘ νŠΈμ—”λ“œμ˜ 디버깅 툴둜 μ„ΌνŠΈλ¦¬λ₯Ό μ‚¬μš©ν•˜κ³  μžˆμ–΄μ„œ κ°„λ‹¨νžˆ μ†Œκ°œν•˜λ €κ³  ν•œλ‹€.

 

μ„ΌνŠΈλ¦¬λŠ” μ›Ή, λͺ¨λ°”일 μ•±, κ²Œμž„λ“±μ˜ λ‹€μ–‘ν•œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ λ°œμƒν•˜λŠ” 였λ₯˜λ₯Ό μ‹€μ‹œκ°„μœΌλ‘œ μΆ”μ ν•˜κ³  λΆ„μ„ν•˜μ—¬ 예츑 κ°€λŠ₯ν•œ 였λ₯˜μ™€ 예츑 λΆˆκ°€λŠ₯ν•œ 였λ₯˜λ“€μ— λŒ€ν•΄ 탐지λ₯Ό μœ„ν•œ νˆ΄μ΄λ‹€. μ²˜μŒμ—λŠ” μ˜€ν”ˆ μ†ŒμŠ€ ν”„λ‘œμ νŠΈλ‘œ μ‹œμž‘ν•˜μ˜€μœΌλ‚˜ ν˜„μž¬λŠ” ν΄λΌμš°λ“œ 기반 μ„œλΉ„μŠ€μ™€ μ˜¨ν”„λ ˆλ―ΈμŠ€ μ„€μΉ˜ 버전을 λͺ¨λ‘ μ œκ³΅ν•œλ‹€. μ„ΌνŠΈλ¦¬λ₯Ό 잘 ν™œμš©ν•˜μ—¬ κ³ κ°λ“€μ—κ²Œ 더 λ‚˜μ€ ν’ˆμ§ˆμ˜ μ„œλΉ„μŠ€λ₯Ό μ œκ³΅ν•  수 μžˆλ‹€.

 

 

μ„ΌνŠΈλ¦¬μ˜ κ°•λ ₯ν•œ κΈ°λŠ₯λ“€

 

1. μ—λŸ¬ λͺ¨λ‹ˆν„°λ§

μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ λ°œμƒν•˜λŠ” λͺ¨λ“  μ—λŸ¬λ₯Ό μžλ™μœΌλ‘œ κ°μ§€ν•˜κ³  κΈ°λ‘ν•˜μ—¬ κ°œλ°œμžκ°€ μ–΄λ–€ μ—λŸ¬κ°€ λ°œμƒν–ˆλŠ”μ§€ λ°”λ‘œ μ•Œ 수 μžˆλ„λ‘ 도와쀀닀. 

 

 

2. μ‹€μ‹œκ°„ μ•Œλ¦Ό & μ•Œλ¦Ό 채널 지원

μ—λŸ¬κ°€ λ°œμƒν•˜λ©΄ κ°œλ°œμžμ—κ²Œ 이메일, μŠ¬λž™, ν…”λ ˆκ·Έλž¨ λ“±μ˜ λ‹€μ–‘ν•œ 채널을 톡해 λ°”λ‘œ μ•Œλ¦Όμ„ 보낸닀. 

 

 

3. μ—λŸ¬ 디버깅

μ—λŸ¬κ°€ λ°œμƒν•œ μ½”λ“œμ˜ ꡬ체적인 μœ„μΉ˜μ™€ μŠ€νƒ 트레이슀(stack trace)λ₯Ό μ œκ³΅ν•˜μ—¬ 문제λ₯Ό λΉ λ₯΄κ²Œ μ°Ύκ³  μˆ˜μ •ν•  수 μžˆλ„λ‘ 도와쀀닀. μ—λŸ¬ λ°œμƒ μ‹œμ μ˜ μ»¨ν…μŠ€νŠΈ(ex: μ‚¬μš©μž 정보, ν™˜κ²½ λ³€μˆ˜ λ“±λ“±)λ₯Ό μ œκ³΅ν•˜μ—¬ 더 κΉŠμ€ 뢄석이 κ°€λŠ₯ν•˜λ‹€.

 

 

4. 이슈 νŠΈλž˜ν‚Ή

λ™μΌν•œ μ—λŸ¬κ°€ 반볡될 경우 ν•˜λ‚˜μ˜ 이슈둜 λ¬Άμ–΄ 관리할 수 μžˆλ‹€. 이λ₯Ό ν†΅ν•˜μ—¬ μ€‘λ³΅λœ μ—λŸ¬ 리포트λ₯Ό 쀄이고 μ€‘μš”ν•œ λ¬Έμ œμ— 집쀑할 수 μžˆλ‹€.

 

 

5. μ„±λŠ₯ λͺ¨λ‹ˆν„°λ§

μ—λŸ¬ λͺ¨λ‹ˆν„°λ§ 외에도 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ μ„±λŠ₯을 λͺ¨λ‹ˆν„°λ§ν•˜μ—¬ μ„±λŠ₯ μ €ν•˜λ₯Ό κ°μ§€ν•˜κ³  ν•΄κ²°ν•  수 있게 도와쀀닀. 

 

 

6. λ‹€μ–‘ν•œ ν”Œλž«νΌ 및 채널 지원

λ‹€μ–‘ν•œ ν”„λ‘œκ·Έλž˜λ° 언어와 ν”„λ ˆμž„μ›Œν¬λ₯Ό μ§€μ›ν•˜λ©°, Github, Jira, GitLab λ“± μ—¬λŸ¬ 개발 λ„κ΅¬μ™€μ˜ 톡합이 κ°€λŠ₯ν•˜λ‹€. 

 

 


 

κ°„λ‹¨ν•œ μ‚¬μš© 방법

 

 

1. Install (Sentry/react)

npm install --save @sentry/react

 

 

 

 

2. Import sentrt/react & Sentry.init()

import { createRoot } from "react-dom/client";
import { createBrowserRouter } from "react-router-dom";
import React from "react";
import * as Sentry from "@sentry/react";
import App from "./App";

Sentry.init({
  dsn: "https://e3aa9eb8f92a5b7579282df0f9390ff5@o4505825278820352.ingest.us.sentry.io/4505825300905984",
  integrations: [
      // See docs for support of different versions of variation of react router
      // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
    Sentry.reactRouterV6BrowserTracingIntegration({
        useEffect: React.useEffect,
        useLocation,
        useNavigationType,
        createRoutesFromChildren,
        matchRoutes
    }),
    Sentry.replayIntegration()
  ],

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  tracesSampleRate: 1.0,

  // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
  tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],

  // Capture Replay for 10% of all sessions,
  // plus for 100% of sessions with an error
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

const container = document.getElementById(“app”);
const root = createRoot(container);
root.render(<App />);

 

 

 

3. Sentry Admin을 ν†΅ν•œ 이벀트 둜그 확인

 

 

 

 

 

 

 

 


 

🌸 좜처 🌸

 

React Sentry  Docs - Sentry.io