NestJS Sentry 연동하기

Younghwan Cha·2023년 10월 16일
0

Nest.js

목록 보기
26/27
post-thumbnail

공식 홈페이지를 참고하여 아래와 같이 세팅을 진행한다. 워낙 잘 설명되어 있어서 그냥 보고 따라하면 된다.

$ npm install --save @sentry/node @sentry/profiling-node
// You can also use CommonJS `require('@sentry/node')` instead of `import`
import * as Sentry from "@sentry/node";
import { ProfilingIntegration } from "@sentry/profiling-node";

Sentry.init({
  dsn: 'https://ab0672f3a9e2132929c63c344b9e8b24@o4505502944526336.ingest.sentry.io/4505781733425152',
  integrations: [
    new ProfilingIntegration(),
  ],
  // Performance Monitoring
  tracesSampleRate: 1.0,
  // Set sampling rate for profiling - this is relative to tracesSampleRate
  profilesSampleRate: 1.0,
});

이후에는 sentry wizard 를 사용하여 source map 을 업로드 한다.

$ npx @sentry/wizard@latest -i sourcemaps

source map?
프로덕션 환경에서 발생하는 에러를 신속하게 식별하고 해결하는 데 도움이 되는 중요한 도구이다

profile
개발 기록

0개의 댓글