@coralogix/browser 2.8.2 → 2.8.3
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/CHANGELOG.md +6 -0
- package/index.esm2.js +10 -15
- package/package.json +1 -1
- package/src/constants.d.ts +1 -5
- package/src/helpers.d.ts +2 -1
- package/src/types.d.ts +7 -0
- package/src/utils/all.d.ts +2 -8
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
package/index.esm2.js
CHANGED
|
@@ -278,6 +278,9 @@ function getSessionRecorder() {
|
|
|
278
278
|
function getSdkConfig() {
|
|
279
279
|
return CxGlobal[SDK_CONFIG_KEY];
|
|
280
280
|
}
|
|
281
|
+
function getUserAgentData() {
|
|
282
|
+
return CxGlobal[USER_AGENT_KEY];
|
|
283
|
+
}
|
|
281
284
|
|
|
282
285
|
var GLOBAL_SPAN_KEY = '__globalSpan__';
|
|
283
286
|
var CUSTOM_TRACER_KEY = '__customTracer__';
|
|
@@ -2514,6 +2517,7 @@ var REQUIRED_CONFIG_KEYS = [
|
|
|
2514
2517
|
'coralogixDomain',
|
|
2515
2518
|
];
|
|
2516
2519
|
var SDK_CONFIG_KEY = 'sdkConfig';
|
|
2520
|
+
var USER_AGENT_KEY = 'userAgent';
|
|
2517
2521
|
var ID_MASK_KEY = '{id}';
|
|
2518
2522
|
var UUID_REGEX = /[0-9a-fA-F-]{36}/g;
|
|
2519
2523
|
var NANOID_REGEX = /^[a-zA-Z0-9-_]{21}$/;
|
|
@@ -2632,15 +2636,12 @@ var INSTRUMENTATIONS = [
|
|
|
2632
2636
|
},
|
|
2633
2637
|
];
|
|
2634
2638
|
var CoralogixAttributes = {
|
|
2635
|
-
USER_AGENT: 'user_agent',
|
|
2636
|
-
LOCATION_HREF: 'location_href',
|
|
2637
2639
|
EVENT_TYPE: 'event_type',
|
|
2638
2640
|
SEVERITY: 'severity',
|
|
2639
2641
|
APPLICATION_CONTEXT: 'application_context',
|
|
2640
2642
|
USER_CONTEXT: 'user_context',
|
|
2641
2643
|
CUSTOM_MEASUREMENT_CONTEXT: 'custom_measurement_context',
|
|
2642
2644
|
MEMORY_USAGE_CONTEXT: 'memory_usage_context',
|
|
2643
|
-
COUNTRY: 'country',
|
|
2644
2645
|
SOURCE: 'source',
|
|
2645
2646
|
ERROR: ErrorAttributes,
|
|
2646
2647
|
LOG: 'cx_log',
|
|
@@ -2648,10 +2649,8 @@ var CoralogixAttributes = {
|
|
|
2648
2649
|
ENVIRONMENT: 'environment',
|
|
2649
2650
|
INTERACTION_EVENT_NAME: 'interaction_event_name',
|
|
2650
2651
|
ELEMENT_INNER_TEXT: 'element_inner_text',
|
|
2651
|
-
ELEMENT_INNER_HTML: 'element_inner_html',
|
|
2652
2652
|
ELEMENT_ID: 'element_id',
|
|
2653
2653
|
ELEMENT_CLASSES: 'element_classes',
|
|
2654
|
-
TARGET_XPATH: 'target_xpath',
|
|
2655
2654
|
TARGET_ELEMENT: 'target_element',
|
|
2656
2655
|
TARGET_ELEMENT_TYPE: 'target_element_type',
|
|
2657
2656
|
TIMESTAMP: 'timestamp',
|
|
@@ -2987,7 +2986,6 @@ var CoralogixSpanAttributesProcessor = /** @class */ (function () {
|
|
|
2987
2986
|
};
|
|
2988
2987
|
CoralogixSpanAttributesProcessor.prototype.onStart = function (span) {
|
|
2989
2988
|
span.setAttribute(CoralogixAttributes.TIMESTAMP, getNowTime());
|
|
2990
|
-
span.setAttribute(CoralogixAttributes.USER_AGENT, navigator.userAgent);
|
|
2991
2989
|
span.setAttributes(this.labels);
|
|
2992
2990
|
};
|
|
2993
2991
|
CoralogixSpanAttributesProcessor.prototype.onEnd = function () { };
|
|
@@ -3814,20 +3812,16 @@ var SessionIdle = /** @class */ (function () {
|
|
|
3814
3812
|
var _a;
|
|
3815
3813
|
var instrumentationsCompatibility = (_a = {},
|
|
3816
3814
|
_a[XHR_INSTRUMENTATION_NAME] = {
|
|
3817
|
-
browsers: [
|
|
3818
|
-
{ name: 'Chrome', minVersion: 43 }
|
|
3819
|
-
],
|
|
3815
|
+
browsers: [{ name: 'Chrome', minVersion: 43 }],
|
|
3820
3816
|
warningText: 'XHR',
|
|
3821
3817
|
},
|
|
3822
3818
|
_a[SESSION_RECORDING_INSTRUMENTATION_NAME] = {
|
|
3823
|
-
browsers: [
|
|
3824
|
-
{ name: 'Chrome', minVersion: 45 },
|
|
3825
|
-
],
|
|
3819
|
+
browsers: [{ name: 'Chrome', minVersion: 45 }],
|
|
3826
3820
|
warningText: 'Session Recording',
|
|
3827
3821
|
},
|
|
3828
3822
|
_a);
|
|
3829
3823
|
function isInstrumentationCompatible(confKey) {
|
|
3830
|
-
var _a =
|
|
3824
|
+
var _a = getUserAgentData(), browserVersion = _a.browserVersion, browser = _a.browser;
|
|
3831
3825
|
var majorVersion = parseInt(browserVersion.split('.')[0]);
|
|
3832
3826
|
var compatibility = instrumentationsCompatibility[confKey];
|
|
3833
3827
|
if (!compatibility)
|
|
@@ -4216,7 +4210,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
|
|
|
4216
4210
|
return resolvedUrlBlueprinters;
|
|
4217
4211
|
}
|
|
4218
4212
|
|
|
4219
|
-
var SDK_VERSION = '2.8.
|
|
4213
|
+
var SDK_VERSION = '2.8.3';
|
|
4220
4214
|
|
|
4221
4215
|
function shouldDropEvent(cxRumEvent, options) {
|
|
4222
4216
|
if (isDocumentErrorWithoutMessage(cxRumEvent)) {
|
|
@@ -4360,7 +4354,7 @@ var CoralogixSpanMapProcessor = /** @class */ (function () {
|
|
|
4360
4354
|
hasRecording: prevSessionHasRecording,
|
|
4361
4355
|
hasScreenshot: prevSessionHasScreenshot,
|
|
4362
4356
|
}
|
|
4363
|
-
: undefined, hasRecording: sessionHasRecording, hasScreenshot: sessionHasScreenshot, user_agent:
|
|
4357
|
+
: undefined, hasRecording: sessionHasRecording, hasScreenshot: sessionHasScreenshot, user_agent: navigator.userAgent }), getUserAgentData()), { onlyWithErrorMode: onlySessionWithErrorMode }), page_context: span[CoralogixAttributes.PAGE_CONTEXT], isNavigationEvent: !!span[CoralogixAttributes.IS_NAVIGATION_EVENT], event_context: {
|
|
4364
4358
|
type: eventType,
|
|
4365
4359
|
source: attributes[CoralogixAttributes.SOURCE],
|
|
4366
4360
|
severity: severity,
|
|
@@ -4753,6 +4747,7 @@ var CoralogixRum = {
|
|
|
4753
4747
|
if (!resolvedOptions_1) {
|
|
4754
4748
|
return;
|
|
4755
4749
|
}
|
|
4750
|
+
CxGlobal[USER_AGENT_KEY] = parseUserAgent(navigator.userAgent);
|
|
4756
4751
|
CxGlobal[SDK_CONFIG_KEY] = resolvedOptions_1;
|
|
4757
4752
|
var sampler = getResolvedSampler(resolvedOptions_1);
|
|
4758
4753
|
// Check if not in debug mode & no auth token.
|
package/package.json
CHANGED
package/src/constants.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const MAX_CHARACTERS = 1024;
|
|
|
8
8
|
export declare const SCHEDULE_DELAY_MILLIS: number;
|
|
9
9
|
export declare const REQUIRED_CONFIG_KEYS: Array<keyof CoralogixBrowserSdkConfig>;
|
|
10
10
|
export declare const SDK_CONFIG_KEY = "sdkConfig";
|
|
11
|
+
export declare const USER_AGENT_KEY = "userAgent";
|
|
11
12
|
export declare const ID_MASK_KEY = "{id}";
|
|
12
13
|
export declare const UUID_REGEX: RegExp;
|
|
13
14
|
export declare const NANOID_REGEX: RegExp;
|
|
@@ -24,15 +25,12 @@ export declare const OPTIONS_DEFAULTS: Partial<CoralogixBrowserSdkConfig>;
|
|
|
24
25
|
*/
|
|
25
26
|
export declare const INSTRUMENTATIONS: readonly InternalInstrumentationConfig[];
|
|
26
27
|
export declare const CoralogixAttributes: {
|
|
27
|
-
USER_AGENT: string;
|
|
28
|
-
LOCATION_HREF: string;
|
|
29
28
|
EVENT_TYPE: string;
|
|
30
29
|
SEVERITY: string;
|
|
31
30
|
APPLICATION_CONTEXT: string;
|
|
32
31
|
USER_CONTEXT: string;
|
|
33
32
|
CUSTOM_MEASUREMENT_CONTEXT: string;
|
|
34
33
|
MEMORY_USAGE_CONTEXT: string;
|
|
35
|
-
COUNTRY: string;
|
|
36
34
|
SOURCE: string;
|
|
37
35
|
ERROR: {
|
|
38
36
|
TYPE: string;
|
|
@@ -45,10 +43,8 @@ export declare const CoralogixAttributes: {
|
|
|
45
43
|
ENVIRONMENT: string;
|
|
46
44
|
INTERACTION_EVENT_NAME: string;
|
|
47
45
|
ELEMENT_INNER_TEXT: string;
|
|
48
|
-
ELEMENT_INNER_HTML: string;
|
|
49
46
|
ELEMENT_ID: string;
|
|
50
47
|
ELEMENT_CLASSES: string;
|
|
51
|
-
TARGET_XPATH: string;
|
|
52
48
|
TARGET_ELEMENT: string;
|
|
53
49
|
TARGET_ELEMENT_TYPE: string;
|
|
54
50
|
TIMESTAMP: string;
|
package/src/helpers.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SessionManager } from './session/sessionManager';
|
|
2
2
|
import { SessionRecorder } from './session/sessionRecorder';
|
|
3
|
-
import { CoralogixBrowserSdkConfig } from './types';
|
|
3
|
+
import { CoralogixBrowserSdkConfig, UserAgentData } from './types';
|
|
4
4
|
import { SnapshotManager } from './snapshot/snapshotManager';
|
|
5
5
|
export declare function getSnapshotManager(): SnapshotManager;
|
|
6
6
|
export declare function getSessionManager(): SessionManager;
|
|
7
7
|
export declare function getSessionRecorder(): SessionRecorder | undefined;
|
|
8
8
|
export declare function getSdkConfig(): CoralogixBrowserSdkConfig;
|
|
9
|
+
export declare function getUserAgentData(): UserAgentData;
|
|
9
10
|
export declare function clearMemoryFrom(keys: string[]): void;
|
package/src/types.d.ts
CHANGED
|
@@ -444,6 +444,13 @@ export declare enum OtelNetworkAttrs {
|
|
|
444
444
|
export type Browser = 'Chrome' | 'Edge' | 'Firefox' | 'Safari' | 'Opera' | 'IE' | 'Unknown';
|
|
445
445
|
export type OS = 'Windows' | 'MacOS' | 'Linux' | 'iOS' | 'Android' | 'Tizen' | 'webOS' | 'Unknown';
|
|
446
446
|
export type Device = 'Mobile' | 'Tablet' | 'Desktop' | 'Smart-TV' | 'Unknown';
|
|
447
|
+
export type UserAgentData = {
|
|
448
|
+
browser: Browser;
|
|
449
|
+
browserVersion: string;
|
|
450
|
+
os: OS;
|
|
451
|
+
osVersion: string;
|
|
452
|
+
device: Device;
|
|
453
|
+
};
|
|
447
454
|
export type EventName = keyof HTMLElementEventMap;
|
|
448
455
|
export interface PatternReplacement {
|
|
449
456
|
pattern: RegExp;
|
package/src/utils/all.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageContext, PatternReplacement, UrlBlueprinter, UserAgentData, WebVitalsRating } from '../types';
|
|
2
2
|
import { Attributes } from '@opentelemetry/api';
|
|
3
3
|
export declare const supportedPerformanceTypes: Set<string>;
|
|
4
4
|
export declare function valueEndWithOrInclude(value: string, extensions: string[]): boolean;
|
|
@@ -6,13 +6,7 @@ export declare function getInstrumentationConfig<T>(value: T | boolean | undefin
|
|
|
6
6
|
export declare const hrTimeToMilliseconds: ([seconds, nanoseconds]: [number, number]) => number;
|
|
7
7
|
export declare const isNetworkError: (status?: number) => boolean;
|
|
8
8
|
export declare const getUrlFragments: (url: string) => string;
|
|
9
|
-
export declare function parseUserAgent(userAgent: string):
|
|
10
|
-
browser: Browser;
|
|
11
|
-
browserVersion: string;
|
|
12
|
-
os: OS;
|
|
13
|
-
osVersion: string;
|
|
14
|
-
device: Device;
|
|
15
|
-
};
|
|
9
|
+
export declare function parseUserAgent(userAgent: string): UserAgentData;
|
|
16
10
|
export declare function calculateTotalBlockingTime(list: PerformanceEntry[]): number;
|
|
17
11
|
export declare function generateWebVitalUniqueID(): string;
|
|
18
12
|
export declare function rateForTBTMetricValue(value: number): WebVitalsRating;
|
package/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.8.
|
|
1
|
+
export declare const SDK_VERSION = "2.8.3";
|