Files
outline/app/utils/sentry.ts
T
Tom MoorandClaude Opus 4.8 cd4b324f5a chore: Upgrade dd-trace and Sentry (node/react) to v10 (#12759)
Bumps dd-trace to ^5.109.0 and @sentry/node + @sentry/react to ^10.58.0,
migrating off APIs removed in the Sentry v8 major: BrowserTracing /
reactRouterV5Instrumentation, Sentry.Handlers.parseRequest, and
Sentry.configureScope.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 20:50:45 -04:00

54 lines
1.4 KiB
TypeScript

import * as Sentry from "@sentry/react";
import type { History } from "history";
import env from "~/env";
import {
AuthorizationError,
BadRequestError,
NetworkError,
NotFoundError,
OfflineError,
PaymentRequiredError,
RateLimitExceededError,
ServiceUnavailableError,
UpdateRequiredError,
} from "./errors";
export function initSentry(history: History) {
const ignoredErrorTypes = [
AuthorizationError,
BadRequestError,
NetworkError,
NotFoundError,
OfflineError,
PaymentRequiredError,
RateLimitExceededError,
ServiceUnavailableError,
UpdateRequiredError,
];
Sentry.init({
dsn: env.SENTRY_DSN,
environment: env.ENVIRONMENT,
release: env.VERSION,
tunnel: env.SENTRY_TUNNEL,
allowUrls: [env.URL, env.CDN_URL, env.COLLABORATION_URL],
integrations: [Sentry.reactRouterV5BrowserTracingIntegration({ history })],
tracesSampleRate: env.ENVIRONMENT === "production" ? 0.1 : 1,
ignoreErrors: [
"Failed to fetch dynamically imported module",
"ResizeObserver loop completed with undelivered notifications",
"ResizeObserver loop limit exceeded",
"Object Not Found Matching Id",
"file://",
"chrome-extension://",
],
beforeSend(event, hint) {
const error = hint.originalException;
if (error && ignoredErrorTypes.some((type) => error instanceof type)) {
return null;
}
return event;
},
});
}