-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from COS301-SE-2024/feat/web/profiling
chore: Update npm dependencies and add Faro SDK and Tracing libraries
- Loading branch information
Showing
8 changed files
with
87 additions
and
79 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { createRoutesFromChildren, matchRoutes, Routes, useLocation, useNavigationType } from 'react-router-dom'; | ||
import { createReactRouterV6Options, getWebInstrumentations, initializeFaro, ReactIntegration } from '@grafana/faro-react'; | ||
import { TracingInstrumentation } from '@grafana/faro-web-tracing'; | ||
|
||
export const initFaro = () => { | ||
return initializeFaro({ | ||
url: 'https://faro-collector-prod-eu-west-2.grafana.net/collect/ea5284621142dec3268388718e2edb70', | ||
app: { | ||
name: 'Occupi-web', | ||
version: '1.0.0', | ||
environment: 'production' | ||
}, | ||
|
||
instrumentations: [ | ||
// Mandatory, omits default instrumentations otherwise. | ||
...getWebInstrumentations(), | ||
|
||
new TracingInstrumentation(), | ||
|
||
// React integration for React applications. | ||
new ReactIntegration({ | ||
router: createReactRouterV6Options({ | ||
createRoutesFromChildren, | ||
matchRoutes, | ||
Routes, | ||
useLocation, | ||
useNavigationType, | ||
}), | ||
}), | ||
], | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.