@grafana/faro-core 2.0.0-beta → 2.0.2
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/dist/bundle/faro-core.iife.js +1 -1
- package/dist/bundle/types/api/index.d.ts +1 -1
- package/dist/bundle/types/api/userActions/const.d.ts +6 -4
- package/dist/bundle/types/api/userActions/index.d.ts +3 -2
- package/dist/bundle/types/api/userActions/initialize.d.ts +10 -2
- package/dist/bundle/types/api/userActions/types.d.ts +16 -6
- package/dist/bundle/types/api/userActions/userAction.d.ts +7 -15
- package/dist/bundle/types/config/types.d.ts +22 -22
- package/dist/bundle/types/index.d.ts +2 -2
- package/dist/bundle/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/bundle/types/version.d.ts +1 -1
- package/dist/cjs/api/events/initialize.js +2 -5
- package/dist/cjs/api/events/initialize.js.map +1 -1
- package/dist/cjs/api/exceptions/initialize.js +2 -5
- package/dist/cjs/api/exceptions/initialize.js.map +1 -1
- package/dist/cjs/api/index.js +2 -2
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/logs/const.js +1 -1
- package/dist/cjs/api/logs/const.js.map +1 -1
- package/dist/cjs/api/logs/initialize.js +2 -5
- package/dist/cjs/api/logs/initialize.js.map +1 -1
- package/dist/cjs/api/measurements/initialize.js +2 -5
- package/dist/cjs/api/measurements/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/const.js +6 -6
- package/dist/cjs/api/userActions/const.js.map +1 -1
- package/dist/cjs/api/userActions/index.js +3 -3
- package/dist/cjs/api/userActions/index.js.map +1 -1
- package/dist/cjs/api/userActions/initialize.js +24 -2
- package/dist/cjs/api/userActions/initialize.js.map +1 -1
- package/dist/cjs/api/userActions/types.js.map +1 -1
- package/dist/cjs/api/userActions/userAction.js +7 -49
- package/dist/cjs/api/userActions/userAction.js.map +1 -1
- package/dist/cjs/config/types.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/transports/utils.js +4 -2
- package/dist/cjs/transports/utils.js.map +1 -1
- package/dist/cjs/utils/is.js +1 -1
- package/dist/cjs/utils/is.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/api/events/initialize.js +2 -5
- package/dist/esm/api/events/initialize.js.map +1 -1
- package/dist/esm/api/exceptions/initialize.js +2 -5
- package/dist/esm/api/exceptions/initialize.js.map +1 -1
- package/dist/esm/api/index.js +1 -1
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/logs/const.js +1 -1
- package/dist/esm/api/logs/const.js.map +1 -1
- package/dist/esm/api/logs/initialize.js +2 -5
- package/dist/esm/api/logs/initialize.js.map +1 -1
- package/dist/esm/api/measurements/initialize.js +2 -5
- package/dist/esm/api/measurements/initialize.js.map +1 -1
- package/dist/esm/api/userActions/const.js +5 -5
- package/dist/esm/api/userActions/const.js.map +1 -1
- package/dist/esm/api/userActions/index.js +3 -2
- package/dist/esm/api/userActions/index.js.map +1 -1
- package/dist/esm/api/userActions/initialize.js +24 -3
- package/dist/esm/api/userActions/initialize.js.map +1 -1
- package/dist/esm/api/userActions/types.js +1 -1
- package/dist/esm/api/userActions/types.js.map +1 -1
- package/dist/esm/api/userActions/userAction.js +8 -49
- package/dist/esm/api/userActions/userAction.js.map +1 -1
- package/dist/esm/config/types.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/transports/utils.js +4 -2
- package/dist/esm/transports/utils.js.map +1 -1
- package/dist/esm/utils/is.js +1 -1
- package/dist/esm/utils/is.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/spec/core/src/api/events/initialize.js +2 -5
- package/dist/spec/core/src/api/events/initialize.js.map +1 -1
- package/dist/spec/core/src/api/exceptions/initialize.js +2 -5
- package/dist/spec/core/src/api/exceptions/initialize.js.map +1 -1
- package/dist/spec/core/src/api/index.js +2 -2
- package/dist/spec/core/src/api/index.js.map +1 -1
- package/dist/spec/core/src/api/logs/const.js +1 -1
- package/dist/spec/core/src/api/logs/const.js.map +1 -1
- package/dist/spec/core/src/api/logs/initialize.js +2 -5
- package/dist/spec/core/src/api/logs/initialize.js.map +1 -1
- package/dist/spec/core/src/api/measurements/initialize.js +2 -5
- package/dist/spec/core/src/api/measurements/initialize.js.map +1 -1
- package/dist/spec/core/src/api/userActions/const.js +6 -6
- package/dist/spec/core/src/api/userActions/const.js.map +1 -1
- package/dist/spec/core/src/api/userActions/index.js +3 -3
- package/dist/spec/core/src/api/userActions/index.js.map +1 -1
- package/dist/spec/core/src/api/userActions/initialize.js +24 -2
- package/dist/spec/core/src/api/userActions/initialize.js.map +1 -1
- package/dist/spec/core/src/api/userActions/initialize.test.js +34 -8
- package/dist/spec/core/src/api/userActions/initialize.test.js.map +1 -1
- package/dist/spec/core/src/api/userActions/types.js.map +1 -1
- package/dist/spec/core/src/api/userActions/userAction.js +7 -49
- package/dist/spec/core/src/api/userActions/userAction.js.map +1 -1
- package/dist/spec/core/src/api/userActions/userAction.test.js +27 -14
- package/dist/spec/core/src/api/userActions/userAction.test.js.map +1 -1
- package/dist/spec/core/src/config/types.js.map +1 -1
- package/dist/spec/core/src/index.js +2 -2
- package/dist/spec/core/src/index.js.map +1 -1
- package/dist/spec/core/src/transports/utils.js +4 -2
- package/dist/spec/core/src/transports/utils.js.map +1 -1
- package/dist/spec/core/src/utils/is.js +1 -1
- package/dist/spec/core/src/utils/is.js.map +1 -1
- package/dist/spec/core/src/version.js +1 -1
- package/dist/spec/core/src/version.js.map +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/userActions/const.d.ts +6 -4
- package/dist/types/api/userActions/index.d.ts +3 -2
- package/dist/types/api/userActions/initialize.d.ts +10 -2
- package/dist/types/api/userActions/types.d.ts +16 -6
- package/dist/types/api/userActions/userAction.d.ts +7 -15
- package/dist/types/config/types.d.ts +22 -22
- package/dist/types/core/src/api/index.d.ts +1 -1
- package/dist/types/core/src/api/userActions/const.d.ts +6 -4
- package/dist/types/core/src/api/userActions/index.d.ts +3 -2
- package/dist/types/core/src/api/userActions/initialize.d.ts +10 -2
- package/dist/types/core/src/api/userActions/types.d.ts +16 -6
- package/dist/types/core/src/api/userActions/userAction.d.ts +7 -15
- package/dist/types/core/src/config/types.d.ts +22 -22
- package/dist/types/core/src/index.d.ts +2 -2
- package/dist/types/core/src/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/core/src/version.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/testUtils/mockTransport.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +8 -7
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { type TransportItem } from '../../transports';
|
|
2
|
-
import {
|
|
2
|
+
import { type UserActionImportanceType, userActionStartByApiCallEventName } from './const';
|
|
3
3
|
export declare enum UserActionState {
|
|
4
4
|
Started = 0,
|
|
5
5
|
Halted = 1,
|
|
6
6
|
Cancelled = 2,
|
|
7
7
|
Ended = 3
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Public interface for the UserAction.
|
|
11
|
+
* This is the interface that is part of the public API.
|
|
12
|
+
*/
|
|
10
13
|
export interface UserActionInterface {
|
|
11
14
|
name: string;
|
|
12
15
|
parentId: string;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Internal interface for the UserAction.
|
|
19
|
+
* This interface is intended for internal use only and not guaranteed to be stable.
|
|
20
|
+
*/
|
|
21
|
+
export interface UserActionInternalInterface extends UserActionInterface {
|
|
22
|
+
halt(): void;
|
|
15
23
|
end(attributes?: Record<string, string>): void;
|
|
16
|
-
halt(reason?: string): void;
|
|
17
24
|
cancel(): void;
|
|
18
25
|
getState(): UserActionState;
|
|
19
26
|
}
|
|
27
|
+
export interface UserActionTransportItemBuffer {
|
|
28
|
+
addItem(item: TransportItem): boolean;
|
|
29
|
+
}
|
|
20
30
|
export type ApiUserActionEvent = {
|
|
21
31
|
name: string;
|
|
22
32
|
attributes?: Record<string, string>;
|
|
@@ -32,7 +42,7 @@ export type EndUserActionProps = {
|
|
|
32
42
|
};
|
|
33
43
|
export type StartUserActionOptions = {
|
|
34
44
|
triggerName?: string;
|
|
35
|
-
|
|
45
|
+
importance?: UserActionImportanceType;
|
|
36
46
|
};
|
|
37
47
|
export interface UserActionsAPI {
|
|
38
48
|
startUserAction: (name: string, attributes?: Record<string, string>, options?: StartUserActionOptions) => UserActionInterface | undefined;
|
|
@@ -1,38 +1,30 @@
|
|
|
1
1
|
import { type TransportItem, type Transports } from '../../transports';
|
|
2
2
|
import { Observable } from '../../utils';
|
|
3
3
|
import { type APIEvent } from '../types';
|
|
4
|
-
import {
|
|
5
|
-
import { type
|
|
6
|
-
export default class UserAction extends Observable implements
|
|
4
|
+
import { type UserActionImportanceType } from './const';
|
|
5
|
+
import { type UserActionInternalInterface, UserActionState, type UserActionTransportItemBuffer } from './types';
|
|
6
|
+
export default class UserAction extends Observable implements UserActionInternalInterface, UserActionTransportItemBuffer {
|
|
7
7
|
name: string;
|
|
8
8
|
id: string;
|
|
9
9
|
attributes?: Record<string, string>;
|
|
10
10
|
parentId: string;
|
|
11
11
|
trigger: string;
|
|
12
|
-
|
|
12
|
+
importance: UserActionImportanceType;
|
|
13
13
|
startTime?: number;
|
|
14
14
|
trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
15
|
-
cancelTimeout: number;
|
|
16
|
-
haltTimeout: number;
|
|
17
15
|
private _state;
|
|
18
|
-
private _timeoutId?;
|
|
19
16
|
private _itemBuffer;
|
|
20
17
|
private _transports;
|
|
21
|
-
|
|
22
|
-
private _isValid;
|
|
23
|
-
constructor({ name, parentId, haltTimeout, trigger, transports, attributes, trackUserActionsExcludeItem, severity, }: {
|
|
18
|
+
constructor({ name, parentId, trigger, transports, attributes, trackUserActionsExcludeItem, importance, }: {
|
|
24
19
|
name: string;
|
|
25
20
|
transports: Transports;
|
|
26
21
|
parentId?: string;
|
|
27
22
|
trigger: string;
|
|
28
23
|
attributes?: Record<string, string>;
|
|
29
|
-
haltTimeout?: number;
|
|
30
24
|
trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
31
|
-
|
|
25
|
+
importance?: UserActionImportanceType;
|
|
32
26
|
});
|
|
33
|
-
addItem(item: TransportItem):
|
|
34
|
-
extend(haltPredicate?: HaltPredicate): void;
|
|
35
|
-
private _setFollowupActionTimeout;
|
|
27
|
+
addItem(item: TransportItem): boolean;
|
|
36
28
|
private _start;
|
|
37
29
|
halt(): void;
|
|
38
30
|
cancel(): void;
|
|
@@ -134,10 +134,6 @@ export interface Config<P = APIEvent> {
|
|
|
134
134
|
* Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).
|
|
135
135
|
*/
|
|
136
136
|
trackResources?: boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Track web vitals attribution data (default: true)
|
|
139
|
-
*/
|
|
140
|
-
trackWebVitalsAttribution?: boolean;
|
|
141
137
|
/**
|
|
142
138
|
* Configuration for the web vitals instrumentation
|
|
143
139
|
*/
|
|
@@ -153,12 +149,6 @@ export interface Config<P = APIEvent> {
|
|
|
153
149
|
* for measuring these metrics in production.
|
|
154
150
|
*/
|
|
155
151
|
reportAllChanges?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* Track web vitals attribution data (default: true)
|
|
158
|
-
*
|
|
159
|
-
* Functionally the same as setting `trackWebVitalsAttribution` to true.
|
|
160
|
-
*/
|
|
161
|
-
trackAttribution?: boolean;
|
|
162
152
|
};
|
|
163
153
|
/**
|
|
164
154
|
* Configuration for the console instrumentation
|
|
@@ -206,19 +196,19 @@ export interface Config<P = APIEvent> {
|
|
|
206
196
|
*/
|
|
207
197
|
trackGeolocation?: boolean;
|
|
208
198
|
/**
|
|
209
|
-
*
|
|
210
|
-
* We have tested it thoroughly, but it is possible that it might not work as expected in all cases.
|
|
199
|
+
* Configuration for the user actions instrumentation
|
|
211
200
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
201
|
+
userActionsInstrumentation?: {
|
|
202
|
+
/**
|
|
203
|
+
* Configure your own attribute name for tracking user actions. Default is 'data-faro-user-action-name'
|
|
204
|
+
*/
|
|
205
|
+
dataAttributeName?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Predicate function to exclude items from user actions.
|
|
208
|
+
* If the function returns true, the item will be excluded from user actions.
|
|
209
|
+
*/
|
|
210
|
+
excludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
211
|
+
};
|
|
222
212
|
/**
|
|
223
213
|
* When enabled, preserves the original Error object in the transport item for use in the beforeSend hook.
|
|
224
214
|
* The original error is automatically removed before the item is sent to the transport.
|
|
@@ -232,6 +222,16 @@ export interface Config<P = APIEvent> {
|
|
|
232
222
|
* Faro exception payload to include additional context or fix missing information.
|
|
233
223
|
*/
|
|
234
224
|
preserveOriginalError?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Configuration for experimental features.
|
|
227
|
+
* These features have been tested thoroughly, but it is possible that they might not work as expected in all cases.
|
|
228
|
+
*/
|
|
229
|
+
experimental?: {
|
|
230
|
+
/**
|
|
231
|
+
* Track navigation events.
|
|
232
|
+
*/
|
|
233
|
+
trackNavigation?: boolean;
|
|
234
|
+
};
|
|
235
235
|
}
|
|
236
236
|
export type Patterns = Array<string | RegExp>;
|
|
237
237
|
export {};
|
|
@@ -7,5 +7,5 @@ export { defaultLogArgsSerializer } from './logs';
|
|
|
7
7
|
export type { LogContext, LogEvent, LogArgsSerializer, LogsAPI, PushLogOptions } from './logs';
|
|
8
8
|
export type { MeasurementEvent, MeasurementsAPI, PushMeasurementOptions } from './measurements';
|
|
9
9
|
export type { MetaAPI } from './meta';
|
|
10
|
-
export {
|
|
10
|
+
export { UserActionImportance, type UserActionImportanceType, UserActionState, type UserActionInterface, type UserActionInternalInterface, type UserActionsAPI, userActionsMessageBus, } from './userActions';
|
|
11
11
|
export type { OTELApi, TraceContext, TraceEvent, TracesAPI } from './traces';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const userActionStartByApiCallEventName = "faroApiCall";
|
|
2
2
|
export declare const userActionStart = "user_action_start";
|
|
3
|
-
export declare
|
|
4
|
-
Normal
|
|
5
|
-
Critical
|
|
6
|
-
}
|
|
3
|
+
export declare const UserActionImportance: {
|
|
4
|
+
readonly Normal: "normal";
|
|
5
|
+
readonly Critical: "critical";
|
|
6
|
+
};
|
|
7
|
+
export type UserActionImportanceType = (typeof UserActionImportance)[keyof typeof UserActionImportance];
|
|
8
|
+
export declare const userActionEventName = "faro.user.action";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { UserActionImportance } from './const';
|
|
2
|
+
export { type UserActionImportance as UserActionImportanceType } from './const';
|
|
3
|
+
export { type UserActionsAPI, UserActionState, type UserActionInterface, type UserActionInternalInterface, } from './types';
|
|
3
4
|
export { initializeUserActionsAPI, userActionsMessageBus } from './initialize';
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { type InternalLogger, type Transports } from '../..';
|
|
1
|
+
import { type InternalLogger, type TransportItem, type Transports } from '../..';
|
|
2
2
|
import type { Config } from '../../config';
|
|
3
3
|
import { Observable } from '../../utils/reactive';
|
|
4
|
-
import { type UserActionsAPI } from './types';
|
|
4
|
+
import { type UserActionInterface, type UserActionsAPI } from './types';
|
|
5
5
|
export declare const userActionsMessageBus: Observable<import("./types").UserActionStart>;
|
|
6
6
|
export declare function initializeUserActionsAPI({ transports, internalLogger, config, }: {
|
|
7
7
|
transports: Transports;
|
|
8
8
|
config: Config;
|
|
9
9
|
internalLogger: InternalLogger;
|
|
10
10
|
}): UserActionsAPI;
|
|
11
|
+
/**
|
|
12
|
+
* Adds an item to the buffer associated with the given UserAction.
|
|
13
|
+
* The item will only be added if the UserAction is in the Started state.
|
|
14
|
+
* @param userAction The UserAction instance
|
|
15
|
+
* @param item The item to add to the buffer
|
|
16
|
+
* @returns {boolean} True if the item was added, false otherwise
|
|
17
|
+
*/
|
|
18
|
+
export declare function addItemToUserActionBuffer(userAction: UserActionInterface | undefined, item: TransportItem): boolean;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { type TransportItem } from '../../transports';
|
|
2
|
-
import {
|
|
2
|
+
import { type UserActionImportanceType, userActionStartByApiCallEventName } from './const';
|
|
3
3
|
export declare enum UserActionState {
|
|
4
4
|
Started = 0,
|
|
5
5
|
Halted = 1,
|
|
6
6
|
Cancelled = 2,
|
|
7
7
|
Ended = 3
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Public interface for the UserAction.
|
|
11
|
+
* This is the interface that is part of the public API.
|
|
12
|
+
*/
|
|
10
13
|
export interface UserActionInterface {
|
|
11
14
|
name: string;
|
|
12
15
|
parentId: string;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Internal interface for the UserAction.
|
|
19
|
+
* This interface is intended for internal use only and not guaranteed to be stable.
|
|
20
|
+
*/
|
|
21
|
+
export interface UserActionInternalInterface extends UserActionInterface {
|
|
22
|
+
halt(): void;
|
|
15
23
|
end(attributes?: Record<string, string>): void;
|
|
16
|
-
halt(reason?: string): void;
|
|
17
24
|
cancel(): void;
|
|
18
25
|
getState(): UserActionState;
|
|
19
26
|
}
|
|
27
|
+
export interface UserActionTransportItemBuffer {
|
|
28
|
+
addItem(item: TransportItem): boolean;
|
|
29
|
+
}
|
|
20
30
|
export type ApiUserActionEvent = {
|
|
21
31
|
name: string;
|
|
22
32
|
attributes?: Record<string, string>;
|
|
@@ -32,7 +42,7 @@ export type EndUserActionProps = {
|
|
|
32
42
|
};
|
|
33
43
|
export type StartUserActionOptions = {
|
|
34
44
|
triggerName?: string;
|
|
35
|
-
|
|
45
|
+
importance?: UserActionImportanceType;
|
|
36
46
|
};
|
|
37
47
|
export interface UserActionsAPI {
|
|
38
48
|
startUserAction: (name: string, attributes?: Record<string, string>, options?: StartUserActionOptions) => UserActionInterface | undefined;
|
|
@@ -1,38 +1,30 @@
|
|
|
1
1
|
import { type TransportItem, type Transports } from '../../transports';
|
|
2
2
|
import { Observable } from '../../utils';
|
|
3
3
|
import { type APIEvent } from '../types';
|
|
4
|
-
import {
|
|
5
|
-
import { type
|
|
6
|
-
export default class UserAction extends Observable implements
|
|
4
|
+
import { type UserActionImportanceType } from './const';
|
|
5
|
+
import { type UserActionInternalInterface, UserActionState, type UserActionTransportItemBuffer } from './types';
|
|
6
|
+
export default class UserAction extends Observable implements UserActionInternalInterface, UserActionTransportItemBuffer {
|
|
7
7
|
name: string;
|
|
8
8
|
id: string;
|
|
9
9
|
attributes?: Record<string, string>;
|
|
10
10
|
parentId: string;
|
|
11
11
|
trigger: string;
|
|
12
|
-
|
|
12
|
+
importance: UserActionImportanceType;
|
|
13
13
|
startTime?: number;
|
|
14
14
|
trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
15
|
-
cancelTimeout: number;
|
|
16
|
-
haltTimeout: number;
|
|
17
15
|
private _state;
|
|
18
|
-
private _timeoutId?;
|
|
19
16
|
private _itemBuffer;
|
|
20
17
|
private _transports;
|
|
21
|
-
|
|
22
|
-
private _isValid;
|
|
23
|
-
constructor({ name, parentId, haltTimeout, trigger, transports, attributes, trackUserActionsExcludeItem, severity, }: {
|
|
18
|
+
constructor({ name, parentId, trigger, transports, attributes, trackUserActionsExcludeItem, importance, }: {
|
|
24
19
|
name: string;
|
|
25
20
|
transports: Transports;
|
|
26
21
|
parentId?: string;
|
|
27
22
|
trigger: string;
|
|
28
23
|
attributes?: Record<string, string>;
|
|
29
|
-
haltTimeout?: number;
|
|
30
24
|
trackUserActionsExcludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
31
|
-
|
|
25
|
+
importance?: UserActionImportanceType;
|
|
32
26
|
});
|
|
33
|
-
addItem(item: TransportItem):
|
|
34
|
-
extend(haltPredicate?: HaltPredicate): void;
|
|
35
|
-
private _setFollowupActionTimeout;
|
|
27
|
+
addItem(item: TransportItem): boolean;
|
|
36
28
|
private _start;
|
|
37
29
|
halt(): void;
|
|
38
30
|
cancel(): void;
|
|
@@ -134,10 +134,6 @@ export interface Config<P = APIEvent> {
|
|
|
134
134
|
* Only resource timings for fetch and xhr requests are tracked by default. Set this to true to track all resources (default: false).
|
|
135
135
|
*/
|
|
136
136
|
trackResources?: boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Track web vitals attribution data (default: true)
|
|
139
|
-
*/
|
|
140
|
-
trackWebVitalsAttribution?: boolean;
|
|
141
137
|
/**
|
|
142
138
|
* Configuration for the web vitals instrumentation
|
|
143
139
|
*/
|
|
@@ -153,12 +149,6 @@ export interface Config<P = APIEvent> {
|
|
|
153
149
|
* for measuring these metrics in production.
|
|
154
150
|
*/
|
|
155
151
|
reportAllChanges?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* Track web vitals attribution data (default: true)
|
|
158
|
-
*
|
|
159
|
-
* Functionally the same as setting `trackWebVitalsAttribution` to true.
|
|
160
|
-
*/
|
|
161
|
-
trackAttribution?: boolean;
|
|
162
152
|
};
|
|
163
153
|
/**
|
|
164
154
|
* Configuration for the console instrumentation
|
|
@@ -206,19 +196,19 @@ export interface Config<P = APIEvent> {
|
|
|
206
196
|
*/
|
|
207
197
|
trackGeolocation?: boolean;
|
|
208
198
|
/**
|
|
209
|
-
*
|
|
210
|
-
* We have tested it thoroughly, but it is possible that it might not work as expected in all cases.
|
|
199
|
+
* Configuration for the user actions instrumentation
|
|
211
200
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
201
|
+
userActionsInstrumentation?: {
|
|
202
|
+
/**
|
|
203
|
+
* Configure your own attribute name for tracking user actions. Default is 'data-faro-user-action-name'
|
|
204
|
+
*/
|
|
205
|
+
dataAttributeName?: string;
|
|
206
|
+
/**
|
|
207
|
+
* Predicate function to exclude items from user actions.
|
|
208
|
+
* If the function returns true, the item will be excluded from user actions.
|
|
209
|
+
*/
|
|
210
|
+
excludeItem?: (item: TransportItem<APIEvent>) => boolean;
|
|
211
|
+
};
|
|
222
212
|
/**
|
|
223
213
|
* When enabled, preserves the original Error object in the transport item for use in the beforeSend hook.
|
|
224
214
|
* The original error is automatically removed before the item is sent to the transport.
|
|
@@ -232,6 +222,16 @@ export interface Config<P = APIEvent> {
|
|
|
232
222
|
* Faro exception payload to include additional context or fix missing information.
|
|
233
223
|
*/
|
|
234
224
|
preserveOriginalError?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Configuration for experimental features.
|
|
227
|
+
* These features have been tested thoroughly, but it is possible that they might not work as expected in all cases.
|
|
228
|
+
*/
|
|
229
|
+
experimental?: {
|
|
230
|
+
/**
|
|
231
|
+
* Track navigation events.
|
|
232
|
+
*/
|
|
233
|
+
trackNavigation?: boolean;
|
|
234
|
+
};
|
|
235
235
|
}
|
|
236
236
|
export type Patterns = Array<string | RegExp>;
|
|
237
237
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer,
|
|
2
|
-
export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, UserAction, UserActionInterface, } from './api';
|
|
1
|
+
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer, UserActionImportance, type UserActionImportanceType, UserActionState, userActionsMessageBus, } from './api';
|
|
2
|
+
export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, UserAction, UserActionInterface, UserActionInternalInterface, } from './api';
|
|
3
3
|
export { BaseExtension } from './extensions';
|
|
4
4
|
export type { Extension } from './extensions';
|
|
5
5
|
export { globalObject } from './globalObject';
|
|
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
|
|
|
4
4
|
export declare class MockTransport extends BaseTransport implements Transport {
|
|
5
5
|
private ignoreURLs;
|
|
6
6
|
readonly name = "@grafana/transport-mock";
|
|
7
|
-
readonly version = "2.0.
|
|
7
|
+
readonly version = "2.0.2";
|
|
8
8
|
items: TransportItem[];
|
|
9
9
|
constructor(ignoreURLs?: Patterns);
|
|
10
10
|
send(items: TransportItem[]): void | Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.
|
|
1
|
+
export declare const VERSION = "2.0.2";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer,
|
|
2
|
-
export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, UserAction, UserActionInterface, } from './api';
|
|
1
|
+
export { defaultExceptionType, defaultLogArgsSerializer, defaultErrorArgsSerializer, UserActionImportance, type UserActionImportanceType, UserActionState, userActionsMessageBus, } from './api';
|
|
2
|
+
export type { API, APIEvent, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionEventExtended, ExceptionStackFrame, ExceptionsAPI, ExtendedError, LogArgsSerializer, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, MetaAPI, OTELApi, PushErrorOptions, PushEventOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, UserAction, UserActionInterface, UserActionInternalInterface, } from './api';
|
|
3
3
|
export { BaseExtension } from './extensions';
|
|
4
4
|
export type { Extension } from './extensions';
|
|
5
5
|
export { globalObject } from './globalObject';
|
|
@@ -4,7 +4,7 @@ import type { Transport, TransportItem } from '../transports';
|
|
|
4
4
|
export declare class MockTransport extends BaseTransport implements Transport {
|
|
5
5
|
private ignoreURLs;
|
|
6
6
|
readonly name = "@grafana/transport-mock";
|
|
7
|
-
readonly version = "2.0.
|
|
7
|
+
readonly version = "2.0.2";
|
|
8
8
|
items: TransportItem[];
|
|
9
9
|
constructor(ignoreURLs?: Patterns);
|
|
10
10
|
send(items: TransportItem[]): void | Promise<void>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.
|
|
1
|
+
export declare const VERSION = "2.0.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/faro-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Core package of Faro.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -38,27 +38,28 @@
|
|
|
38
38
|
"build:compile:bundle": "run-s 'build:compile:bundle:*'",
|
|
39
39
|
"build:compile:bundle:create": "rollup -c ./rollup.config.js",
|
|
40
40
|
"build:compile:bundle:remove-extras": "rimraf dist/bundle/dist",
|
|
41
|
-
"watch": "run-s build:version watch:compile",
|
|
42
|
-
"watch:compile": "yarn build:compile:cjs -w",
|
|
41
|
+
"watch": "run-s build:version 'watch:compile:*'",
|
|
42
|
+
"watch:compile:cjs": "yarn build:compile:cjs -w",
|
|
43
|
+
"watch:compile:esm": "yarn build:compile:esm -w",
|
|
43
44
|
"clean": "rimraf dist/ yarn-error.log",
|
|
44
45
|
"quality": "run-s 'quality:*'",
|
|
45
46
|
"quality:test": "jest",
|
|
46
47
|
"quality:format": "prettier --cache --cache-location=../../.cache/prettier/core --ignore-path ../../.prettierignore -w \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
47
48
|
"quality:lint": "run-s 'quality:lint:*'",
|
|
48
|
-
"quality:lint:eslint": "eslint --cache --cache-location ../../.cache/eslint/core
|
|
49
|
+
"quality:lint:eslint": "eslint --cache --cache-location ../../.cache/eslint/core \"./**/*.{js,jsx,ts,tsx}\"",
|
|
49
50
|
"quality:lint:prettier": "prettier --cache --cache-location=../../.cache/prettier/core --ignore-path ../../.prettierignore -c \"./**/*.{js,jsx,ts,tsx,css,scss,md,yaml,yml,json}\"",
|
|
50
51
|
"quality:lint:md": "markdownlint README.md",
|
|
51
52
|
"quality:circular-deps": "madge --circular ."
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@opentelemetry/api": "^1.9.0",
|
|
55
|
-
"@opentelemetry/otlp-transformer": "^0.
|
|
56
|
+
"@opentelemetry/otlp-transformer": "^0.208.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@types/node": "
|
|
59
|
+
"@types/node": "24.10.0"
|
|
59
60
|
},
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c47ff6089dfa52b34630131ea2776910eae984ab"
|
|
64
65
|
}
|