Skip to content

Commit

Permalink
Skru på faro react integration i dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz committed Sep 6, 2024
1 parent 3be43bc commit bdfb643
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/utils/observability.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { getWebInstrumentations, initializeFaro, Meta, ReactRouterHistory } from '@grafana/faro-react';
import {
getWebInstrumentations,
initializeFaro,
Instrumentation,
Meta,
ReactIntegration,
ReactRouterHistory,
ReactRouterVersion
} from '@grafana/faro-react';
import { Route } from 'react-router-dom';
import { getEnvFromHost } from './environment';
import { getWindowFeature } from './featureToggles';
const customPageMeta: () => Pick<Meta, 'page'> = () => {
Expand All @@ -25,22 +34,23 @@ export const initializeObservability = (history: ReactRouterHistory) => {
name: 'modiapersonoversikt'
},
metas: [customPageMeta],
paused: !import.meta.env.PROD,
paused: false, //!import.meta.env.PROD,
instrumentations: [
...getWebInstrumentations()
...getWebInstrumentations(),
// Disable react integration to nok leak fnr in URLs. This can be reenabled when we are
// certain we never recieve any URLs with fnr.
//
// new ReactIntegration({
// router: {
// version: ReactRouterVersion.V5,
// dependencies: {
// history,
// Route
// }
// }
// })
],
env !== 'prod' &&
new ReactIntegration({
router: {
version: ReactRouterVersion.V5,
dependencies: {
history,
Route
}
}
})
].filter((v): v is Instrumentation => !!v),
ignoreUrls: [/\d{11}/]
});
};

0 comments on commit bdfb643

Please sign in to comment.