@visin/frontend-core 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -34,3 +34,49 @@ The package also exports `createAuthService`, `createAuthContext`, route guards,
|
|
|
34
34
|
navigation, configuration and shared UI components. Each frontend creates its
|
|
35
35
|
own auth context with the shared factory so it can run both standalone and in
|
|
36
36
|
`shell-front`.
|
|
37
|
+
|
|
38
|
+
## Optional frontend observability
|
|
39
|
+
|
|
40
|
+
The separate `@visin/frontend-core/observability` export provides
|
|
41
|
+
`initializeFrontendObservability`, `trackFrontendPageView`, and
|
|
42
|
+
`reportFrontendError`. Import it dynamically after loading runtime config, before
|
|
43
|
+
mounting API consumers. A missing collector URL disables initialization. The
|
|
44
|
+
versioned window-level instance is shared across independently bundled remotes;
|
|
45
|
+
the host router owns page-view events.
|
|
46
|
+
|
|
47
|
+
Faro captures errors, Web Vitals, sessions and browser traces. For configured API
|
|
48
|
+
base URLs, fetch/XHR completion emits an `api_request` event containing normalized
|
|
49
|
+
operation, method, status, outcome, duration in seconds and originating trace ID.
|
|
50
|
+
Duration covers body transfer, not application JSON parsing or React rendering.
|
|
51
|
+
Browser SDK sessions are volatile (no persistent visitor identifier); configured
|
|
52
|
+
session sampling applies to all signals, so sampled visit totals are not exact
|
|
53
|
+
usage counts. Unsampled sessions do not suppress independent backend sampling.
|
|
54
|
+
|
|
55
|
+
The initial conservative redaction removes user metadata, raw page URLs, console
|
|
56
|
+
logs, exception text/context, Web Vitals DOM attribution and free-form span data.
|
|
57
|
+
Stack frames retain bundle paths and coordinates without query strings for future
|
|
58
|
+
source-map processing. This intentionally limits error grouping until a reviewed
|
|
59
|
+
message/fingerprint policy is added. Route normalization keeps only listed route
|
|
60
|
+
words and turns every other segment into `:id`. Pass the app's words as
|
|
61
|
+
`routeSegments` (shell-front generates them from the route definitions with
|
|
62
|
+
`npm run telemetry:routes`); a missing word coarsens a row, it never leaks a name.
|
|
63
|
+
Faro's own `faro.tracing.*` span-mirror events are dropped, and an item the sanitizer
|
|
64
|
+
cannot process is dropped rather than sent. A page view tracked before the SDK is
|
|
65
|
+
ready is sent once it is.
|
|
66
|
+
|
|
67
|
+
`collectorUrl` and the API URLs may be paths (`/collect/faro`), resolved against the
|
|
68
|
+
page, which keeps delivery same-origin on every hostname serving the app. Any other
|
|
69
|
+
non-absolute value disables collection.
|
|
70
|
+
|
|
71
|
+
The shell-front pilot has one runtime setting, `FARO_COLLECTOR_URL` (empty disables
|
|
72
|
+
it). Environment comes from the build mode, the release is baked in at image build
|
|
73
|
+
(`APP_VERSION`), and sampling is the default 1. Standalone app integration,
|
|
74
|
+
streaming/upload policy, private source maps and production alerts
|
|
75
|
+
remain tracked in the root `todo.md`. The collector/dashboard configuration lives
|
|
76
|
+
in visin-ops. Browser traces can share backend trace IDs via W3C headers; the
|
|
77
|
+
backend must also have OTLP export enabled to make its spans visible in Jaeger.
|
|
78
|
+
|
|
79
|
+
After building this library and shell-front, run
|
|
80
|
+
`node scripts/test-faro-browser.mjs` from the repository root for a real Chromium
|
|
81
|
+
smoke test against temporary local APIs and a mock collector. It checks page-view
|
|
82
|
+
and request events, exported spans, cross-origin trace headers, and URL redaction.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Faro, type TransportItem } from '@grafana/faro-web-sdk';
|
|
2
|
+
export interface FrontendObservabilityOptions {
|
|
3
|
+
collectorUrl?: string;
|
|
4
|
+
app: string;
|
|
5
|
+
environment?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
/** Explicit API base URLs, keyed by stable service names. */
|
|
8
|
+
apiUrls: Record<string, string | undefined>;
|
|
9
|
+
/** Session sampling applies to all signals. Default 1 for a limited pilot. */
|
|
10
|
+
samplingRate?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Static path segments (route words such as `archive` or `trainings`) reported verbatim, in
|
|
13
|
+
* addition to the built-in ones. Every other segment becomes `:id`, so this list is what keeps
|
|
14
|
+
* `/projects/:id/archive` and `/projects/:id/restore` apart. Generate it from route definitions.
|
|
15
|
+
*/
|
|
16
|
+
routeSegments?: Iterable<string>;
|
|
17
|
+
}
|
|
18
|
+
interface ObservabilityState {
|
|
19
|
+
faro?: Faro;
|
|
20
|
+
pending?: Promise<void>;
|
|
21
|
+
lastNavigation?: string;
|
|
22
|
+
/** The latest navigation seen before Faro was ready, sent once it is. */
|
|
23
|
+
pendingView?: {
|
|
24
|
+
path: string;
|
|
25
|
+
key: string;
|
|
26
|
+
};
|
|
27
|
+
segments?: ReadonlySet<string>;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface Window {
|
|
31
|
+
__visinObservabilityV1?: ObservabilityState;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export declare function normalizeTelemetryPath(path: string, segments?: ReadonlySet<string>): string;
|
|
35
|
+
/**
|
|
36
|
+
* Keeps an error message readable while removing what tends to carry private data: URLs (signed
|
|
37
|
+
* links, slugs), email addresses, tokens, long ids and numbers, and quoted text other than a plain
|
|
38
|
+
* identifier. `Cannot read properties of undefined (reading 'name')` survives intact, so does
|
|
39
|
+
* `Project <str> not found` once a quoted slug is removed. Words outside quotes are kept: a
|
|
40
|
+
* message that interpolates a name without quotes can still carry it.
|
|
41
|
+
*/
|
|
42
|
+
export declare function scrubErrorMessage(message: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Strip free-form span data, URLs, and error messages before browser export. Fails closed: an
|
|
45
|
+
* item that cannot be sanitized is dropped, never sent as it was, and never throws into Faro's
|
|
46
|
+
* batch (where one bad item would discard the whole batch).
|
|
47
|
+
*/
|
|
48
|
+
export declare function sanitizeTelemetry(item: TransportItem): TransportItem | null;
|
|
49
|
+
/** Shared across independently bundled remotes; never patches fetch more than once. */
|
|
50
|
+
export declare function initializeFrontendObservability(options: FrontendObservabilityOptions): Promise<void>;
|
|
51
|
+
/** Call from the owning router; navigation keys preserve legitimate repeat visits. */
|
|
52
|
+
export declare function trackFrontendPageView(path: string, navigationKey: string): void;
|
|
53
|
+
export declare function reportFrontendError(error: Error): void;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observability/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACT,KAAK,aAAa,EAInB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,WAAW,4BAA4B;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5C,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;KAC7C;CACF;AAaD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,WAAW,CAAC,MAAM,CAAmB,GAAG,MAAM,CAS5G;AAKD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAezD;AAkBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,IAAI,CAM3E;AAkFD,uFAAuF;AACvF,wBAAsB,+BAA+B,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CA+H1G;AAED,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAa/E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAEtD"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { initializeFaro, ErrorsInstrumentation, SessionInstrumentation, WebVitalsInstrumentation } from '@grafana/faro-web-sdk';
|
|
2
|
+
import { TracingInstrumentation } from '@grafana/faro-web-tracing';
|
|
3
|
+
// Unknown segments are always placeholders, including human-readable slugs.
|
|
4
|
+
// This intentionally sacrifices detail rather than exporting private names.
|
|
5
|
+
const builtInSegments = new Set(('api auth public projects datasets trainings epochs configs comparisons visualizations ' +
|
|
6
|
+
'benchmarks models evaluations suites leaderboards papers jobs work account invite chat explore search people groups ' +
|
|
7
|
+
'u g login logout register verify profile users sessions images files upload download results settings members ' +
|
|
8
|
+
'messages conversations notifications home health status licenses me').split(' '));
|
|
9
|
+
export function normalizeTelemetryPath(path, segments = builtInSegments) {
|
|
10
|
+
try {
|
|
11
|
+
return new URL(path, 'https://redacted.invalid').pathname
|
|
12
|
+
.split('/')
|
|
13
|
+
.map((segment) => (segment && !segments.has(segment) ? ':id' : segment))
|
|
14
|
+
.join('/');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return '/other';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const MAX_MESSAGE_LENGTH = 300;
|
|
21
|
+
const SCRIPT_PATH = /\.(?:m?js|cjs|jsx|tsx?)$/;
|
|
22
|
+
/**
|
|
23
|
+
* Keeps an error message readable while removing what tends to carry private data: URLs (signed
|
|
24
|
+
* links, slugs), email addresses, tokens, long ids and numbers, and quoted text other than a plain
|
|
25
|
+
* identifier. `Cannot read properties of undefined (reading 'name')` survives intact, so does
|
|
26
|
+
* `Project <str> not found` once a quoted slug is removed. Words outside quotes are kept: a
|
|
27
|
+
* message that interpolates a name without quotes can still carry it.
|
|
28
|
+
*/
|
|
29
|
+
export function scrubErrorMessage(message) {
|
|
30
|
+
return (message
|
|
31
|
+
.replace(/\b[a-z][a-z0-9+.-]*:\/\/[^\s'"`<>)]+/gi, '<url>')
|
|
32
|
+
.replace(/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g, '<email>')
|
|
33
|
+
// JWTs and other long opaque tokens.
|
|
34
|
+
.replace(/\beyJ[\w-]+\.[\w-]+(?:\.[\w-]+)?/g, '<token>')
|
|
35
|
+
.replace(/(['"`])([^'"`\n]*)\1/g, (quoted, mark, inner) => /^[A-Za-z_$][\w$]{0,39}$/.test(inner) ? quoted : `${mark}<str>${mark}`)
|
|
36
|
+
.replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, '<id>')
|
|
37
|
+
.replace(/\b(?=[0-9a-z_-]*\d)[0-9a-z_-]{20,}\b/gi, '<id>')
|
|
38
|
+
.replace(/\b\d{4,}\b/g, '<n>')
|
|
39
|
+
.slice(0, MAX_MESSAGE_LENGTH));
|
|
40
|
+
}
|
|
41
|
+
const escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
42
|
+
/**
|
|
43
|
+
* Only permit http(s) URLs without credentials. A path (`/collect/faro`) resolves against `base`;
|
|
44
|
+
* anything else must be absolute, so a mistyped value disables rather than guesses.
|
|
45
|
+
*/
|
|
46
|
+
function safeUrl(value, base) {
|
|
47
|
+
try {
|
|
48
|
+
const url = new URL(value, value.startsWith('/') ? base : undefined);
|
|
49
|
+
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password)
|
|
50
|
+
return undefined;
|
|
51
|
+
return url;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Strip free-form span data, URLs, and error messages before browser export. Fails closed: an
|
|
59
|
+
* item that cannot be sanitized is dropped, never sent as it was, and never throws into Faro's
|
|
60
|
+
* batch (where one bad item would discard the whole batch).
|
|
61
|
+
*/
|
|
62
|
+
export function sanitizeTelemetry(item) {
|
|
63
|
+
try {
|
|
64
|
+
return sanitize(item);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function sanitize(item) {
|
|
71
|
+
// Faro mirrors every client span as a `faro.tracing.*` event carrying all span attributes (raw
|
|
72
|
+
// URLs included). After redaction it would be an empty duplicate of `api_request`.
|
|
73
|
+
if (item.type === 'event' && item.payload.name?.startsWith('faro.tracing.'))
|
|
74
|
+
return null;
|
|
75
|
+
const clone = structuredClone(item);
|
|
76
|
+
delete clone.meta.user;
|
|
77
|
+
if (clone.meta.page)
|
|
78
|
+
clone.meta.page = { url: normalizeTelemetryPath(clone.meta.page.url ?? '/') };
|
|
79
|
+
if (clone.type === 'log')
|
|
80
|
+
return null;
|
|
81
|
+
if (clone.type === 'exception') {
|
|
82
|
+
const error = clone.payload;
|
|
83
|
+
error.value = scrubErrorMessage(error.value ?? '');
|
|
84
|
+
delete error.context;
|
|
85
|
+
delete error.originalError;
|
|
86
|
+
if (error.stacktrace) {
|
|
87
|
+
// A frame without a line is the stack's header line misread as a frame (Chrome's
|
|
88
|
+
// `Error: <message>`): its "function" is the raw message and its "filename" whatever
|
|
89
|
+
// URL the message held. Real frames always have a line.
|
|
90
|
+
error.stacktrace.frames = error.stacktrace.frames.filter((frame) => frame.lineno);
|
|
91
|
+
for (const frame of error.stacktrace.frames) {
|
|
92
|
+
// Keep hashed bundle names for source-map lookup, but no signed query strings. A frame in
|
|
93
|
+
// inline or eval'd code is named after the page, whose path can hold a private slug.
|
|
94
|
+
const url = safeUrl(frame.filename);
|
|
95
|
+
frame.filename = !url
|
|
96
|
+
? ''
|
|
97
|
+
: SCRIPT_PATH.test(url.pathname)
|
|
98
|
+
? `${url.origin}${url.pathname}`
|
|
99
|
+
: `${url.origin}/<page>`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (clone.type === 'measurement')
|
|
104
|
+
delete clone.payload.context;
|
|
105
|
+
if (clone.type === 'event') {
|
|
106
|
+
const event = clone.payload;
|
|
107
|
+
event.attributes = Object.fromEntries(Object.entries(event.attributes ?? {}).filter(([key]) => ['route', 'service', 'operation', 'method', 'status', 'outcome', 'duration_seconds'].includes(key)));
|
|
108
|
+
}
|
|
109
|
+
if (clone.type === 'trace') {
|
|
110
|
+
// OTLP includes raw request URLs and network-event attributes by default.
|
|
111
|
+
// Retain only bounded HTTP attributes; trace/span identifiers remain intact.
|
|
112
|
+
const payload = clone.payload;
|
|
113
|
+
for (const resource of payload.resourceSpans ?? []) {
|
|
114
|
+
for (const scope of resource.scopeSpans ?? []) {
|
|
115
|
+
for (const span of scope.spans ?? []) {
|
|
116
|
+
const operation = span.attributes?.find((attr) => attr.key === 'visin.operation')?.value?.stringValue;
|
|
117
|
+
const method = span.attributes?.find((attr) => ['http.method', 'http.request.method'].includes(attr.key))
|
|
118
|
+
?.value?.stringValue;
|
|
119
|
+
span.name = `${method ?? 'HTTP'} ${operation ?? '/other'}`;
|
|
120
|
+
span.attributes = span.attributes?.filter((attr) => [
|
|
121
|
+
'http.method',
|
|
122
|
+
'http.request.method',
|
|
123
|
+
'http.status_code',
|
|
124
|
+
'http.response.status_code',
|
|
125
|
+
'visin.operation',
|
|
126
|
+
'visin.service'
|
|
127
|
+
].includes(attr.key));
|
|
128
|
+
delete span.events;
|
|
129
|
+
if (span.status)
|
|
130
|
+
delete span.status.message;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return clone;
|
|
136
|
+
}
|
|
137
|
+
/** Shared across independently bundled remotes; never patches fetch more than once. */
|
|
138
|
+
export async function initializeFrontendObservability(options) {
|
|
139
|
+
if (typeof window === 'undefined' || !options.collectorUrl)
|
|
140
|
+
return;
|
|
141
|
+
// Relative (`/collect/faro`) keeps delivery same-origin on every hostname serving the app.
|
|
142
|
+
const collector = safeUrl(options.collectorUrl, window.location.href);
|
|
143
|
+
if (!collector)
|
|
144
|
+
return;
|
|
145
|
+
const state = (window.__visinObservabilityV1 ??= {});
|
|
146
|
+
if (state.faro)
|
|
147
|
+
return;
|
|
148
|
+
if (state.pending)
|
|
149
|
+
return state.pending;
|
|
150
|
+
state.pending = Promise.resolve()
|
|
151
|
+
.then(() => {
|
|
152
|
+
const segments = new Set([...builtInSegments, ...(options.routeSegments ?? [])]);
|
|
153
|
+
const apis = Object.entries(options.apiUrls).flatMap(([service, value]) => {
|
|
154
|
+
const url = value && safeUrl(value, window.location.href);
|
|
155
|
+
return url
|
|
156
|
+
? [
|
|
157
|
+
{
|
|
158
|
+
service,
|
|
159
|
+
url,
|
|
160
|
+
pattern: new RegExp(`^${escapeRegex(url.origin + url.pathname.replace(/\/$/, ''))}(?:/|\\?|$)`)
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
: [];
|
|
164
|
+
});
|
|
165
|
+
const rate = options.samplingRate ?? 1;
|
|
166
|
+
const recordApiRequest = (span, response) => {
|
|
167
|
+
// The callback runs after body transfer for ordinary fetch responses.
|
|
168
|
+
const readable = span;
|
|
169
|
+
const raw = readable.attributes?.['http.url'] ?? readable.attributes?.['url.full'];
|
|
170
|
+
if (typeof raw !== 'string')
|
|
171
|
+
return;
|
|
172
|
+
const url = new URL(raw, window.location.href);
|
|
173
|
+
const api = apis.find((api) => api.pattern.test(url.href));
|
|
174
|
+
if (!api)
|
|
175
|
+
return;
|
|
176
|
+
const operation = normalizeTelemetryPath(url.pathname, segments);
|
|
177
|
+
span.setAttribute('visin.operation', operation);
|
|
178
|
+
span.setAttribute('visin.service', api.service);
|
|
179
|
+
const start = readable.startTime;
|
|
180
|
+
if (!start)
|
|
181
|
+
return;
|
|
182
|
+
const duration = Math.max(0, (Date.now() - (start[0] * 1000 + start[1] / 1e6)) / 1000);
|
|
183
|
+
const status = 'status' in response ? (response.status ?? 0) : 0;
|
|
184
|
+
const method = readable.attributes?.['http.request.method'] ?? readable.attributes?.['http.method'];
|
|
185
|
+
const outcome = 'name' in response && response.name === 'AbortError'
|
|
186
|
+
? 'cancelled'
|
|
187
|
+
: 'name' in response && response.name === 'TimeoutError'
|
|
188
|
+
? 'timeout'
|
|
189
|
+
: status === 0
|
|
190
|
+
? 'network_error'
|
|
191
|
+
: status >= 400
|
|
192
|
+
? 'http_error'
|
|
193
|
+
: 'success';
|
|
194
|
+
state.faro?.api.pushEvent('api_request', {
|
|
195
|
+
service: api.service,
|
|
196
|
+
operation,
|
|
197
|
+
method: typeof method === 'string' ? method : 'HTTP',
|
|
198
|
+
status: String(status),
|
|
199
|
+
outcome,
|
|
200
|
+
duration_seconds: String(duration)
|
|
201
|
+
}, 'visin', { skipDedupe: true, spanContext: span.spanContext() });
|
|
202
|
+
};
|
|
203
|
+
const faro = initializeFaro({
|
|
204
|
+
url: collector.href,
|
|
205
|
+
app: {
|
|
206
|
+
name: options.app,
|
|
207
|
+
// Runtime config renders an unset variable as '', which must not become an empty label.
|
|
208
|
+
environment: options.environment || 'unknown',
|
|
209
|
+
version: options.version || 'unknown'
|
|
210
|
+
},
|
|
211
|
+
sessionTracking: {
|
|
212
|
+
enabled: true,
|
|
213
|
+
persistent: false,
|
|
214
|
+
samplingRate: Number.isFinite(rate) && rate >= 0 && rate <= 1 ? rate : 1
|
|
215
|
+
},
|
|
216
|
+
batching: { enabled: true, itemLimit: 50, sendTimeout: 2000 },
|
|
217
|
+
beforeSend: sanitizeTelemetry,
|
|
218
|
+
ignoreUrls: [
|
|
219
|
+
new RegExp(`^${escapeRegex(collector.origin + collector.pathname)}(?:\\?|$)`),
|
|
220
|
+
// Chat's event streams last as long as a page; they are not request latency.
|
|
221
|
+
/\/events(?:\?|$)/
|
|
222
|
+
],
|
|
223
|
+
instrumentations: [
|
|
224
|
+
new ErrorsInstrumentation(),
|
|
225
|
+
new SessionInstrumentation(),
|
|
226
|
+
new WebVitalsInstrumentation(),
|
|
227
|
+
new TracingInstrumentation({
|
|
228
|
+
// Do not suppress independent backend sampling for sessions Faro drops.
|
|
229
|
+
omitTraceContextForUnsampledSessions: true,
|
|
230
|
+
instrumentationOptions: {
|
|
231
|
+
propagateTraceHeaderCorsUrls: apis.map((api) => api.pattern),
|
|
232
|
+
xhrInstrumentationOptions: {
|
|
233
|
+
ignoreNetworkEvents: true,
|
|
234
|
+
applyCustomAttributesOnSpan: (span, xhr) => recordApiRequest(span, xhr)
|
|
235
|
+
},
|
|
236
|
+
fetchInstrumentationOptions: {
|
|
237
|
+
ignoreNetworkEvents: true,
|
|
238
|
+
applyCustomAttributesOnSpan: (span, _request, response) => recordApiRequest(span, response)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
});
|
|
244
|
+
state.segments = segments;
|
|
245
|
+
state.faro = faro;
|
|
246
|
+
const view = state.pendingView;
|
|
247
|
+
state.pendingView = undefined;
|
|
248
|
+
if (view)
|
|
249
|
+
trackFrontendPageView(view.path, view.key);
|
|
250
|
+
})
|
|
251
|
+
.catch(() => {
|
|
252
|
+
// Monitoring must not stop application startup. A later initialization may retry.
|
|
253
|
+
})
|
|
254
|
+
.finally(() => {
|
|
255
|
+
state.pending = undefined;
|
|
256
|
+
});
|
|
257
|
+
return state.pending;
|
|
258
|
+
}
|
|
259
|
+
/** Call from the owning router; navigation keys preserve legitimate repeat visits. */
|
|
260
|
+
export function trackFrontendPageView(path, navigationKey) {
|
|
261
|
+
if (typeof window === 'undefined')
|
|
262
|
+
return;
|
|
263
|
+
const state = (window.__visinObservabilityV1 ??= {});
|
|
264
|
+
if (!state.faro) {
|
|
265
|
+
// Initialization still running (or past the app's startup wait): send the page view later.
|
|
266
|
+
state.pendingView = { path, key: navigationKey };
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (state.lastNavigation === navigationKey)
|
|
270
|
+
return;
|
|
271
|
+
state.lastNavigation = navigationKey;
|
|
272
|
+
const route = normalizeTelemetryPath(path, state.segments);
|
|
273
|
+
state.faro.api.setView({ name: route });
|
|
274
|
+
state.faro.api.pushEvent('page_view', { route }, 'visin', { skipDedupe: true });
|
|
275
|
+
}
|
|
276
|
+
export function reportFrontendError(error) {
|
|
277
|
+
if (typeof window !== 'undefined')
|
|
278
|
+
window.__visinObservabilityV1?.faro?.api.pushError(error);
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/observability/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EAMzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAkCnE,4EAA4E;AAC5E,4EAA4E;AAC5E,MAAM,eAAe,GAAwB,IAAI,GAAG,CAClD,CACE,wFAAwF;IACxF,sHAAsH;IACtH,gHAAgH;IAChH,qEAAqE,CACtE,CAAC,KAAK,CAAC,GAAG,CAAC,CACb,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,WAAgC,eAAe;IAClG,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC,QAAQ;aACtD,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAA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CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAY;IAC9C,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,MAAM,CAAC,sBAAsB,EAAE,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visin/frontend-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Shared frontend auth/API-client logic for Visin frontends",
|
|
5
5
|
"author": "Toomas Tahves",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
"types": "./dist/federation.d.ts",
|
|
18
18
|
"import": "./dist/federation.js",
|
|
19
19
|
"default": "./dist/federation.js"
|
|
20
|
+
},
|
|
21
|
+
"./observability": {
|
|
22
|
+
"types": "./dist/observability/index.d.ts",
|
|
23
|
+
"import": "./dist/observability/index.js",
|
|
24
|
+
"default": "./dist/observability/index.js"
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
27
|
"files": [
|
|
@@ -61,11 +66,15 @@
|
|
|
61
66
|
"@types/react": "^19.3.0",
|
|
62
67
|
"@vitest/coverage-v8": "^5.1.0",
|
|
63
68
|
"jsdom": "^30.1.3",
|
|
69
|
+
"oxlint": "^1.91.0",
|
|
64
70
|
"react": "^19.3.1",
|
|
65
71
|
"react-dom": "^19.3.1",
|
|
66
72
|
"react-router-dom": "^7.18.5",
|
|
67
73
|
"typescript": "^6.0.3",
|
|
68
|
-
"vitest": "^5.1.0"
|
|
69
|
-
|
|
74
|
+
"vitest": "^5.1.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@grafana/faro-web-sdk": "^2.14.0",
|
|
78
|
+
"@grafana/faro-web-tracing": "^2.14.0"
|
|
70
79
|
}
|
|
71
80
|
}
|