add FE tracking with grafana faro

This commit is contained in:
2023-10-24 11:44:56 +02:00
parent 542c845c23
commit 3c16e4a632
6 changed files with 153 additions and 18 deletions
+19 -1
View File
@@ -4,13 +4,31 @@ import 'bootstrap/dist/css/bootstrap.css';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { getWebInstrumentations, initializeFaro } from '@grafana/faro-web-sdk';
const faro = window.location.hostname === 'localhost' ? undefined : initializeFaro({
url: 'https://faro-collector-prod-eu-west-2.grafana.net/collect/88adcc2543da5af525c451166286f2cc',
app: {
name: 'kemkas',
version: '1.0.0',
environment: 'production'
},
instrumentations: [
// Mandatory, overwriting the instrumentations array would cause the default instrumentations to be omitted
...getWebInstrumentations(),
// Initialization of the tracing package.
// This packages is optional because it increases the bundle size noticeably. Only add it if you want tracing data.
// new TracingInstrumentation(),
],
});
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<App />
<App faro={faro} />
</React.StrictMode>
);