Skip to content

Commit

Permalink
Sentry: ingore amplitude errors, set propagation targets (#1311)
Browse files Browse the repository at this point in the history
* Better sentry-propagation-targets

* Ignore amplitude errors

* Set failedRequestTargets
  • Loading branch information
tu55eladd authored Oct 8, 2024
1 parent 6818172 commit 3bcfec1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ Sentry.init({
createRoutesFromChildren,
matchRoutes,
}),
Sentry.httpClientIntegration({
failedRequestTargets: [
/https:\/\/aktivitetsplan(\.ekstern\.dev)?\.nav\.no\/(veilarbaktivitet|veilarbdialog|veilarboppfolging|veilarblest|veilarbperson|veilarbmalverk|veilarbveileder)/,
],
}),
captureConsoleIntegration({
// array of methods that should be captured
// defaults to ['log', 'info', 'warn', 'error', 'debug', 'assert']
Expand All @@ -82,13 +87,18 @@ Sentry.init({
/^Uventet feil fra dekoratøren: NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. \[object Object]$/,
/^Uventet feil fra dekoratøren: NotFoundError: The object can not be found here. \[object Object]$/,
/^The object can not be found here.$/,
/Amplitude/,
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.2,
beforeSend: fjernPersonopplysninger,
release: import.meta.env.VITE_SENTRY_RELEASE,
tracePropagationTargets: [
'localhost',
/https:\/\/aktivitetsplan(\.ekstern\.dev)?\.nav\.no\/(veilarbaktivitet|veilarbdialog|veilarboppfolging|veilarblest|veilarbperson|veilarbmalverk|veilarbveileder)/,
],
});

export const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter);

0 comments on commit 3bcfec1

Please sign in to comment.