diff --git a/src/main.tsx b/src/main.tsx index 9018b37..e3cf893 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,17 +2,29 @@ import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App.tsx"; import "./index.css"; -import { createRoutesFromChildren, matchRoutes, Routes, useLocation, useNavigationType} from 'react-router-dom'; -import { getWebInstrumentations, initializeFaro, ReactIntegration, ReactRouterVersion } from '@grafana/faro-react'; -import { TracingInstrumentation } from '@grafana/faro-web-tracing'; +import { + createRoutesFromChildren, + matchRoutes, + Routes, + useLocation, + useNavigationType, +} from "react-router-dom"; +import { + getWebInstrumentations, + initializeFaro, + ReactIntegration, + ReactRouterVersion, +} from "@grafana/faro-react"; +import { TracingInstrumentation } from "@grafana/faro-web-tracing"; initializeFaro({ - url: 'https://faro-collector-prod-us-east-0.grafana.net/collect/44231aee736ba596035f91e852090587', + // Replace with ADORSYS' grafana cloud webank-userapp collector url + url: "URL", app: { - name: 'webank-userapp', - version: '1.0.0', - environment: 'production' - }, + name: "webank-userapp", + version: "1.0.0", + environment: "production", + }, instrumentations: [ // Mandatory, omits default instrumentations otherwise. ...getWebInstrumentations(), @@ -24,15 +36,15 @@ initializeFaro({ router: { version: ReactRouterVersion.V6, dependencies: { - createRoutesFromChildren, - matchRoutes, - Routes, - useLocation, - useNavigationType - } - } - }) - ] + createRoutesFromChildren, + matchRoutes, + Routes, + useLocation, + useNavigationType, + }, + }, + }), + ], }); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/vite.config.ts b/vite.config.ts index e3a7916..1bd72ab 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,13 +6,13 @@ import faroUploader from '@grafana/faro-rollup-plugin'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ - + // Replace with the endpoint, stack id, app id and api key of ADORSYS' grafana cloud faroUploader({ appName: 'webank-userapp', - endpoint: 'https://faro-api-prod-us-east-0.grafana.net/faro/api/v1', - appId: '2403', - stackId: '1085430', - apiKey: 'glc_eyJvIjoiMTI2Njk5OSIsIm4iOiJ1c2VyLWFwcC11cGxvYWQta2V5LWFwcHRva2VuIiwiayI6IjkyMzJSVjlOVzk4eG14NUpyQzIwVXFjcCIsIm0iOnsiciI6InVzIn19', + endpoint: 'END POINT', + appId: 'APP ID', + stackId: 'STACK ID', + apiKey: 'API KEY', }), react(),