Files
outline/app/utils/sentry.ts
Tom Moor a326e0ee88 chore: Rate limiter audit (#3965)
* chore: Rate limiter audit api/users

* Make requests required

* api/collections

* Remove checkRateLimit on FileOperation (now done at route level through rate limiter)

* auth rate limit

* Add metric logging when rate limit exceeded

* Refactor to shared configs

* test
2022-08-14 08:04:04 -07:00

33 lines
923 B
TypeScript

import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import { History } from "history";
import env from "~/env";
export function initSentry(history: History) {
Sentry.init({
dsn: env.SENTRY_DSN,
environment: env.ENVIRONMENT,
release: env.RELEASE,
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: Sentry.reactRouterV5Instrumentation(history),
}),
],
tracesSampleRate: env.ENVIRONMENT === "production" ? 0.1 : 1,
ignoreErrors: [
"ResizeObserver loop completed with undelivered notifications",
"ResizeObserver loop limit exceeded",
"AuthorizationError",
"BadRequestError",
"NetworkError",
"NotFoundError",
"OfflineError",
"RateLimitExceededError",
"ServiceUnavailableError",
"UpdateRequiredError",
"ChunkLoadError",
"file://",
],
});
}