Next.js + Sentry 설정
// sentry.client.config.ts
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.01,
integrations: [
Sentry.replayIntegration(),
Sentry.browserTracingIntegration(),
],
});커스텀 에러 컨텍스트
Sentry.setUser({ id: user.id, email: user.email });
Sentry.setTag("feature", "checkout");
Sentry.captureException(error, {
extra: { orderId: order.id },
});소스맵을 업로드하면 원본 코드 위치를 확인할 수 있습니다.
댓글 0