From 8b96e9a4fbc7262026bee545186694e2e2565733 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Fri, 12 Jan 2024 12:25:38 -0300 Subject: [PATCH] chore: add improved sentry perf tracking --- src/shared/utils/analytics.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/shared/utils/analytics.ts b/src/shared/utils/analytics.ts index 8594de257bd..64f77c1f216 100644 --- a/src/shared/utils/analytics.ts +++ b/src/shared/utils/analytics.ts @@ -1,3 +1,11 @@ +import React from 'react'; +import { + createRoutesFromChildren, + matchRoutes, + useLocation, + useNavigationType, +} from 'react-router-dom'; + import { ripemd160 } from '@noble/hashes/ripemd160'; import { sha256 } from '@noble/hashes/sha256'; import { base58 } from '@scure/base'; @@ -59,6 +67,13 @@ export function initSentry() { startTransactionOnLocationChange: false, startTransactionOnPageLoad: false, markBackgroundTransactions: false, + routingInstrumentation: Sentry.reactRouterV6Instrumentation( + React.useEffect, + useLocation, + useNavigationType, + createRoutesFromChildren, + matchRoutes + ), }), new Sentry.Feedback({ colorScheme: 'system',