From f675a4ca4923f2e25a7ccaee4d8e754b86579cb0 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 19 Feb 2025 20:23:56 +0300 Subject: [PATCH] Revert "try change sentry -> hawk catcher" This reverts commit 9aee5f10d21abd87246a624f28e218cedd1d9b7a. --- index.html | 1 - src/shared/services/sentry/index.ts | 43 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index e3a1cd8..d919ec9 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,6 @@ - MyMusic diff --git a/src/shared/services/sentry/index.ts b/src/shared/services/sentry/index.ts index e69de29..36b0171 100644 --- a/src/shared/services/sentry/index.ts +++ b/src/shared/services/sentry/index.ts @@ -0,0 +1,43 @@ +import { useEffect } from "react"; +import * as Sentry from "@sentry/react"; +import { + createRoutesFromChildren, + matchRoutes, + useLocation, + useNavigationType, +} from "react-router-dom"; + +Sentry.init({ + dsn: import.meta.env.VITE_SENTRY_DSN, + 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(), + ], + enabled: import.meta.env.PROD, // Only enable in production + environment: import.meta.env.MODE, // Set the environment + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for tracing. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate + tracesSampleRate: 0, + + // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled + tracePropagationTargets: [ + // /^\//, + // new RegExp(`^${import.meta.env.VITE_API_BASE_URL}`), + ], + // Capture Replay for 10% of all sessions, + // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration + replaysSessionSampleRate: 0, + replaysOnErrorSampleRate: 0, +});