Faro & grafana improvements
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m46s
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled

This commit is contained in:
Antoni Nuñez Romeu
2026-07-07 23:40:04 +02:00
parent aae3ac04af
commit 6612c8b10c
5 changed files with 99 additions and 13 deletions
+9 -1
View File
@@ -17,6 +17,11 @@ import { TracingInstrumentation } from '@grafana/faro-web-tracing';
import { OtlpHttpTransport } from '@grafana/faro-transport-otlp-http';
let initialized = false;
let faroApi = null;
export function getFaro() {
return faroApi;
}
export function initFaro() {
if (initialized) return;
@@ -34,7 +39,7 @@ export function initFaro() {
const version = import.meta.env.VITE_FARO_APP_VERSION || '1.0.0';
try {
initializeFaro({
const faro = initializeFaro({
url: `${endpoint.replace(/\/$/, '')}/v1/traces`,
app: {
name: appName,
@@ -61,6 +66,9 @@ export function initFaro() {
url: `${endpoint.replace(/\/$/, '')}/v1/traces`,
}),
});
faroApi = faro.api;
// Expose for ErrorBoundary and manual reporting
window.__faro = faro;
} catch (err) {
// Never let Faro init failure break the app.
// eslint-disable-next-line no-console