Merged in feature/IO-3162-sentry-improvements (pull request #2136)
feature/IO-3162-sentry-improvements Approved-by: Patrick Fic
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { onError } from "@apollo/client/link/error";
|
import { onError } from "@apollo/client/link/error";
|
||||||
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
||||||
import * as Sentry from "@sentry/react";
|
|
||||||
|
|
||||||
const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => {
|
const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => {
|
||||||
if (graphQLErrors) {
|
if (graphQLErrors) {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import { getMainDefinition } from "@apollo/client/utilities";
|
|||||||
//import { split } from "apollo-link";
|
//import { split } from "apollo-link";
|
||||||
import apolloLogger from "apollo-link-logger";
|
import apolloLogger from "apollo-link-logger";
|
||||||
//import axios from "axios";
|
//import axios from "axios";
|
||||||
|
import { SentryLink } from "apollo-link-sentry";
|
||||||
import { auth } from "../firebase/firebase.utils";
|
import { auth } from "../firebase/firebase.utils";
|
||||||
import errorLink from "../graphql/apollo-error-handling";
|
import errorLink from "../graphql/apollo-error-handling";
|
||||||
import { SentryLink } from "apollo-link-sentry";
|
|
||||||
|
|
||||||
//import { store } from "../redux/store";
|
//import { store } from "../redux/store";
|
||||||
const httpLink = new HttpLink({
|
const httpLink = new HttpLink({
|
||||||
|
|||||||
@@ -17,47 +17,47 @@ const currentDatePST = new Date()
|
|||||||
const sentryRelease =
|
const sentryRelease =
|
||||||
`${import.meta.env.VITE_APP_IS_TEST ? "test" : "production"}-${currentDatePST}-${process.env.VITE_GIT_COMMIT_HASH}`.trim();
|
`${import.meta.env.VITE_APP_IS_TEST ? "test" : "production"}-${currentDatePST}-${process.env.VITE_GIT_COMMIT_HASH}`.trim();
|
||||||
|
|
||||||
//if (import.meta.env.PROD) {
|
if (!import.meta.env.DEV) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: InstanceRenderManager({
|
dsn: InstanceRenderManager({
|
||||||
imex: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
|
imex: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
|
||||||
rome: "https://a6acc91c073e414196014b8484627a61@o492140.ingest.sentry.io/4504561071161344"
|
rome: "https://a6acc91c073e414196014b8484627a61@o492140.ingest.sentry.io/4504561071161344"
|
||||||
}),
|
|
||||||
release: sentryRelease,
|
|
||||||
|
|
||||||
ignoreErrors: [
|
|
||||||
"ResizeObserver loop",
|
|
||||||
"ResizeObserver loop limit exceeded",
|
|
||||||
"Module specifier, 'fs' does not start",
|
|
||||||
"Module specifier, 'zlib' does not start with",
|
|
||||||
"Messaging: This browser doesn't support the API's required to use the Firebase SDK.",
|
|
||||||
"Failed to update a ServiceWorker for scope"
|
|
||||||
],
|
|
||||||
integrations: [
|
|
||||||
// See docs for support of different versions of variation of react router
|
|
||||||
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
|
|
||||||
Sentry.reactRouterV6BrowserTracingIntegration({
|
|
||||||
useEffect,
|
|
||||||
useLocation,
|
|
||||||
useNavigationType,
|
|
||||||
createRoutesFromChildren,
|
|
||||||
matchRoutes
|
|
||||||
}),
|
}),
|
||||||
Sentry.replayIntegration(),
|
release: sentryRelease,
|
||||||
Sentry.browserProfilingIntegration()
|
|
||||||
],
|
|
||||||
|
|
||||||
tracePropagationTargets: [
|
ignoreErrors: [
|
||||||
"api.imex.online",
|
"ResizeObserver loop",
|
||||||
"api.test.imex.online",
|
"ResizeObserver loop limit exceeded",
|
||||||
"db.imex.online",
|
"Module specifier, 'fs' does not start",
|
||||||
"api.romeonline.io",
|
"Module specifier, 'zlib' does not start with",
|
||||||
"api.test.romeonline.io",
|
"Messaging: This browser doesn't support the API's required to use the Firebase SDK.",
|
||||||
"db.romeonline.io"
|
"Failed to update a ServiceWorker for scope"
|
||||||
],
|
],
|
||||||
tracesSampleRate: 1.0,
|
integrations: [
|
||||||
replaysOnErrorSampleRate: 1.0,
|
// See docs for support of different versions of variation of react router
|
||||||
environment: import.meta.env.MODE,
|
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
|
||||||
beforeBreadcrumb: excludeGraphQLFetch
|
Sentry.reactRouterV6BrowserTracingIntegration({
|
||||||
});
|
useEffect,
|
||||||
//}
|
useLocation,
|
||||||
|
useNavigationType,
|
||||||
|
createRoutesFromChildren,
|
||||||
|
matchRoutes
|
||||||
|
}),
|
||||||
|
Sentry.replayIntegration(),
|
||||||
|
Sentry.browserProfilingIntegration()
|
||||||
|
],
|
||||||
|
|
||||||
|
tracePropagationTargets: [
|
||||||
|
"api.imex.online",
|
||||||
|
"api.test.imex.online",
|
||||||
|
"db.imex.online",
|
||||||
|
"api.romeonline.io",
|
||||||
|
"api.test.romeonline.io",
|
||||||
|
"db.romeonline.io"
|
||||||
|
],
|
||||||
|
tracesSampleRate: 1.0,
|
||||||
|
replaysOnErrorSampleRate: 1.0,
|
||||||
|
environment: import.meta.env.MODE,
|
||||||
|
beforeBreadcrumb: excludeGraphQLFetch
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user