@grafana/faro-web-sdk
Advanced tools
Comparing version 1.7.3 to 1.8.0
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
} |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class PerformanceInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-performance"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
private getIgnoreUrls; | ||
} |
@@ -1,3 +0,2 @@ | ||
export declare const NAVIGATION_ID_STORAGE_KEY = "com.grafana.faro.lastNavigationId"; | ||
export declare const NAVIGATION_ENTRY = "navigation"; | ||
export declare const RESOURCE_ENTRY = "resource"; |
@@ -0,2 +1,5 @@ | ||
import { type PushEventOptions } from '@grafana/faro-core'; | ||
import type { FaroNavigationTiming, FaroResourceTiming } from './types'; | ||
type SpanContext = PushEventOptions['spanContext']; | ||
export declare function getSpanContextFromServerTiming(serverTimings?: PerformanceServerTiming[]): SpanContext | undefined; | ||
export declare function performanceObserverSupported(): boolean; | ||
@@ -3,0 +6,0 @@ export declare function entryUrlIsIgnored(ignoredUrls: (string | RegExp)[] | undefined, entryName: string): boolean; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
@@ -6,4 +6,7 @@ import type { Config } from '@grafana/faro-core'; | ||
export declare const STORAGE_UPDATE_DELAY: number; | ||
/** | ||
* @deprecated MAX_SESSION_PERSISTENCE_TIME_BUFFER is not used anymore. The constant will be removed in the future | ||
*/ | ||
export declare const MAX_SESSION_PERSISTENCE_TIME_BUFFER: number; | ||
export declare const MAX_SESSION_PERSISTENCE_TIME: number; | ||
export declare const defaultSessionTrackingConfig: Config['sessionTracking']; |
@@ -1,2 +0,3 @@ | ||
import type { FaroUserSession } from './types'; | ||
import type { Config } from '@grafana/faro-core'; | ||
import type { FaroUserSession, SessionManager } from './types'; | ||
type CreateUserSessionObjectParams = { | ||
@@ -14,4 +15,8 @@ sessionId?: string; | ||
}; | ||
export declare function getUserSessionUpdater({ fetchUserSession, storeUserSession }: GetUserSessionUpdaterParams): () => void; | ||
type UpdateSessionParams = { | ||
forceSessionExtend: boolean; | ||
}; | ||
export declare function getUserSessionUpdater({ fetchUserSession, storeUserSession, }: GetUserSessionUpdaterParams): (options?: UpdateSessionParams) => void; | ||
export declare function addSessionMetadataToNextSession(newSession: FaroUserSession, previousSession: FaroUserSession | null): Required<FaroUserSession>; | ||
export declare function getSessionManagerByConfig(sessionTrackingConfig: Config['sessionTracking']): SessionManager; | ||
export {}; |
import type { MetaSession } from '@grafana/faro-core'; | ||
import type { PersistentSessionsManager } from './PersistentSessionsManager'; | ||
import type { VolatileSessionsManager } from './VolatileSessionManager'; | ||
export interface FaroUserSession { | ||
@@ -9,1 +11,2 @@ sessionId: string; | ||
} | ||
export type SessionManager = typeof VolatileSessionsManager | typeof PersistentSessionsManager; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.7.3"; | ||
static mapping: { | ||
cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
fcp: (onReport: import("web-vitals").FCPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
fid: (onReport: import("web-vitals").FIDReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
inp: (onReport: import("web-vitals").INPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
lcp: (onReport: import("web-vitals").LCPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
ttfb: (onReport: import("web-vitals").TTFBReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
}; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
private intializeWebVitalsInstrumentation; | ||
} |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -18,2 +18,3 @@ private readonly rateLimitBackoffMs; | ||
private getRetryAfterDate; | ||
private extendFaroSession; | ||
} |
@@ -33,3 +33,3 @@ "use strict"; | ||
function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var transports = []; | ||
@@ -71,10 +71,11 @@ var internalLogger = (0, faro_core_1.createInternalLogger)(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
isolate: (_d = browserConfig.isolate) !== null && _d !== void 0 ? _d : false, | ||
logArgsSerializer: (_e = browserConfig.logArgsSerializer) !== null && _e !== void 0 ? _e : faro_core_1.defaultLogArgsSerializer, | ||
metas: createMetas(), | ||
parseStacktrace: instrumentations_1.parseStacktrace, | ||
paused: (_e = browserConfig.paused) !== null && _e !== void 0 ? _e : false, | ||
preventGlobalExposure: (_f = browserConfig.preventGlobalExposure) !== null && _f !== void 0 ? _f : false, | ||
paused: (_f = browserConfig.paused) !== null && _f !== void 0 ? _f : false, | ||
preventGlobalExposure: (_g = browserConfig.preventGlobalExposure) !== null && _g !== void 0 ? _g : false, | ||
transports: transports, | ||
unpatchedConsole: (_g = browserConfig.unpatchedConsole) !== null && _g !== void 0 ? _g : faro_core_1.defaultUnpatchedConsole, | ||
unpatchedConsole: (_h = browserConfig.unpatchedConsole) !== null && _h !== void 0 ? _h : faro_core_1.defaultUnpatchedConsole, | ||
beforeSend: browserConfig.beforeSend, | ||
eventDomain: (_h = browserConfig.eventDomain) !== null && _h !== void 0 ? _h : consts_1.defaultEventDomain, | ||
eventDomain: (_j = browserConfig.eventDomain) !== null && _j !== void 0 ? _j : consts_1.defaultEventDomain, | ||
ignoreErrors: browserConfig.ignoreErrors, | ||
@@ -84,4 +85,5 @@ ignoreUrls: browserConfig.ignoreUrls, | ||
user: browserConfig.user, | ||
view: (_j = browserConfig.view) !== null && _j !== void 0 ? _j : metas_1.defaultViewMeta, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : metas_1.defaultViewMeta, | ||
trackResources: browserConfig.trackResources, | ||
trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution, | ||
}; | ||
@@ -88,0 +90,0 @@ return config; |
@@ -17,2 +17,3 @@ "use strict"; | ||
var utils_1 = require("../../utils"); | ||
var instrumentationConstants_1 = require("../instrumentationConstants"); | ||
var performanceConstants_1 = require("./performanceConstants"); | ||
@@ -31,6 +32,8 @@ var performanceUtils_1 = require("./performanceUtils"); | ||
} | ||
var faroPreviousNavigationId = (_a = (0, utils_1.getItem)(performanceConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
var faroNavigationEntry = __assign(__assign({}, (0, performanceUtils_1.createFaroNavigationTiming)(navigationEntryRaw.toJSON())), { faroNavigationId: (0, faro_core_1.genShortID)(), faroPreviousNavigationId: faroPreviousNavigationId }); | ||
(0, utils_1.setItem)(performanceConstants_1.NAVIGATION_ID_STORAGE_KEY, faroNavigationEntry.faroNavigationId, utils_1.webStorageType.session); | ||
pushEvent('faro.performance.navigation', faroNavigationEntry); | ||
var navEntryJson = navigationEntryRaw.toJSON(); | ||
var spanContext = (0, performanceUtils_1.getSpanContextFromServerTiming)(navEntryJson === null || navEntryJson === void 0 ? void 0 : navEntryJson.serverTiming); | ||
var faroPreviousNavigationId = (_a = (0, utils_1.getItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, utils_1.webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
var faroNavigationEntry = __assign(__assign({}, (0, performanceUtils_1.createFaroNavigationTiming)(navEntryJson)), { faroNavigationId: (0, faro_core_1.genShortID)(), faroPreviousNavigationId: faroPreviousNavigationId }); | ||
(0, utils_1.setItem)(instrumentationConstants_1.NAVIGATION_ID_STORAGE_KEY, faroNavigationEntry.faroNavigationId, utils_1.webStorageType.session); | ||
pushEvent('faro.performance.navigation', faroNavigationEntry, undefined, { spanContext: spanContext }); | ||
faroNavigationEntryResolve(faroNavigationEntry); | ||
@@ -37,0 +40,0 @@ }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RESOURCE_ENTRY = exports.NAVIGATION_ENTRY = exports.NAVIGATION_ID_STORAGE_KEY = void 0; | ||
exports.NAVIGATION_ID_STORAGE_KEY = 'com.grafana.faro.lastNavigationId'; | ||
exports.RESOURCE_ENTRY = exports.NAVIGATION_ENTRY = void 0; | ||
exports.NAVIGATION_ENTRY = 'navigation'; | ||
exports.RESOURCE_ENTRY = 'resource'; | ||
//# sourceMappingURL=performanceConstants.js.map |
@@ -14,4 +14,24 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createFaroNavigationTiming = exports.createFaroResourceTiming = exports.includePerformanceEntry = exports.onDocumentReady = exports.entryUrlIsIgnored = exports.performanceObserverSupported = void 0; | ||
exports.createFaroNavigationTiming = exports.createFaroResourceTiming = exports.includePerformanceEntry = exports.onDocumentReady = exports.entryUrlIsIgnored = exports.performanceObserverSupported = exports.getSpanContextFromServerTiming = void 0; | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var w3cTraceparentFormat = /^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/; | ||
// Extract traceparent from serverTiming, if present | ||
function getSpanContextFromServerTiming(serverTimings) { | ||
if (serverTimings === void 0) { serverTimings = []; } | ||
for (var _i = 0, serverTimings_1 = serverTimings; _i < serverTimings_1.length; _i++) { | ||
var serverEntry = serverTimings_1[_i]; | ||
if (serverEntry.name === 'traceparent') { | ||
if (!w3cTraceparentFormat.test(serverEntry.description)) { | ||
continue; | ||
} | ||
var _a = serverEntry.description.split('-'), traceId = _a[1], spanId = _a[2]; | ||
if (traceId != null && spanId != null) { | ||
return { traceId: traceId, spanId: spanId }; | ||
} | ||
break; | ||
} | ||
} | ||
return undefined; | ||
} | ||
exports.getSpanContextFromServerTiming = getSpanContextFromServerTiming; | ||
function performanceObserverSupported() { | ||
@@ -18,0 +38,0 @@ return 'PerformanceObserver' in window; |
@@ -28,3 +28,9 @@ "use strict"; | ||
decodedBodySize: 530675, | ||
serverTiming: [], | ||
serverTiming: [ | ||
{ | ||
name: 'traceparent', | ||
duration: 0, | ||
description: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', | ||
}, | ||
], | ||
unloadEventStart: 0, | ||
@@ -66,2 +72,7 @@ unloadEventEnd: 0, | ||
{ | ||
name: 'traceparent', | ||
duration: 0, | ||
description: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', | ||
}, | ||
{ | ||
name: 'foo', | ||
@@ -68,0 +79,0 @@ duration: 0, |
@@ -29,6 +29,7 @@ "use strict"; | ||
var resourceEntryRawJSON = resourceEntryRaw.toJSON(); | ||
var spanContext = (0, performanceUtils_1.getSpanContextFromServerTiming)(resourceEntryRawJSON === null || resourceEntryRawJSON === void 0 ? void 0 : resourceEntryRawJSON.serverTiming); | ||
if ((trackResources == null && (0, performanceUtils_1.includePerformanceEntry)(resourceEntryRawJSON, DEFAULT_TRACK_RESOURCES)) || | ||
trackResources) { | ||
var faroResourceEntry = __assign(__assign({}, (0, performanceUtils_1.createFaroResourceTiming)(resourceEntryRawJSON)), { faroNavigationId: faroNavigationId, faroResourceId: (0, faro_core_1.genShortID)() }); | ||
pushEvent('faro.performance.resource', faroResourceEntry); | ||
pushEvent('faro.performance.resource', faroResourceEntry, undefined, { spanContext: spanContext }); | ||
} | ||
@@ -35,0 +36,0 @@ } |
@@ -35,3 +35,2 @@ "use strict"; | ||
var sessionManagerUtils_1 = require("./sessionManager/sessionManagerUtils"); | ||
var VolatileSessionManager_1 = require("./sessionManager/VolatileSessionManager"); | ||
var SessionInstrumentation = /** @class */ (function (_super) { | ||
@@ -125,3 +124,3 @@ __extends(SessionInstrumentation, _super); | ||
if (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.enabled) { | ||
var SessionManager = (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.persistent) ? PersistentSessionsManager_1.PersistentSessionsManager : VolatileSessionManager_1.VolatileSessionsManager; | ||
var SessionManager = (0, sessionManagerUtils_1.getSessionManagerByConfig)(sessionTrackingConfig); | ||
this.registerBeforeSendHook(SessionManager); | ||
@@ -128,0 +127,0 @@ var _a = this.createInitialSession(SessionManager, sessionTrackingConfig), initialSession = _a.initialSession, lifecycleType = _a.lifecycleType; |
@@ -8,4 +8,7 @@ "use strict"; | ||
exports.STORAGE_UPDATE_DELAY = 1 * 1000; // seconds | ||
/** | ||
* @deprecated MAX_SESSION_PERSISTENCE_TIME_BUFFER is not used anymore. The constant will be removed in the future | ||
*/ | ||
exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER = 1 * 60 * 1000; | ||
exports.MAX_SESSION_PERSISTENCE_TIME = exports.SESSION_INACTIVITY_TIME + exports.MAX_SESSION_PERSISTENCE_TIME_BUFFER; | ||
exports.MAX_SESSION_PERSISTENCE_TIME = exports.SESSION_INACTIVITY_TIME; | ||
exports.defaultSessionTrackingConfig = { | ||
@@ -12,0 +15,0 @@ enabled: true, |
@@ -14,5 +14,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addSessionMetadataToNextSession = exports.getUserSessionUpdater = exports.isUserSessionValid = exports.createUserSessionObject = void 0; | ||
exports.getSessionManagerByConfig = exports.addSessionMetadataToNextSession = exports.getUserSessionUpdater = exports.isUserSessionValid = exports.createUserSessionObject = void 0; | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var utils_1 = require("../../../utils"); | ||
var _1 = require("."); | ||
var sampling_1 = require("./sampling"); | ||
@@ -51,4 +52,5 @@ var sessionConstants_1 = require("./sessionConstants"); | ||
var fetchUserSession = _a.fetchUserSession, storeUserSession = _a.storeUserSession; | ||
return function updateSession() { | ||
var _a, _b, _c; | ||
return function updateSession(_a) { | ||
var _b, _c, _d; | ||
var _e = _a === void 0 ? { forceSessionExtend: false } : _a, forceSessionExtend = _e.forceSessionExtend; | ||
if (!fetchUserSession || !storeUserSession) { | ||
@@ -63,3 +65,3 @@ return; | ||
var sessionFromStorage = fetchUserSession(); | ||
if (isUserSessionValid(sessionFromStorage)) { | ||
if (forceSessionExtend === false && isUserSessionValid(sessionFromStorage)) { | ||
storeUserSession(__assign(__assign({}, sessionFromStorage), { lastActivity: (0, faro_core_1.dateNow)() })); | ||
@@ -70,4 +72,4 @@ } | ||
storeUserSession(newSession); | ||
(_a = faro_core_1.faro.api) === null || _a === void 0 ? void 0 : _a.setSession(newSession.sessionMeta); | ||
(_b = sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.onSessionChange) === null || _b === void 0 ? void 0 : _b.call(sessionTrackingConfig, (_c = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _c !== void 0 ? _c : null, newSession.sessionMeta); | ||
(_b = faro_core_1.faro.api) === null || _b === void 0 ? void 0 : _b.setSession(newSession.sessionMeta); | ||
(_c = sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.onSessionChange) === null || _c === void 0 ? void 0 : _c.call(sessionTrackingConfig, (_d = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _d !== void 0 ? _d : null, newSession.sessionMeta); | ||
} | ||
@@ -86,2 +88,6 @@ }; | ||
exports.addSessionMetadataToNextSession = addSessionMetadataToNextSession; | ||
function getSessionManagerByConfig(sessionTrackingConfig) { | ||
return (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.persistent) ? _1.PersistentSessionsManager : _1.VolatileSessionsManager; | ||
} | ||
exports.getSessionManagerByConfig = getSessionManagerByConfig; | ||
//# sourceMappingURL=sessionManagerUtils.js.map |
@@ -19,4 +19,5 @@ "use strict"; | ||
exports.WebVitalsInstrumentation = void 0; | ||
var web_vitals_1 = require("web-vitals"); | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var webVitalsBasic_1 = require("./webVitalsBasic"); | ||
var webVitalsWithAttribution_1 = require("./webVitalsWithAttribution"); | ||
var WebVitalsInstrumentation = /** @class */ (function (_super) { | ||
@@ -31,24 +32,11 @@ __extends(WebVitalsInstrumentation, _super); | ||
WebVitalsInstrumentation.prototype.initialize = function () { | ||
var _this = this; | ||
this.logDebug('Initializing'); | ||
Object.entries(WebVitalsInstrumentation.mapping).forEach(function (_a) { | ||
var indicator = _a[0], executor = _a[1]; | ||
executor(function (metric) { | ||
var _a; | ||
_this.api.pushMeasurement({ | ||
type: 'web-vitals', | ||
values: (_a = {}, | ||
_a[indicator] = metric.value, | ||
_a), | ||
}); | ||
}); | ||
}); | ||
var webVitals = this.intializeWebVitalsInstrumentation(); | ||
webVitals.initialize(); | ||
}; | ||
WebVitalsInstrumentation.mapping = { | ||
cls: web_vitals_1.onCLS, | ||
fcp: web_vitals_1.onFCP, | ||
fid: web_vitals_1.onFID, | ||
inp: web_vitals_1.onINP, | ||
lcp: web_vitals_1.onLCP, | ||
ttfb: web_vitals_1.onTTFB, | ||
WebVitalsInstrumentation.prototype.intializeWebVitalsInstrumentation = function () { | ||
if (this.config.trackWebVitalsAttribution) { | ||
return new webVitalsWithAttribution_1.WebVitalsWithAttribution(this.api.pushMeasurement); | ||
} | ||
return new webVitalsBasic_1.WebVitalsBasic(this.api.pushMeasurement); | ||
}; | ||
@@ -55,0 +43,0 @@ return WebVitalsInstrumentation; |
@@ -78,2 +78,3 @@ "use strict"; | ||
var faro_core_1 = require("@grafana/faro-core"); | ||
var sessionManagerUtils_1 = require("../../instrumentations/session/sessionManager/sessionManagerUtils"); | ||
var DEFAULT_BUFFER_SIZE = 30; | ||
@@ -84,2 +85,3 @@ var DEFAULT_CONCURRENCY = 5; // chrome supports 10 total, firefox 17 | ||
var TOO_MANY_REQUESTS = 429; | ||
var ACCEPTED = 202; | ||
var FetchTransport = /** @class */ (function (_super) { | ||
@@ -125,11 +127,20 @@ __extends(FetchTransport, _super); | ||
return fetch(url, __assign({ method: 'POST', headers: __assign(__assign(__assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (sessionId ? { 'x-faro-session-id': sessionId } : {})), body: body, keepalive: body.length <= BEACON_BODY_SIZE_LIMIT }, (restOfRequestOptions !== null && restOfRequestOptions !== void 0 ? restOfRequestOptions : {}))) | ||
.then(function (response) { | ||
if (response.status === TOO_MANY_REQUESTS) { | ||
_this.disabledUntil = _this.getRetryAfterDate(response); | ||
_this.logWarn("Too many requests, backing off until ".concat(_this.disabledUntil)); | ||
} | ||
// read the body so the connection can be closed | ||
response.text().catch(faro_core_1.noop); | ||
return response; | ||
}) | ||
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { | ||
var sessionExpired; | ||
return __generator(this, function (_a) { | ||
if (response.status === ACCEPTED) { | ||
sessionExpired = response.headers.get('X-Faro-Session-Status') === 'invalid'; | ||
if (sessionExpired) { | ||
this.extendFaroSession(this.config, this.logDebug); | ||
} | ||
} | ||
if (response.status === TOO_MANY_REQUESTS) { | ||
this.disabledUntil = this.getRetryAfterDate(response); | ||
this.logWarn("Too many requests, backing off until ".concat(this.disabledUntil)); | ||
} | ||
// read the body so the connection can be closed | ||
response.text().catch(faro_core_1.noop); | ||
return [2 /*return*/, response]; | ||
}); | ||
}); }) | ||
.catch(function (err) { | ||
@@ -173,2 +184,14 @@ _this.logError('Failed sending payload to the receiver\n', JSON.parse(body), err); | ||
}; | ||
FetchTransport.prototype.extendFaroSession = function (config, logDebug) { | ||
var SessionExpiredString = "Session expired"; | ||
var sessionTrackingConfig = config.sessionTracking; | ||
if (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.enabled) { | ||
var _a = (0, sessionManagerUtils_1.getSessionManagerByConfig)(sessionTrackingConfig), fetchUserSession = _a.fetchUserSession, storeUserSession = _a.storeUserSession; | ||
(0, sessionManagerUtils_1.getUserSessionUpdater)({ fetchUserSession: fetchUserSession, storeUserSession: storeUserSession })({ forceSessionExtend: true }); | ||
logDebug("".concat(SessionExpiredString, " created new session.")); | ||
} | ||
else { | ||
logDebug("".concat(SessionExpiredString, ".")); | ||
} | ||
}; | ||
return FetchTransport; | ||
@@ -175,0 +198,0 @@ }(faro_core_1.BaseTransport)); |
@@ -1,2 +0,2 @@ | ||
import { createInternalLogger, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core'; | ||
import { createInternalLogger, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogArgsSerializer, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core'; | ||
import { defaultEventDomain } from '../consts'; | ||
@@ -10,3 +10,3 @@ import { parseStacktrace } from '../instrumentations'; | ||
export function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
const transports = []; | ||
@@ -48,10 +48,11 @@ const internalLogger = createInternalLogger(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
isolate: (_d = browserConfig.isolate) !== null && _d !== void 0 ? _d : false, | ||
logArgsSerializer: (_e = browserConfig.logArgsSerializer) !== null && _e !== void 0 ? _e : defaultLogArgsSerializer, | ||
metas: createMetas(), | ||
parseStacktrace, | ||
paused: (_e = browserConfig.paused) !== null && _e !== void 0 ? _e : false, | ||
preventGlobalExposure: (_f = browserConfig.preventGlobalExposure) !== null && _f !== void 0 ? _f : false, | ||
paused: (_f = browserConfig.paused) !== null && _f !== void 0 ? _f : false, | ||
preventGlobalExposure: (_g = browserConfig.preventGlobalExposure) !== null && _g !== void 0 ? _g : false, | ||
transports, | ||
unpatchedConsole: (_g = browserConfig.unpatchedConsole) !== null && _g !== void 0 ? _g : defaultUnpatchedConsole, | ||
unpatchedConsole: (_h = browserConfig.unpatchedConsole) !== null && _h !== void 0 ? _h : defaultUnpatchedConsole, | ||
beforeSend: browserConfig.beforeSend, | ||
eventDomain: (_h = browserConfig.eventDomain) !== null && _h !== void 0 ? _h : defaultEventDomain, | ||
eventDomain: (_j = browserConfig.eventDomain) !== null && _j !== void 0 ? _j : defaultEventDomain, | ||
ignoreErrors: browserConfig.ignoreErrors, | ||
@@ -61,4 +62,5 @@ ignoreUrls: browserConfig.ignoreUrls, | ||
user: browserConfig.user, | ||
view: (_j = browserConfig.view) !== null && _j !== void 0 ? _j : defaultViewMeta, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : defaultViewMeta, | ||
trackResources: browserConfig.trackResources, | ||
trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution, | ||
}; | ||
@@ -65,0 +67,0 @@ return config; |
import { genShortID } from '@grafana/faro-core'; | ||
import { getItem, setItem, webStorageType } from '../../utils'; | ||
import { NAVIGATION_ENTRY, NAVIGATION_ID_STORAGE_KEY } from './performanceConstants'; | ||
import { createFaroNavigationTiming, entryUrlIsIgnored } from './performanceUtils'; | ||
import { NAVIGATION_ID_STORAGE_KEY } from '../instrumentationConstants'; | ||
import { NAVIGATION_ENTRY } from './performanceConstants'; | ||
import { createFaroNavigationTiming, entryUrlIsIgnored, getSpanContextFromServerTiming } from './performanceUtils'; | ||
export function getNavigationTimings(pushEvent, ignoredUrls) { | ||
@@ -16,6 +17,8 @@ let faroNavigationEntryResolve; | ||
} | ||
const navEntryJson = navigationEntryRaw.toJSON(); | ||
let spanContext = getSpanContextFromServerTiming(navEntryJson === null || navEntryJson === void 0 ? void 0 : navEntryJson.serverTiming); | ||
const faroPreviousNavigationId = (_a = getItem(NAVIGATION_ID_STORAGE_KEY, webStorageType.session)) !== null && _a !== void 0 ? _a : 'unknown'; | ||
const faroNavigationEntry = Object.assign(Object.assign({}, createFaroNavigationTiming(navigationEntryRaw.toJSON())), { faroNavigationId: genShortID(), faroPreviousNavigationId }); | ||
const faroNavigationEntry = Object.assign(Object.assign({}, createFaroNavigationTiming(navEntryJson)), { faroNavigationId: genShortID(), faroPreviousNavigationId }); | ||
setItem(NAVIGATION_ID_STORAGE_KEY, faroNavigationEntry.faroNavigationId, webStorageType.session); | ||
pushEvent('faro.performance.navigation', faroNavigationEntry); | ||
pushEvent('faro.performance.navigation', faroNavigationEntry, undefined, { spanContext }); | ||
faroNavigationEntryResolve(faroNavigationEntry); | ||
@@ -22,0 +25,0 @@ }); |
@@ -1,4 +0,3 @@ | ||
export const NAVIGATION_ID_STORAGE_KEY = 'com.grafana.faro.lastNavigationId'; | ||
export const NAVIGATION_ENTRY = 'navigation'; | ||
export const RESOURCE_ENTRY = 'resource'; | ||
//# sourceMappingURL=performanceConstants.js.map |
import { isArray } from '@grafana/faro-core'; | ||
const w3cTraceparentFormat = /^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/; | ||
// Extract traceparent from serverTiming, if present | ||
export function getSpanContextFromServerTiming(serverTimings = []) { | ||
for (const serverEntry of serverTimings) { | ||
if (serverEntry.name === 'traceparent') { | ||
if (!w3cTraceparentFormat.test(serverEntry.description)) { | ||
continue; | ||
} | ||
const [, traceId, spanId] = serverEntry.description.split('-'); | ||
if (traceId != null && spanId != null) { | ||
return { traceId, spanId }; | ||
} | ||
break; | ||
} | ||
} | ||
return undefined; | ||
} | ||
export function performanceObserverSupported() { | ||
@@ -3,0 +20,0 @@ return 'PerformanceObserver' in window; |
@@ -25,3 +25,9 @@ // the values of this timings are contrived for testing.They do not necessarily reflect reality. | ||
decodedBodySize: 530675, | ||
serverTiming: [], | ||
serverTiming: [ | ||
{ | ||
name: 'traceparent', | ||
duration: 0, | ||
description: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', | ||
}, | ||
], | ||
unloadEventStart: 0, | ||
@@ -63,2 +69,7 @@ unloadEventEnd: 0, | ||
{ | ||
name: 'traceparent', | ||
duration: 0, | ||
description: '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01', | ||
}, | ||
{ | ||
name: 'foo', | ||
@@ -65,0 +76,0 @@ duration: 0, |
import { faro, genShortID } from '@grafana/faro-core'; | ||
import { RESOURCE_ENTRY } from './performanceConstants'; | ||
import { createFaroResourceTiming, entryUrlIsIgnored, includePerformanceEntry } from './performanceUtils'; | ||
import { createFaroResourceTiming, entryUrlIsIgnored, getSpanContextFromServerTiming, includePerformanceEntry, } from './performanceUtils'; | ||
const DEFAULT_TRACK_RESOURCES = { initiatorType: ['xmlhttprequest', 'fetch'] }; | ||
@@ -14,6 +14,7 @@ export function observeResourceTimings(faroNavigationId, pushEvent, ignoredUrls) { | ||
const resourceEntryRawJSON = resourceEntryRaw.toJSON(); | ||
let spanContext = getSpanContextFromServerTiming(resourceEntryRawJSON === null || resourceEntryRawJSON === void 0 ? void 0 : resourceEntryRawJSON.serverTiming); | ||
if ((trackResources == null && includePerformanceEntry(resourceEntryRawJSON, DEFAULT_TRACK_RESOURCES)) || | ||
trackResources) { | ||
const faroResourceEntry = Object.assign(Object.assign({}, createFaroResourceTiming(resourceEntryRawJSON)), { faroNavigationId, faroResourceId: genShortID() }); | ||
pushEvent('faro.performance.resource', faroResourceEntry); | ||
pushEvent('faro.performance.resource', faroResourceEntry, undefined, { spanContext }); | ||
} | ||
@@ -20,0 +21,0 @@ } |
@@ -5,4 +5,3 @@ import { BaseInstrumentation, dateNow, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, VERSION, } from '@grafana/faro-core'; | ||
import { PersistentSessionsManager } from './sessionManager/PersistentSessionsManager'; | ||
import { createUserSessionObject, isUserSessionValid } from './sessionManager/sessionManagerUtils'; | ||
import { VolatileSessionsManager } from './sessionManager/VolatileSessionManager'; | ||
import { createUserSessionObject, getSessionManagerByConfig, isUserSessionValid, } from './sessionManager/sessionManagerUtils'; | ||
export class SessionInstrumentation extends BaseInstrumentation { | ||
@@ -94,3 +93,3 @@ constructor() { | ||
if (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.enabled) { | ||
const SessionManager = (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.persistent) ? PersistentSessionsManager : VolatileSessionsManager; | ||
const SessionManager = getSessionManagerByConfig(sessionTrackingConfig); | ||
this.registerBeforeSendHook(SessionManager); | ||
@@ -97,0 +96,0 @@ const { initialSession, lifecycleType } = this.createInitialSession(SessionManager, sessionTrackingConfig); |
@@ -5,4 +5,7 @@ export const STORAGE_KEY = 'com.grafana.faro.session'; | ||
export const STORAGE_UPDATE_DELAY = 1 * 1000; // seconds | ||
/** | ||
* @deprecated MAX_SESSION_PERSISTENCE_TIME_BUFFER is not used anymore. The constant will be removed in the future | ||
*/ | ||
export const MAX_SESSION_PERSISTENCE_TIME_BUFFER = 1 * 60 * 1000; | ||
export const MAX_SESSION_PERSISTENCE_TIME = SESSION_INACTIVITY_TIME + MAX_SESSION_PERSISTENCE_TIME_BUFFER; | ||
export const MAX_SESSION_PERSISTENCE_TIME = SESSION_INACTIVITY_TIME; | ||
export const defaultSessionTrackingConfig = { | ||
@@ -9,0 +12,0 @@ enabled: true, |
import { dateNow, faro, genShortID } from '@grafana/faro-core'; | ||
import { isLocalStorageAvailable, isSessionStorageAvailable } from '../../../utils'; | ||
import { PersistentSessionsManager, VolatileSessionsManager } from '.'; | ||
import { isSampled } from './sampling'; | ||
@@ -31,4 +32,4 @@ import { SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME } from './sessionConstants'; | ||
} | ||
export function getUserSessionUpdater({ fetchUserSession, storeUserSession }) { | ||
return function updateSession() { | ||
export function getUserSessionUpdater({ fetchUserSession, storeUserSession, }) { | ||
return function updateSession({ forceSessionExtend } = { forceSessionExtend: false }) { | ||
var _a, _b, _c; | ||
@@ -44,3 +45,3 @@ if (!fetchUserSession || !storeUserSession) { | ||
const sessionFromStorage = fetchUserSession(); | ||
if (isUserSessionValid(sessionFromStorage)) { | ||
if (forceSessionExtend === false && isUserSessionValid(sessionFromStorage)) { | ||
storeUserSession(Object.assign(Object.assign({}, sessionFromStorage), { lastActivity: dateNow() })); | ||
@@ -64,2 +65,5 @@ } | ||
} | ||
export function getSessionManagerByConfig(sessionTrackingConfig) { | ||
return (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.persistent) ? PersistentSessionsManager : VolatileSessionsManager; | ||
} | ||
//# sourceMappingURL=sessionManagerUtils.js.map |
@@ -1,3 +0,4 @@ | ||
import { onCLS, onFCP, onFID, onINP, onLCP, onTTFB } from 'web-vitals'; | ||
import { BaseInstrumentation, VERSION } from '@grafana/faro-core'; | ||
import { WebVitalsBasic } from './webVitalsBasic'; | ||
import { WebVitalsWithAttribution } from './webVitalsWithAttribution'; | ||
export class WebVitalsInstrumentation extends BaseInstrumentation { | ||
@@ -11,22 +12,12 @@ constructor() { | ||
this.logDebug('Initializing'); | ||
Object.entries(WebVitalsInstrumentation.mapping).forEach(([indicator, executor]) => { | ||
executor((metric) => { | ||
this.api.pushMeasurement({ | ||
type: 'web-vitals', | ||
values: { | ||
[indicator]: metric.value, | ||
}, | ||
}); | ||
}); | ||
}); | ||
const webVitals = this.intializeWebVitalsInstrumentation(); | ||
webVitals.initialize(); | ||
} | ||
intializeWebVitalsInstrumentation() { | ||
if (this.config.trackWebVitalsAttribution) { | ||
return new WebVitalsWithAttribution(this.api.pushMeasurement); | ||
} | ||
return new WebVitalsBasic(this.api.pushMeasurement); | ||
} | ||
} | ||
WebVitalsInstrumentation.mapping = { | ||
cls: onCLS, | ||
fcp: onFCP, | ||
fid: onFID, | ||
inp: onINP, | ||
lcp: onLCP, | ||
ttfb: onTTFB, | ||
}; | ||
//# sourceMappingURL=instrumentation.js.map |
@@ -21,3 +21,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { BaseTransport, createPromiseBuffer, getTransportBody, noop, VERSION } from '@grafana/faro-core'; | ||
import { BaseTransport, createPromiseBuffer, getTransportBody, noop, VERSION, } from '@grafana/faro-core'; | ||
import { getSessionManagerByConfig, getUserSessionUpdater, } from '../../instrumentations/session/sessionManager/sessionManagerUtils'; | ||
const DEFAULT_BUFFER_SIZE = 30; | ||
@@ -28,2 +29,3 @@ const DEFAULT_CONCURRENCY = 5; // chrome supports 10 total, firefox 17 | ||
const TOO_MANY_REQUESTS = 429; | ||
const ACCEPTED = 202; | ||
export class FetchTransport extends BaseTransport { | ||
@@ -61,3 +63,9 @@ constructor(options) { | ||
return fetch(url, Object.assign({ method: 'POST', headers: Object.assign(Object.assign(Object.assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (sessionId ? { 'x-faro-session-id': sessionId } : {})), body, keepalive: body.length <= BEACON_BODY_SIZE_LIMIT }, (restOfRequestOptions !== null && restOfRequestOptions !== void 0 ? restOfRequestOptions : {}))) | ||
.then((response) => { | ||
.then((response) => __awaiter(this, void 0, void 0, function* () { | ||
if (response.status === ACCEPTED) { | ||
const sessionExpired = response.headers.get('X-Faro-Session-Status') === 'invalid'; | ||
if (sessionExpired) { | ||
this.extendFaroSession(this.config, this.logDebug); | ||
} | ||
} | ||
if (response.status === TOO_MANY_REQUESTS) { | ||
@@ -70,3 +78,3 @@ this.disabledUntil = this.getRetryAfterDate(response); | ||
return response; | ||
}) | ||
})) | ||
.catch((err) => { | ||
@@ -104,3 +112,15 @@ this.logError('Failed sending payload to the receiver\n', JSON.parse(body), err); | ||
} | ||
extendFaroSession(config, logDebug) { | ||
const SessionExpiredString = `Session expired`; | ||
const sessionTrackingConfig = config.sessionTracking; | ||
if (sessionTrackingConfig === null || sessionTrackingConfig === void 0 ? void 0 : sessionTrackingConfig.enabled) { | ||
const { fetchUserSession, storeUserSession } = getSessionManagerByConfig(sessionTrackingConfig); | ||
getUserSessionUpdater({ fetchUserSession, storeUserSession })({ forceSessionExtend: true }); | ||
logDebug(`${SessionExpiredString} created new session.`); | ||
} | ||
else { | ||
logDebug(`${SessionExpiredString}.`); | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=transport.js.map |
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
} |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class PerformanceInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-performance"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
private getIgnoreUrls; | ||
} |
@@ -1,3 +0,2 @@ | ||
export declare const NAVIGATION_ID_STORAGE_KEY = "com.grafana.faro.lastNavigationId"; | ||
export declare const NAVIGATION_ENTRY = "navigation"; | ||
export declare const RESOURCE_ENTRY = "resource"; |
@@ -0,2 +1,5 @@ | ||
import { type PushEventOptions } from '@grafana/faro-core'; | ||
import type { FaroNavigationTiming, FaroResourceTiming } from './types'; | ||
type SpanContext = PushEventOptions['spanContext']; | ||
export declare function getSpanContextFromServerTiming(serverTimings?: PerformanceServerTiming[]): SpanContext | undefined; | ||
export declare function performanceObserverSupported(): boolean; | ||
@@ -3,0 +6,0 @@ export declare function entryUrlIsIgnored(ignoredUrls: (string | RegExp)[] | undefined, entryName: string): boolean; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
@@ -6,4 +6,7 @@ import type { Config } from '@grafana/faro-core'; | ||
export declare const STORAGE_UPDATE_DELAY: number; | ||
/** | ||
* @deprecated MAX_SESSION_PERSISTENCE_TIME_BUFFER is not used anymore. The constant will be removed in the future | ||
*/ | ||
export declare const MAX_SESSION_PERSISTENCE_TIME_BUFFER: number; | ||
export declare const MAX_SESSION_PERSISTENCE_TIME: number; | ||
export declare const defaultSessionTrackingConfig: Config['sessionTracking']; |
@@ -1,2 +0,3 @@ | ||
import type { FaroUserSession } from './types'; | ||
import type { Config } from '@grafana/faro-core'; | ||
import type { FaroUserSession, SessionManager } from './types'; | ||
type CreateUserSessionObjectParams = { | ||
@@ -14,4 +15,8 @@ sessionId?: string; | ||
}; | ||
export declare function getUserSessionUpdater({ fetchUserSession, storeUserSession }: GetUserSessionUpdaterParams): () => void; | ||
type UpdateSessionParams = { | ||
forceSessionExtend: boolean; | ||
}; | ||
export declare function getUserSessionUpdater({ fetchUserSession, storeUserSession, }: GetUserSessionUpdaterParams): (options?: UpdateSessionParams) => void; | ||
export declare function addSessionMetadataToNextSession(newSession: FaroUserSession, previousSession: FaroUserSession | null): Required<FaroUserSession>; | ||
export declare function getSessionManagerByConfig(sessionTrackingConfig: Config['sessionTracking']): SessionManager; | ||
export {}; |
import type { MetaSession } from '@grafana/faro-core'; | ||
import type { PersistentSessionsManager } from './PersistentSessionsManager'; | ||
import type { VolatileSessionsManager } from './VolatileSessionManager'; | ||
export interface FaroUserSession { | ||
@@ -9,1 +11,2 @@ sessionId: string; | ||
} | ||
export type SessionManager = typeof VolatileSessionsManager | typeof PersistentSessionsManager; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.7.3"; | ||
static mapping: { | ||
cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
fcp: (onReport: import("web-vitals").FCPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
fid: (onReport: import("web-vitals").FIDReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
inp: (onReport: import("web-vitals").INPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
lcp: (onReport: import("web-vitals").LCPReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
ttfb: (onReport: import("web-vitals").TTFBReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; | ||
}; | ||
readonly version = "1.8.0"; | ||
initialize(): void; | ||
private intializeWebVitalsInstrumentation; | ||
} |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.7.3"; | ||
readonly version = "1.8.0"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -18,2 +18,3 @@ private readonly rateLimitBackoffMs; | ||
private getRetryAfterDate; | ||
private extendFaroSession; | ||
} |
{ | ||
"name": "@grafana/faro-web-sdk", | ||
"version": "1.7.3", | ||
"version": "1.8.0", | ||
"description": "Faro instrumentations, metas, transports for web.", | ||
@@ -55,5 +55,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@grafana/faro-core": "^1.7.3", | ||
"@grafana/faro-core": "^1.8.0", | ||
"ua-parser-js": "^1.0.32", | ||
"web-vitals": "^3.1.1" | ||
"web-vitals": "^4.0.1" | ||
}, | ||
@@ -67,3 +67,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "d2c5a7293a9bfc4ae9bb70292f14115ee3a923a4" | ||
"gitHead": "ec21b36031c20c859d64fbd75a77986397ebaf68" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
655932
445
5152
+ Addedweb-vitals@4.2.4(transitive)
- Removedweb-vitals@3.5.2(transitive)
Updated@grafana/faro-core@^1.8.0
Updatedweb-vitals@^4.0.1