Skip to content

Commit

Permalink
Bump sentry (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
tu55eladd authored Oct 8, 2024
1 parent 2e42cbc commit 60a6fca
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 177 deletions.
248 changes: 82 additions & 166 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"@navikt/ds-tailwind": "^6.9.0",
"@navikt/ds-tokens": "^6.9.0",
"@reduxjs/toolkit": "^1.9.7",
"@sentry/integrations": "^7.114.0",
"@sentry/react": "^7.119.0",
"@sentry/tracing": "^7.114.0",
"@sentry/react": "^8.33.1",
"@vitejs/plugin-react-swc": "^3.7.1",
"classnames": "^2.5.1",
"date-fns": "^3.0.0",
Expand Down
23 changes: 15 additions & 8 deletions src/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { captureConsoleIntegration } from '@sentry/integrations';
import * as Sentry from '@sentry/react';
import { Breadcrumb, Event } from '@sentry/types';
import {
captureConsoleIntegration,
reactRouterV6BrowserTracingIntegration,
ErrorEvent,
init,
httpClientIntegration,
wrapCreateBrowserRouter,
EventHint,
Breadcrumb,
} from '@sentry/react';
import React from 'react';
import {
createRoutesFromChildren,
Expand Down Expand Up @@ -33,7 +40,7 @@ const tagsFilter = (tags: Event['tags']): Event['tags'] => {
};
};

const fjernPersonopplysninger = (event: Event): Event => {
const fjernPersonopplysninger = (event: ErrorEvent, hint: EventHint): ErrorEvent => {
const url = event.request?.url ? maskerPersonopplysninger(event.request.url) : '';
return {
...event,
Expand All @@ -58,17 +65,17 @@ const fjernPersonopplysninger = (event: Event): Event => {
};
};

Sentry.init({
init({
dsn: 'https://1ab82c2af7614a74b134e36b3bd2e0b4@sentry.gc.nav.no/163',
integrations: [
Sentry.reactRouterV6BrowserTracingIntegration({
reactRouterV6BrowserTracingIntegration({
useEffect: React.useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
}),
Sentry.httpClientIntegration({
httpClientIntegration({
failedRequestTargets: [
/https:\/\/aktivitetsplan(\.ekstern\.dev)?\.nav\.no\/(veilarbaktivitet|veilarbdialog|veilarboppfolging|veilarblest|veilarbperson|veilarbmalverk|veilarbveileder)\/*/,
],
Expand Down Expand Up @@ -101,4 +108,4 @@ Sentry.init({
],
});

export const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter);
export const sentryCreateBrowserRouter = wrapCreateBrowserRouter(createBrowserRouter);

0 comments on commit 60a6fca

Please sign in to comment.