chore: Sentry performance monitoring (#1841)

* Hook up performance monitoring

* lint
This commit is contained in:
Tom Moor
2021-01-22 20:42:45 -08:00
committed by GitHub
parent 11e1108f4a
commit f6370ccf6d
7 changed files with 118 additions and 29 deletions

28
app/utils/sentry.js Normal file
View File

@@ -0,0 +1,28 @@
// @flow
import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import { type RouterHistory } from "react-router-dom";
import env from "env";
export function initSentry(history: RouterHistory) {
Sentry.init({
dsn: env.SENTRY_DSN,
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: Sentry.reactRouterV5Instrumentation(history),
}),
],
tracesSampleRate: process.env.NODE_ENV === "production" ? 0.1 : 1,
ignoreErrors: [
"ResizeObserver loop limit exceeded",
"AuthorizationError",
"BadRequestError",
"NetworkError",
"NotFoundError",
"OfflineError",
"ServiceUnavailableError",
"UpdateRequiredError",
"ChunkLoadError",
],
});
}