-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathsetup-faro.ts
More file actions
48 lines (42 loc) · 1.13 KB
/
setup-faro.ts
File metadata and controls
48 lines (42 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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";
import { getEnv } from "./environment";
const env = getEnv();
if (env !== "development") {
initializeFaro({
url: "https://grafana.zak-man.com/faro-proxy/9c90470e84483b225a6a5a0378aa0d97",
app: {
name: "dzcode",
version: window.bundleInfo.version,
environment: env,
},
instrumentations: [
// Mandatory, omits default instrumentations otherwise.
...getWebInstrumentations(),
// Tracing package to get end-to-end visibility for HTTP requests.
new TracingInstrumentation(),
// React integration for React applications.
new ReactIntegration({
router: createReactRouterV6Options({
createRoutesFromChildren,
matchRoutes,
Routes,
useLocation,
useNavigationType,
}),
}),
],
});
}