@coralogix/browser 3.23.0 → 3.23.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/CHANGELOG.md +13 -0
- package/README.md +12 -0
- package/index.esm2.js +82 -63
- package/package.json +1 -1
- package/src/coralogix-rum.d.ts +1 -1
- package/src/instrumentations/CoralogixCustomLogInstrumentation.d.ts +0 -3
- package/src/instrumentations/CoralogixErrorInstrumentation.d.ts +1 -8
- package/src/instrumentations/CoralogixInternalInstrumentation.d.ts +1 -1
- package/src/instrumentations/instrumentation.model.d.ts +12 -0
- package/src/instrumentations/network/CoralogixFetchInstrumentation.d.ts +0 -3
- package/src/instrumentations/network/CoralogixXhrInstrumentation.d.ts +0 -3
- package/src/instrumentations/network/constants.d.ts +6 -0
- package/src/instrumentations/user-interaction/CoralogixUserInteractionInstrumentation.d.ts +2 -6
- package/src/instrumentations/user-interaction/user-interaction.types.d.ts +6 -0
- package/src/instrumentations/user-interaction/user-interaction.utils.d.ts +2 -1
- package/src/instrumentations/web-vitals/web-vitals.types.d.ts +2 -2
- package/src/internal-event-reporter.d.ts +1 -1
- package/src/types.d.ts +31 -12
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 3.23.2 (2026-08-20)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- Stop reporting `resolved_name` for dead clicks
|
|
6
|
+
- Add an optional `fullData` flag to `CoralogixRum.getResolvedName()`, used by Coralogix's own tooling
|
|
7
|
+
|
|
8
|
+
## 3.23.1 (2026-08-19)
|
|
9
|
+
|
|
10
|
+
### 🩹 Fixes
|
|
11
|
+
|
|
12
|
+
- Stop the public types from pulling `@types/node` into browser TypeScript builds
|
|
13
|
+
|
|
1
14
|
## 3.23.0 (2026-08-17)
|
|
2
15
|
|
|
3
16
|
### 🚀 Features
|
package/README.md
CHANGED
|
@@ -151,6 +151,7 @@ CoralogixRum.setApplicationContext({
|
|
|
151
151
|
});
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
<!-- split title="Sampling" path="configuration/sampling.md" -->
|
|
154
155
|
### Sampling
|
|
155
156
|
|
|
156
157
|
#### 1. Basic Sampling - sample % of all sessions
|
|
@@ -221,6 +222,8 @@ CoralogixRum.init({
|
|
|
221
222
|
});
|
|
222
223
|
```
|
|
223
224
|
|
|
225
|
+
<!-- /split -->
|
|
226
|
+
<!-- split title="Logs and errors" path="features/logs-and-errors.md" -->
|
|
224
227
|
### Sending Custom Logs
|
|
225
228
|
|
|
226
229
|
```javascript
|
|
@@ -308,6 +311,8 @@ try {
|
|
|
308
311
|
}
|
|
309
312
|
```
|
|
310
313
|
|
|
314
|
+
<!-- /split -->
|
|
315
|
+
<!-- split title="Session recording" path="features/session-recording.md" -->
|
|
311
316
|
### Session Recording
|
|
312
317
|
|
|
313
318
|
Session Recording enhances your user experience monitoring by enabling you to record and visually replay the web browsing activities of your users.
|
|
@@ -454,6 +459,8 @@ CoralogixRum.init({
|
|
|
454
459
|
});
|
|
455
460
|
```
|
|
456
461
|
|
|
462
|
+
<!-- /split -->
|
|
463
|
+
<!-- split title="Configuration options" path="configuration/options.md" -->
|
|
457
464
|
### Manually Create a New Session
|
|
458
465
|
|
|
459
466
|
By default the SDK rotates the session automatically — after 15 minutes of inactivity, or once a session reaches 1 hour. Starting with version `3.19.0`, you can also rotate it on demand by calling `CoralogixRum.createNewSession()`, for example when a user logs out, so that subsequent events are attributed to a fresh session.
|
|
@@ -822,6 +829,8 @@ export class CustomPropagator implements TextMapPropagator {
|
|
|
822
829
|
|
|
823
830
|
```
|
|
824
831
|
|
|
832
|
+
<!-- /split -->
|
|
833
|
+
<!-- split title="Before send and transport" path="configuration/before-send-and-transport.md" -->
|
|
825
834
|
### Before Send
|
|
826
835
|
|
|
827
836
|
Enable event access and modification before sending to Coralogix, supporting content modification, and event discarding.
|
|
@@ -923,6 +932,8 @@ CoralogixRum.init({
|
|
|
923
932
|
> [!NOTE]
|
|
924
933
|
> The `priority` hint only works in Chromium browsers (Chrome/Edge 101+) and is a no-op elsewhere. We type this option with our own `SdkFetchPriority` alias instead of the DOM `RequestPriority` type, so it still compiles on older TypeScript versions (the SDK supports `>= 4.4.2`).
|
|
925
934
|
|
|
935
|
+
<!-- /split -->
|
|
936
|
+
<!-- split title="Custom instrumentation" path="features/custom-instrumentation.md" -->
|
|
926
937
|
### Custom Measurement
|
|
927
938
|
|
|
928
939
|
Custom measurement allows you to send numeric data to Coralogix for precise monitoring and analysis.
|
|
@@ -1104,6 +1115,7 @@ You can also manually trigger memory usage data collection.
|
|
|
1104
1115
|
CoralogixRum.measureUserAgentSpecificMemory();
|
|
1105
1116
|
```
|
|
1106
1117
|
|
|
1118
|
+
<!-- /split -->
|
|
1107
1119
|
## Web Worker Support
|
|
1108
1120
|
|
|
1109
1121
|
Web Worker support enables the capture of events originating from Web Workers, including unhandled errors, custom logs, and other functionalities provided by the SDK.
|
package/index.esm2.js
CHANGED
|
@@ -389,6 +389,37 @@ function getCustomMergedLabels(labels) {
|
|
|
389
389
|
return __assign(__assign({}, globalLabels), labels);
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
+
var ResourceInitiatorTypes;
|
|
393
|
+
(function (ResourceInitiatorTypes) {
|
|
394
|
+
ResourceInitiatorTypes["Media"] = "media";
|
|
395
|
+
ResourceInitiatorTypes["Script"] = "script";
|
|
396
|
+
ResourceInitiatorTypes["Css"] = "css";
|
|
397
|
+
ResourceInitiatorTypes["Beacon"] = "beacon";
|
|
398
|
+
ResourceInitiatorTypes["Img"] = "img";
|
|
399
|
+
ResourceInitiatorTypes["Font"] = "font";
|
|
400
|
+
ResourceInitiatorTypes["Doc"] = "doc";
|
|
401
|
+
ResourceInitiatorTypes["Xhr"] = "xmlhttprequest";
|
|
402
|
+
ResourceInitiatorTypes["Fetch"] = "fetch";
|
|
403
|
+
ResourceInitiatorTypes["Iframe"] = "iframe";
|
|
404
|
+
ResourceInitiatorTypes["Video"] = "video";
|
|
405
|
+
ResourceInitiatorTypes["Audio"] = "audio";
|
|
406
|
+
ResourceInitiatorTypes["Track"] = "track";
|
|
407
|
+
ResourceInitiatorTypes["Other"] = "other";
|
|
408
|
+
})(ResourceInitiatorTypes || (ResourceInitiatorTypes = {}));
|
|
409
|
+
var ErrorSource;
|
|
410
|
+
(function (ErrorSource) {
|
|
411
|
+
ErrorSource["CONSOLE"] = "console";
|
|
412
|
+
ErrorSource["WINDOW"] = "window";
|
|
413
|
+
ErrorSource["UNHANDLED_REJECTION"] = "unhandledrejection";
|
|
414
|
+
ErrorSource["DOCUMENT"] = "document";
|
|
415
|
+
ErrorSource["CAPTURED"] = "captured";
|
|
416
|
+
ErrorSource["WEB_WORKER"] = "web_worker";
|
|
417
|
+
})(ErrorSource || (ErrorSource = {}));
|
|
418
|
+
var LogSource;
|
|
419
|
+
(function (LogSource) {
|
|
420
|
+
LogSource["CODE"] = "code";
|
|
421
|
+
})(LogSource || (LogSource = {}));
|
|
422
|
+
|
|
392
423
|
var CACHED_METADATA_KEY = '__cx_metadata__';
|
|
393
424
|
var ERROR_INSTRUMENTATION_VERSION = '1';
|
|
394
425
|
var STACK_FRAME_LIMIT = 50;
|
|
@@ -424,15 +455,6 @@ var ErrorAttributes = {
|
|
|
424
455
|
MESSAGE: 'error_message',
|
|
425
456
|
DATA: 'error_custom_data',
|
|
426
457
|
};
|
|
427
|
-
var ErrorSource;
|
|
428
|
-
(function (ErrorSource) {
|
|
429
|
-
ErrorSource["CONSOLE"] = "console";
|
|
430
|
-
ErrorSource["WINDOW"] = "window";
|
|
431
|
-
ErrorSource["UNHANDLED_REJECTION"] = "unhandledrejection";
|
|
432
|
-
ErrorSource["DOCUMENT"] = "document";
|
|
433
|
-
ErrorSource["CAPTURED"] = "captured";
|
|
434
|
-
ErrorSource["WEB_WORKER"] = "web_worker";
|
|
435
|
-
})(ErrorSource || (ErrorSource = {}));
|
|
436
458
|
function parseStackFrames(err) {
|
|
437
459
|
var stack = err.stack, message = err.message, name = err.name;
|
|
438
460
|
if (!stack) {
|
|
@@ -996,6 +1018,14 @@ var NetworkInstrumentationAttributes = {
|
|
|
996
1018
|
RESPONSE_PAYLOAD: 'response_payload',
|
|
997
1019
|
REQUEST_PAYLOAD: 'request_payload',
|
|
998
1020
|
};
|
|
1021
|
+
var FetchSource;
|
|
1022
|
+
(function (FetchSource) {
|
|
1023
|
+
FetchSource["FETCH"] = "fetch";
|
|
1024
|
+
})(FetchSource || (FetchSource = {}));
|
|
1025
|
+
var XHRSource;
|
|
1026
|
+
(function (XHRSource) {
|
|
1027
|
+
XHRSource["XHR"] = "xhr";
|
|
1028
|
+
})(XHRSource || (XHRSource = {}));
|
|
999
1029
|
|
|
1000
1030
|
function checkAttachingNetworkSpanToGlobalSpan(span) {
|
|
1001
1031
|
var activeGlobalSpan = getGlobalSpanByTraceId(span.spanContext().traceId);
|
|
@@ -1007,10 +1037,6 @@ function checkAttachingNetworkSpanToGlobalSpan(span) {
|
|
|
1007
1037
|
}
|
|
1008
1038
|
}
|
|
1009
1039
|
|
|
1010
|
-
var FetchSource;
|
|
1011
|
-
(function (FetchSource) {
|
|
1012
|
-
FetchSource["FETCH"] = "fetch";
|
|
1013
|
-
})(FetchSource || (FetchSource = {}));
|
|
1014
1040
|
var CoralogixFetchInstrumentation = (function (_super) {
|
|
1015
1041
|
__extends(CoralogixFetchInstrumentation, _super);
|
|
1016
1042
|
function CoralogixFetchInstrumentation(config) {
|
|
@@ -1151,10 +1177,6 @@ var CoralogixFetchInstrumentation = (function (_super) {
|
|
|
1151
1177
|
return CoralogixFetchInstrumentation;
|
|
1152
1178
|
}(FetchInstrumentation));
|
|
1153
1179
|
|
|
1154
|
-
var XHRSource;
|
|
1155
|
-
(function (XHRSource) {
|
|
1156
|
-
XHRSource["XHR"] = "xhr";
|
|
1157
|
-
})(XHRSource || (XHRSource = {}));
|
|
1158
1180
|
var CoralogixXhrInstrumentation = (function (_super) {
|
|
1159
1181
|
__extends(CoralogixXhrInstrumentation, _super);
|
|
1160
1182
|
function CoralogixXhrInstrumentation(config) {
|
|
@@ -1210,10 +1232,6 @@ var CoralogixXhrInstrumentation = (function (_super) {
|
|
|
1210
1232
|
}(XMLHttpRequestInstrumentation));
|
|
1211
1233
|
|
|
1212
1234
|
var CUSTOM_INSTRUMENTATION_VERSION = '1';
|
|
1213
|
-
var LogSource;
|
|
1214
|
-
(function (LogSource) {
|
|
1215
|
-
LogSource["CODE"] = "code";
|
|
1216
|
-
})(LogSource || (LogSource = {}));
|
|
1217
1235
|
var CoralogixCustomLogInstrumentation = (function (_super) {
|
|
1218
1236
|
__extends(CoralogixCustomLogInstrumentation, _super);
|
|
1219
1237
|
function CoralogixCustomLogInstrumentation(config) {
|
|
@@ -2036,24 +2054,6 @@ function resourceInitiatorTypeIs(value, types) {
|
|
|
2036
2054
|
return types.some(function (type) { return type === value; });
|
|
2037
2055
|
}
|
|
2038
2056
|
|
|
2039
|
-
var ResourceInitiatorTypes;
|
|
2040
|
-
(function (ResourceInitiatorTypes) {
|
|
2041
|
-
ResourceInitiatorTypes["Media"] = "media";
|
|
2042
|
-
ResourceInitiatorTypes["Script"] = "script";
|
|
2043
|
-
ResourceInitiatorTypes["Css"] = "css";
|
|
2044
|
-
ResourceInitiatorTypes["Beacon"] = "beacon";
|
|
2045
|
-
ResourceInitiatorTypes["Img"] = "img";
|
|
2046
|
-
ResourceInitiatorTypes["Font"] = "font";
|
|
2047
|
-
ResourceInitiatorTypes["Doc"] = "doc";
|
|
2048
|
-
ResourceInitiatorTypes["Xhr"] = "xmlhttprequest";
|
|
2049
|
-
ResourceInitiatorTypes["Fetch"] = "fetch";
|
|
2050
|
-
ResourceInitiatorTypes["Iframe"] = "iframe";
|
|
2051
|
-
ResourceInitiatorTypes["Video"] = "video";
|
|
2052
|
-
ResourceInitiatorTypes["Audio"] = "audio";
|
|
2053
|
-
ResourceInitiatorTypes["Track"] = "track";
|
|
2054
|
-
ResourceInitiatorTypes["Other"] = "other";
|
|
2055
|
-
})(ResourceInitiatorTypes || (ResourceInitiatorTypes = {}));
|
|
2056
|
-
|
|
2057
2057
|
function isPatternMatch(str, arr, warnKey) {
|
|
2058
2058
|
return arr.some(function (item) {
|
|
2059
2059
|
if (item instanceof RegExp) {
|
|
@@ -2279,9 +2279,11 @@ function extractTestId(el) {
|
|
|
2279
2279
|
return (el === null || el === void 0 ? void 0 : el.getAttribute(DATA_TEST_ATTRIBUTE)) || '';
|
|
2280
2280
|
}
|
|
2281
2281
|
function extractResolvedName(_a) {
|
|
2282
|
-
var element = _a.element, config = _a.config, actionName = _a.actionName, ariaLabel = _a.ariaLabel;
|
|
2282
|
+
var isDeadClick = _a.isDeadClick, element = _a.element, config = _a.config, actionName = _a.actionName, ariaLabel = _a.ariaLabel;
|
|
2283
2283
|
if (!element)
|
|
2284
2284
|
return '';
|
|
2285
|
+
if (isDeadClick)
|
|
2286
|
+
return '';
|
|
2285
2287
|
var resolveName = actionName ||
|
|
2286
2288
|
maskedTextIfMasked(element, config) ||
|
|
2287
2289
|
resolveFallbackName(element, ariaLabel, ANCESTOR_SEARCH_DEPTH);
|
|
@@ -2687,17 +2689,19 @@ var CoralogixUserInteractionInstrumentation = (function (_super) {
|
|
|
2687
2689
|
}
|
|
2688
2690
|
if (eventTarget instanceof Element) {
|
|
2689
2691
|
var clickableElement = findClickableElement(eventTarget);
|
|
2692
|
+
var isDeadClick = clickableElement === null;
|
|
2690
2693
|
var elementText = extractMaskedOrTextContent(eventTarget, config);
|
|
2691
2694
|
var cxActionName = extractActionName(eventTarget);
|
|
2692
2695
|
var ariaLabel = extractAriaLabel(eventTarget);
|
|
2693
2696
|
var testId = extractTestId(eventTarget);
|
|
2694
2697
|
var resolvedName = extractResolvedName({
|
|
2698
|
+
isDeadClick: isDeadClick,
|
|
2695
2699
|
element: eventTarget,
|
|
2696
2700
|
config: config,
|
|
2697
2701
|
actionName: cxActionName,
|
|
2698
2702
|
ariaLabel: ariaLabel,
|
|
2699
2703
|
});
|
|
2700
|
-
span.setAttribute(CoralogixAttributes.IS_DEAD_CLICK,
|
|
2704
|
+
span.setAttribute(CoralogixAttributes.IS_DEAD_CLICK, isDeadClick);
|
|
2701
2705
|
var _b = eventTarget.getBoundingClientRect(), width = _b.width, height = _b.height;
|
|
2702
2706
|
span.setAttribute(CoralogixAttributes.ELEMENT_WIDTH, width);
|
|
2703
2707
|
span.setAttribute(CoralogixAttributes.ELEMENT_HEIGHT, height);
|
|
@@ -2709,19 +2713,25 @@ var CoralogixUserInteractionInstrumentation = (function (_super) {
|
|
|
2709
2713
|
: false;
|
|
2710
2714
|
span.setAttribute(CoralogixAttributes.IS_RAGE_CLICK, isRageClick);
|
|
2711
2715
|
}
|
|
2712
|
-
[
|
|
2716
|
+
var spanAttributes = [
|
|
2713
2717
|
[CoralogixAttributes.ELEMENT_ID, id],
|
|
2714
2718
|
[CoralogixAttributes.ELEMENT_CLASSES, getClassName(eventTarget)],
|
|
2715
2719
|
[CoralogixAttributes.TARGET_ELEMENT_TYPE, type],
|
|
2716
2720
|
[CoralogixAttributes.ELEMENT_INNER_TEXT, elementText],
|
|
2717
2721
|
[CoralogixAttributes.TARGET_ELEMENT, nodeName],
|
|
2718
|
-
[
|
|
2722
|
+
[
|
|
2723
|
+
CoralogixAttributes.RESOLVED_NAME,
|
|
2724
|
+
isDeadClick ? undefined : resolvedName,
|
|
2725
|
+
],
|
|
2719
2726
|
[CoralogixAttributes.CX_ACTION_NAME, cxActionName],
|
|
2720
2727
|
[CoralogixAttributes.ARIA_LABEL, ariaLabel],
|
|
2721
2728
|
[CoralogixAttributes.TEST_ID, testId],
|
|
2722
|
-
]
|
|
2729
|
+
];
|
|
2730
|
+
spanAttributes.forEach(function (_a) {
|
|
2723
2731
|
var _b = __read$1(_a, 2), key = _b[0], value = _b[1];
|
|
2724
|
-
|
|
2732
|
+
if (value !== undefined) {
|
|
2733
|
+
span.setAttribute(key, value);
|
|
2734
|
+
}
|
|
2725
2735
|
});
|
|
2726
2736
|
}
|
|
2727
2737
|
span.end();
|
|
@@ -5196,7 +5206,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
|
|
|
5196
5206
|
return resolvedUrlBlueprinters;
|
|
5197
5207
|
}
|
|
5198
5208
|
|
|
5199
|
-
var SDK_VERSION = '3.23.
|
|
5209
|
+
var SDK_VERSION = '3.23.2';
|
|
5200
5210
|
|
|
5201
5211
|
function shouldDropEvent(cxRumEvent, options) {
|
|
5202
5212
|
if (isDocumentErrorWithoutMessage(cxRumEvent)) {
|
|
@@ -5820,6 +5830,31 @@ var spanMapProcessor;
|
|
|
5820
5830
|
var navigationProcessor;
|
|
5821
5831
|
var exporter;
|
|
5822
5832
|
var timeMeasurementTracker;
|
|
5833
|
+
function getResolvedName(element, fullData) {
|
|
5834
|
+
if (fullData === void 0) { fullData = false; }
|
|
5835
|
+
if (!isInited) {
|
|
5836
|
+
console.debug('CoralogixRum must be initiated before resolving element names');
|
|
5837
|
+
return;
|
|
5838
|
+
}
|
|
5839
|
+
try {
|
|
5840
|
+
var isDeadClick = findClickableElement(element) === null;
|
|
5841
|
+
var actionName = extractActionName(element);
|
|
5842
|
+
var ariaLabel = extractAriaLabel(element);
|
|
5843
|
+
var resolvedName = extractResolvedName({
|
|
5844
|
+
isDeadClick: isDeadClick,
|
|
5845
|
+
element: element,
|
|
5846
|
+
config: getSdkConfig(),
|
|
5847
|
+
actionName: actionName,
|
|
5848
|
+
ariaLabel: ariaLabel,
|
|
5849
|
+
});
|
|
5850
|
+
return fullData
|
|
5851
|
+
? { resolvedName: resolvedName, isDeadClick: isDeadClick, actionName: actionName, ariaLabel: ariaLabel }
|
|
5852
|
+
: resolvedName;
|
|
5853
|
+
}
|
|
5854
|
+
catch (err) {
|
|
5855
|
+
return;
|
|
5856
|
+
}
|
|
5857
|
+
}
|
|
5823
5858
|
var CoralogixRum = {
|
|
5824
5859
|
get isInited() {
|
|
5825
5860
|
return isInited;
|
|
@@ -6153,23 +6188,7 @@ var CoralogixRum = {
|
|
|
6153
6188
|
var _a, _b;
|
|
6154
6189
|
return (_b = (_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.getSession()) === null || _b === void 0 ? void 0 : _b.sessionId;
|
|
6155
6190
|
},
|
|
6156
|
-
getResolvedName:
|
|
6157
|
-
if (!isInited) {
|
|
6158
|
-
console.debug('CoralogixRum must be initiated before resolving element names');
|
|
6159
|
-
return;
|
|
6160
|
-
}
|
|
6161
|
-
try {
|
|
6162
|
-
return extractResolvedName({
|
|
6163
|
-
element: element,
|
|
6164
|
-
config: getSdkConfig(),
|
|
6165
|
-
actionName: extractActionName(element),
|
|
6166
|
-
ariaLabel: extractAriaLabel(element),
|
|
6167
|
-
});
|
|
6168
|
-
}
|
|
6169
|
-
catch (err) {
|
|
6170
|
-
return;
|
|
6171
|
-
}
|
|
6172
|
-
},
|
|
6191
|
+
getResolvedName: getResolvedName,
|
|
6173
6192
|
getViewName: function () {
|
|
6174
6193
|
var _a;
|
|
6175
6194
|
if (!isInited) {
|
package/package.json
CHANGED
package/src/coralogix-rum.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CoralogixOtelWebType, CoralogixWindow, CxSpan } from './types';
|
|
2
|
-
import { MemoryUsageContext } from './instrumentations/memory-usage';
|
|
2
|
+
import { MemoryUsageContext } from './instrumentations/memory-usage/memory-usage.types';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Worker {
|
|
5
5
|
CoralogixRum: CoralogixOtelWebType;
|
|
@@ -2,9 +2,6 @@ import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instr
|
|
|
2
2
|
import { CoralogixLogSeverity } from '../types-external';
|
|
3
3
|
import { CoralogixRumLabels } from '../types';
|
|
4
4
|
export declare const CUSTOM_INSTRUMENTATION_VERSION = "1";
|
|
5
|
-
export declare enum LogSource {
|
|
6
|
-
CODE = "code"
|
|
7
|
-
}
|
|
8
5
|
interface CustomLogParams {
|
|
9
6
|
severity: CoralogixLogSeverity;
|
|
10
7
|
message: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
2
2
|
import { CoralogixRumLabels, CxStackFrame } from '../types';
|
|
3
|
+
import { ErrorSource } from './instrumentation.model';
|
|
3
4
|
export declare const STACK_FRAME_LIMIT = 50;
|
|
4
5
|
export declare const STACK_LINE_LIMIT = 1024;
|
|
5
6
|
export declare function sanitizeConsoleErrorStack(stack: string | undefined): string | undefined;
|
|
@@ -11,14 +12,6 @@ export declare const ErrorAttributes: {
|
|
|
11
12
|
MESSAGE: string;
|
|
12
13
|
DATA: string;
|
|
13
14
|
};
|
|
14
|
-
export declare enum ErrorSource {
|
|
15
|
-
CONSOLE = "console",
|
|
16
|
-
WINDOW = "window",
|
|
17
|
-
UNHANDLED_REJECTION = "unhandledrejection",
|
|
18
|
-
DOCUMENT = "document",
|
|
19
|
-
CAPTURED = "captured",
|
|
20
|
-
WEB_WORKER = "web_worker"
|
|
21
|
-
}
|
|
22
15
|
interface CoralogixErrorInstrumentationConfig extends InstrumentationConfig {
|
|
23
16
|
ignoreErrors?: Array<string | RegExp>;
|
|
24
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { CoralogixInternalEvent } from './instrumentation.model';
|
|
2
3
|
export declare const INTERNAL_INSTRUMENTATION_VERSION = "1";
|
|
3
|
-
export type CoralogixInternalEvent = 'init' | 'recording-start' | 'recording-stop' | 'session-end' | 'error';
|
|
4
4
|
export declare class CoralogixInternalInstrumentation extends InstrumentationBase {
|
|
5
5
|
constructor(config: InstrumentationConfig);
|
|
6
6
|
protected init(): void;
|
|
@@ -20,3 +20,15 @@ export type InternalInstrumentationConfig = {
|
|
|
20
20
|
confKey: keyof CoralogixOtelWebOptionsInstrumentations | CoralogixEventType;
|
|
21
21
|
disable: boolean;
|
|
22
22
|
};
|
|
23
|
+
export declare enum ErrorSource {
|
|
24
|
+
CONSOLE = "console",
|
|
25
|
+
WINDOW = "window",
|
|
26
|
+
UNHANDLED_REJECTION = "unhandledrejection",
|
|
27
|
+
DOCUMENT = "document",
|
|
28
|
+
CAPTURED = "captured",
|
|
29
|
+
WEB_WORKER = "web_worker"
|
|
30
|
+
}
|
|
31
|
+
export declare enum LogSource {
|
|
32
|
+
CODE = "code"
|
|
33
|
+
}
|
|
34
|
+
export type CoralogixInternalEvent = 'init' | 'recording-start' | 'recording-stop' | 'session-end' | 'error';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { FetchInstrumentation, FetchInstrumentationConfig } from '@opentelemetry/instrumentation-fetch';
|
|
2
|
-
export declare enum FetchSource {
|
|
3
|
-
FETCH = "fetch"
|
|
4
|
-
}
|
|
5
2
|
export declare class CoralogixFetchInstrumentation extends FetchInstrumentation {
|
|
6
3
|
private networkDataManager;
|
|
7
4
|
private headersManager;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { XMLHttpRequestInstrumentation, XMLHttpRequestInstrumentationConfig } from '@opentelemetry/instrumentation-xml-http-request';
|
|
2
|
-
export declare enum XHRSource {
|
|
3
|
-
XHR = "xhr"
|
|
4
|
-
}
|
|
5
2
|
export declare class CoralogixXhrInstrumentation extends XMLHttpRequestInstrumentation {
|
|
6
3
|
private networkDataManager;
|
|
7
4
|
private headersManager;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { InstrumentationBase
|
|
2
|
-
import {
|
|
1
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { CoralogixUserInteractionInstrumentationConfig, UserInteractionEventsConfig } from './user-interaction.types';
|
|
3
3
|
export declare const USER_INTERACTION_INSTRUMENTATION_NAME = "interactions";
|
|
4
4
|
export declare const USER_INTERACTION_INSTRUMENTATION_VERSION = "1";
|
|
5
|
-
export type UserInteractionEventsConfig = Partial<Record<EventName, boolean>>;
|
|
6
|
-
export interface CoralogixUserInteractionInstrumentationConfig extends InstrumentationConfig {
|
|
7
|
-
events?: UserInteractionEventsConfig;
|
|
8
|
-
}
|
|
9
5
|
export declare const DEFAULT_INSTRUMENTED_EVENTS: UserInteractionEventsConfig;
|
|
10
6
|
export declare class CoralogixUserInteractionInstrumentation extends InstrumentationBase<CoralogixUserInteractionInstrumentationConfig> {
|
|
11
7
|
private readonly rageClicksTracker;
|
|
@@ -2,7 +2,8 @@ import { CoralogixBrowserSdkConfig } from '../../types';
|
|
|
2
2
|
export declare function extractActionName(el: Element | HTMLElement | null): string;
|
|
3
3
|
export declare function extractAriaLabel(el: Element | HTMLElement | null): string;
|
|
4
4
|
export declare function extractTestId(el: Element | HTMLElement | null): string;
|
|
5
|
-
export declare function extractResolvedName({ element, config, actionName, ariaLabel, }: {
|
|
5
|
+
export declare function extractResolvedName({ isDeadClick, element, config, actionName, ariaLabel, }: {
|
|
6
|
+
isDeadClick: boolean;
|
|
6
7
|
element: Element | HTMLElement | null;
|
|
7
8
|
config: CoralogixBrowserSdkConfig;
|
|
8
9
|
actionName: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CLSMetricWithAttribution, FCPMetricWithAttribution, FIDMetricWithAttribution, INPMetricWithAttribution, LCPMetricWithAttribution, Metric, TTFBMetricWithAttribution } from 'web-vitals/attribution';
|
|
2
2
|
import { WebVitalsRating } from '../../types';
|
|
3
|
-
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
4
3
|
export type CustomMetric = {
|
|
5
4
|
name: 'SN' | 'LT' | 'TBT' | 'TTI';
|
|
6
5
|
id: string;
|
|
@@ -57,7 +56,8 @@ export interface CoralogixWebVitalsMetrics {
|
|
|
57
56
|
tbt: boolean;
|
|
58
57
|
lt: boolean;
|
|
59
58
|
}
|
|
60
|
-
export interface CoralogixWebVitalsInstrumentationConfig
|
|
59
|
+
export interface CoralogixWebVitalsInstrumentationConfig {
|
|
60
|
+
enabled?: boolean;
|
|
61
61
|
metrics: Partial<CoralogixWebVitalsMetrics>;
|
|
62
62
|
}
|
|
63
63
|
export declare const ALL_WEB_VITALS_METRICS: CoralogixWebVitalsMetrics;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CoralogixInternalEvent } from './instrumentations/
|
|
1
|
+
import { CoralogixInternalEvent } from './instrumentations/instrumentation.model';
|
|
2
2
|
export declare const reportInternalEvent: (event: CoralogixInternalEvent, message?: string) => void;
|
package/src/types.d.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { Attributes, TextMapPropagator } from '@opentelemetry/api';
|
|
1
|
+
import { Attributes, HrTime, SpanKind, SpanStatusCode, TextMapPropagator } from '@opentelemetry/api';
|
|
2
2
|
import { CoralogixDomainsApiUrlMap } from './constants';
|
|
3
3
|
import { CoralogixLogSeverity } from './types-external';
|
|
4
|
-
import { ErrorSource } from './instrumentations/
|
|
5
|
-
import { FetchSource } from './instrumentations/network/
|
|
6
|
-
import {
|
|
7
|
-
import { LogSource } from './instrumentations/CoralogixCustomLogInstrumentation';
|
|
8
|
-
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
9
|
-
import { CoralogixUserInteractionInstrumentationConfig } from './instrumentations/user-interaction/CoralogixUserInteractionInstrumentation';
|
|
4
|
+
import { CoralogixInternalEvent, ErrorSource, LogSource } from './instrumentations/instrumentation.model';
|
|
5
|
+
import { FetchSource, XHRSource } from './instrumentations/network/constants';
|
|
6
|
+
import { CoralogixUserInteractionInstrumentationConfig } from './instrumentations/user-interaction/user-interaction.types';
|
|
10
7
|
import { Metric } from 'web-vitals/attribution';
|
|
11
8
|
import { CoralogixWebVitalsInstrumentationConfig } from './instrumentations/web-vitals/web-vitals.types';
|
|
12
9
|
import { SessionConfig, SessionRecordingConfig } from './session/session.model';
|
|
13
|
-
import { CoralogixInternalEvent } from './instrumentations/CoralogixInternalInstrumentation';
|
|
14
10
|
import { SnapshotContext } from './snapshot/snapshot.model';
|
|
15
11
|
import { MetricWithAttribution } from 'web-vitals';
|
|
16
|
-
import { MemoryUsageContext } from './instrumentations/memory-usage';
|
|
12
|
+
import { MemoryUsageContext } from './instrumentations/memory-usage/memory-usage.types';
|
|
17
13
|
import { MFEMetadata } from './mfe/mfe.types';
|
|
18
14
|
import { UrlBasedLabelProvider } from './label-providers/url-based-label-provider';
|
|
19
|
-
import { CustomTracer, CustomTracerIgnoredInstruments } from './custom-spans';
|
|
15
|
+
import { CustomTracer, CustomTracerIgnoredInstruments } from './custom-spans/custom-spans.types';
|
|
20
16
|
import { TraceExporterData } from './traces-exporter/traces-exporter.types';
|
|
21
17
|
export interface CxStackFrame extends Partial<MFEMetadata> {
|
|
22
18
|
fileName?: string;
|
|
@@ -176,6 +172,12 @@ export interface CoralogixBrowserSdkConfig {
|
|
|
176
172
|
runOutsideAngularZone?: boolean;
|
|
177
173
|
sdkFetchPriority?: SdkFetchPriority;
|
|
178
174
|
}
|
|
175
|
+
export interface ResolvedNameDetails {
|
|
176
|
+
resolvedName: string;
|
|
177
|
+
isDeadClick: boolean;
|
|
178
|
+
actionName: string;
|
|
179
|
+
ariaLabel: string;
|
|
180
|
+
}
|
|
179
181
|
export interface CoralogixOtelWebType extends SendLog {
|
|
180
182
|
init: (options: CoralogixBrowserSdkConfig) => void;
|
|
181
183
|
shutdown: () => void;
|
|
@@ -189,7 +191,11 @@ export interface CoralogixOtelWebType extends SendLog {
|
|
|
189
191
|
measureUserAgentSpecificMemory: () => void;
|
|
190
192
|
getUserContext: () => UserContextConfig | undefined;
|
|
191
193
|
getSessionId: () => string | undefined;
|
|
192
|
-
getResolvedName:
|
|
194
|
+
getResolvedName: {
|
|
195
|
+
(element: Element, fullData?: false): string | undefined;
|
|
196
|
+
(element: Element, fullData: true): ResolvedNameDetails | undefined;
|
|
197
|
+
(element: Element, fullData: boolean): string | ResolvedNameDetails | undefined;
|
|
198
|
+
};
|
|
193
199
|
getViewName: () => string | undefined;
|
|
194
200
|
getSdkVersion: () => string;
|
|
195
201
|
createNewSession: () => void;
|
|
@@ -343,8 +349,21 @@ interface SpanContext {
|
|
|
343
349
|
interface OtelResource {
|
|
344
350
|
attributes: Attributes;
|
|
345
351
|
}
|
|
352
|
+
interface OtelSpanData extends SpanContext {
|
|
353
|
+
parentSpanId?: string;
|
|
354
|
+
name?: string;
|
|
355
|
+
kind?: SpanKind;
|
|
356
|
+
attributes?: Attributes;
|
|
357
|
+
startTime?: HrTime;
|
|
358
|
+
endTime?: HrTime;
|
|
359
|
+
duration?: HrTime;
|
|
360
|
+
status?: {
|
|
361
|
+
code: SpanStatusCode | number;
|
|
362
|
+
message?: string;
|
|
363
|
+
};
|
|
364
|
+
}
|
|
346
365
|
interface InstrumentationData {
|
|
347
|
-
otelSpan:
|
|
366
|
+
otelSpan: OtelSpanData;
|
|
348
367
|
otelResource: OtelResource;
|
|
349
368
|
}
|
|
350
369
|
interface VersionMetaData {
|
package/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.23.
|
|
1
|
+
export declare const SDK_VERSION = "3.23.2";
|