@coralogix/browser 3.7.1 → 3.8.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 +18 -0
- package/README.md +17 -2
- package/index.esm2.js +98 -28
- package/package.json +1 -1
- package/sessionRecorder.esm.js +5 -1
- package/src/index.d.ts +1 -0
- package/src/instrumentations/CoralogixErrorInstrumentation.d.ts +1 -0
- package/src/otel/custom-sampler.d.ts +2 -1
- package/src/session/session.consts.d.ts +2 -0
- package/src/session/session.helper.d.ts +1 -2
- package/src/session/session.model.d.ts +2 -0
- package/src/session/sessionRecorder.d.ts +1 -0
- package/src/tools/cx-timers.d.ts +1 -0
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 3.8.2 (2026-05-06)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- run web vitals listeners outside zone
|
|
6
|
+
|
|
7
|
+
## 3.8.1 (2026-05-06)
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
Improve error stack trace handling.
|
|
12
|
+
|
|
13
|
+
## 3.8.0 (2026-04-27)
|
|
14
|
+
|
|
15
|
+
### 🚀 Features
|
|
16
|
+
|
|
17
|
+
- Add support for excluding specific instrumentations from session sampling
|
|
18
|
+
|
|
1
19
|
## 3.7.1 (2026-04-26)
|
|
2
20
|
|
|
3
21
|
### 🩹 Fixes
|
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
- [Basic Sampling](#1-basic-sampling---sample--of-all-sessions)
|
|
11
11
|
- [Advanced Sampling](#2-advanced-sampling---sample--of-sessions-but-always-track-sessions-with-errors)
|
|
12
|
-
- [
|
|
12
|
+
- [Exclude Specific Instrumentations from Sampling](#3-exclude-specific-instrumentations-from-sampling)
|
|
13
|
+
- [Only Sessions with Errors](#4-only-sessions-with-errors)
|
|
13
14
|
|
|
14
15
|
6. [Sending Custom Logs](#sending-custom-logs)
|
|
15
16
|
7. [Instrumentations](#instrumentations)
|
|
@@ -162,7 +163,21 @@ CoralogixRum.init({
|
|
|
162
163
|
});
|
|
163
164
|
```
|
|
164
165
|
|
|
165
|
-
#### 3.
|
|
166
|
+
#### 3. Exclude Specific Instrumentations from Sampling
|
|
167
|
+
|
|
168
|
+
Keep specific instrumentations running at 100% even when sessions are sampled out. This is useful when you want to reduce data volume with sampling but still capture all errors or custom logs.
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
CoralogixRum.init({
|
|
172
|
+
// ...
|
|
173
|
+
sessionConfig: {
|
|
174
|
+
sessionSampleRate: 20, // Only 20% of sessions are fully tracked
|
|
175
|
+
excludeFromSampling: ['custom'], // These will run at 100% regardless of sampling
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### 4. Only Sessions with Errors
|
|
166
181
|
|
|
167
182
|
Track only sessions with errors, and send specific instrumentation data immediately even if error is not occurred.
|
|
168
183
|
From Session recording perspective, the SDK will record approximately 10–60s(according to maxRecordTime property) before the error occurred.
|
package/index.esm2.js
CHANGED
|
@@ -220,6 +220,7 @@ var DEFAULT_SESSION_CONFIG = {
|
|
|
220
220
|
onlyWithErrorConfig: {
|
|
221
221
|
enable: false,
|
|
222
222
|
},
|
|
223
|
+
excludeFromSampling: [],
|
|
223
224
|
};
|
|
224
225
|
var SESSION_IDLE_TIME = 15 * millisecondsPerMinute;
|
|
225
226
|
var SESSION_EXPIRATION_TIME = MILLISECONDS_PER_HOUR;
|
|
@@ -373,6 +374,23 @@ var STACK_FRAME_LIMIT = 50;
|
|
|
373
374
|
var STACK_LINE_LIMIT = 1024;
|
|
374
375
|
var MESSAGE_LIMIT = 1024;
|
|
375
376
|
var MFE_PATH_PATTERN = /https?:\/\/.*\//;
|
|
377
|
+
var V8_HEADER_PATTERN = /^Error\b/;
|
|
378
|
+
function sanitizeConsoleErrorStack(stack) {
|
|
379
|
+
var _a;
|
|
380
|
+
if (!stack)
|
|
381
|
+
return stack;
|
|
382
|
+
var lines = stack.split('\n');
|
|
383
|
+
if (lines.length === 0)
|
|
384
|
+
return stack;
|
|
385
|
+
if (V8_HEADER_PATTERN.test(lines[0])) {
|
|
386
|
+
lines = lines.slice(1);
|
|
387
|
+
}
|
|
388
|
+
lines = lines.slice(1);
|
|
389
|
+
if ((_a = getSessionRecorder()) === null || _a === void 0 ? void 0 : _a.isConsoleRecordingActive()) {
|
|
390
|
+
lines = lines.slice(1);
|
|
391
|
+
}
|
|
392
|
+
return lines.join('\n');
|
|
393
|
+
}
|
|
376
394
|
function extractMfePath(fileName) {
|
|
377
395
|
var _a;
|
|
378
396
|
var _b = __read$1((_a = fileName.match(MFE_PATH_PATTERN)) !== null && _a !== void 0 ? _a : [], 1), mfePath = _b[0];
|
|
@@ -525,6 +543,7 @@ var _consoleErrorHandler = function (errorInstrumentation) {
|
|
|
525
543
|
args[_i] = arguments[_i];
|
|
526
544
|
}
|
|
527
545
|
var stackContextError = new Error();
|
|
546
|
+
stackContextError.stack = sanitizeConsoleErrorStack(stackContextError.stack);
|
|
528
547
|
errorInstrumentation.report(ErrorSource.CONSOLE, args, stackContextError);
|
|
529
548
|
return original.apply(console, args);
|
|
530
549
|
};
|
|
@@ -1384,6 +1403,16 @@ function createCxMutationObserver(callback) {
|
|
|
1384
1403
|
var OriginalMutationObserver = getZoneJsOriginalDom(browserWindow, 'MutationObserver');
|
|
1385
1404
|
return new OriginalMutationObserver(callback);
|
|
1386
1405
|
}
|
|
1406
|
+
function cxRunOutsideZone(fn) {
|
|
1407
|
+
if (!shouldRunOutsideZone()) {
|
|
1408
|
+
return fn();
|
|
1409
|
+
}
|
|
1410
|
+
var zone = getBrowserWindow().Zone;
|
|
1411
|
+
if (zone && zone.root && typeof zone.root.run === 'function') {
|
|
1412
|
+
return zone.root.run(fn);
|
|
1413
|
+
}
|
|
1414
|
+
return fn();
|
|
1415
|
+
}
|
|
1387
1416
|
|
|
1388
1417
|
/** Original source: https://www.npmjs.com/package/tti-polyfill?activeTab=code
|
|
1389
1418
|
* @license Apache-2.0
|
|
@@ -1683,11 +1712,13 @@ var CoralogixWebVitalsInstrumentation = (function (_super) {
|
|
|
1683
1712
|
if (!isPerformanceObserverSupported()) {
|
|
1684
1713
|
return _this;
|
|
1685
1714
|
}
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
_this.
|
|
1690
|
-
|
|
1715
|
+
cxRunOutsideZone(function () {
|
|
1716
|
+
_this.registerToCoreWebVitalMetrics();
|
|
1717
|
+
_this.registerToCalculatedWebVitalMetrics();
|
|
1718
|
+
if (_this.isSoftNavsEnabled) {
|
|
1719
|
+
_this.registerToSoftNavigations();
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1691
1722
|
return _this;
|
|
1692
1723
|
}
|
|
1693
1724
|
CoralogixWebVitalsInstrumentation.prototype.registerToCoreWebVitalMetrics = function () {
|
|
@@ -3390,13 +3421,19 @@ var Request = (function () {
|
|
|
3390
3421
|
return Request;
|
|
3391
3422
|
}());
|
|
3392
3423
|
|
|
3424
|
+
var PROPAGATE_ONLY = { decision: SamplingDecision.RECORD };
|
|
3425
|
+
var EXPORT = { decision: SamplingDecision.RECORD_AND_SAMPLED };
|
|
3393
3426
|
var CxCustomSampler = (function () {
|
|
3394
3427
|
function CxCustomSampler() {
|
|
3395
3428
|
}
|
|
3396
|
-
CxCustomSampler.prototype.shouldSample = function () {
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3429
|
+
CxCustomSampler.prototype.shouldSample = function (_context, _traceId, _spanName, _spanKind, attributes) {
|
|
3430
|
+
var _a, _b;
|
|
3431
|
+
var excluded = (_b = (_a = getSdkConfig().sessionConfig) === null || _a === void 0 ? void 0 : _a.excludeFromSampling) !== null && _b !== void 0 ? _b : [];
|
|
3432
|
+
var isHttpSpan = Boolean(attributes['http.method']);
|
|
3433
|
+
if (isHttpSpan) {
|
|
3434
|
+
return excluded.includes('fetch') || excluded.includes('xhr') ? EXPORT : PROPAGATE_ONLY;
|
|
3435
|
+
}
|
|
3436
|
+
return excluded.length > 0 ? EXPORT : PROPAGATE_ONLY;
|
|
3400
3437
|
};
|
|
3401
3438
|
return CxCustomSampler;
|
|
3402
3439
|
}());
|
|
@@ -3446,28 +3483,61 @@ var isSessionWithError = function () {
|
|
|
3446
3483
|
var _a = getSessionManager(), onlySessionWithErrorMode = _a.onlySessionWithErrorMode, cachedLogsSent = _a.cachedLogsSent;
|
|
3447
3484
|
return onlySessionWithErrorMode && !cachedLogsSent;
|
|
3448
3485
|
};
|
|
3449
|
-
function getResolvedSampler(
|
|
3450
|
-
var
|
|
3451
|
-
var sessionSampleRate =
|
|
3486
|
+
function getResolvedSampler() {
|
|
3487
|
+
var config = getSdkConfig();
|
|
3488
|
+
var sessionSampleRate = config.sessionSampleRate, sessionConfig = config.sessionConfig;
|
|
3452
3489
|
var shouldNotTrackSession = !isSamplingOn(sessionSampleRate) ||
|
|
3453
3490
|
!isSamplingOn(sessionConfig.sessionSampleRate);
|
|
3454
3491
|
if (shouldNotTrackSession) {
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
sessionConfig.onlyWithErrorConfig = __assign(__assign({}, sessionConfig.onlyWithErrorConfig), { enable: true });
|
|
3492
|
+
if (sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.alwaysTrackSessionsWithErrors) {
|
|
3493
|
+
return enableErrorOnlyMode();
|
|
3458
3494
|
}
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3495
|
+
return handleDroppedSession();
|
|
3496
|
+
}
|
|
3497
|
+
return new AlwaysOnSampler();
|
|
3498
|
+
}
|
|
3499
|
+
function enableErrorOnlyMode() {
|
|
3500
|
+
var sessionConfig = getSdkConfig().sessionConfig;
|
|
3501
|
+
if (sessionConfig) {
|
|
3502
|
+
sessionConfig.onlyWithErrorConfig = __assign(__assign({}, sessionConfig.onlyWithErrorConfig), { enable: true });
|
|
3503
|
+
}
|
|
3504
|
+
return new AlwaysOnSampler();
|
|
3505
|
+
}
|
|
3506
|
+
function handleDroppedSession() {
|
|
3507
|
+
var e_1, _a;
|
|
3508
|
+
var _b, _c;
|
|
3509
|
+
var config = getSdkConfig();
|
|
3510
|
+
var sessionRecordingConfig = config.sessionRecordingConfig, sessionConfig = config.sessionConfig, debug = config.debug;
|
|
3511
|
+
if (debug) {
|
|
3512
|
+
console.log('CoralogixRum: Session tracking is disabled due to sampling rate');
|
|
3513
|
+
}
|
|
3514
|
+
if (sessionRecordingConfig) {
|
|
3515
|
+
sessionRecordingConfig.enable = false;
|
|
3516
|
+
}
|
|
3517
|
+
var excluded = (_b = sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.excludeFromSampling) !== null && _b !== void 0 ? _b : [];
|
|
3518
|
+
var nonHttpInstrumentations = [
|
|
3519
|
+
'errors',
|
|
3520
|
+
'custom',
|
|
3521
|
+
'web_vitals',
|
|
3522
|
+
'interactions',
|
|
3523
|
+
'long_tasks',
|
|
3524
|
+
'resources',
|
|
3525
|
+
];
|
|
3526
|
+
(_c = config.instrumentations) !== null && _c !== void 0 ? _c : (config.instrumentations = {});
|
|
3527
|
+
try {
|
|
3528
|
+
for (var nonHttpInstrumentations_1 = __values$1(nonHttpInstrumentations), nonHttpInstrumentations_1_1 = nonHttpInstrumentations_1.next(); !nonHttpInstrumentations_1_1.done; nonHttpInstrumentations_1_1 = nonHttpInstrumentations_1.next()) {
|
|
3529
|
+
var key = nonHttpInstrumentations_1_1.value;
|
|
3530
|
+
config.instrumentations[key] = excluded.includes(key);
|
|
3468
3531
|
}
|
|
3469
3532
|
}
|
|
3470
|
-
|
|
3533
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3534
|
+
finally {
|
|
3535
|
+
try {
|
|
3536
|
+
if (nonHttpInstrumentations_1_1 && !nonHttpInstrumentations_1_1.done && (_a = nonHttpInstrumentations_1.return)) _a.call(nonHttpInstrumentations_1);
|
|
3537
|
+
}
|
|
3538
|
+
finally { if (e_1) throw e_1.error; }
|
|
3539
|
+
}
|
|
3540
|
+
return new CxCustomSampler();
|
|
3471
3541
|
}
|
|
3472
3542
|
|
|
3473
3543
|
function isProcessorShouldStop(isActive) {
|
|
@@ -4230,7 +4300,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
|
|
|
4230
4300
|
return resolvedUrlBlueprinters;
|
|
4231
4301
|
}
|
|
4232
4302
|
|
|
4233
|
-
var SDK_VERSION = '3.
|
|
4303
|
+
var SDK_VERSION = '3.8.2';
|
|
4234
4304
|
|
|
4235
4305
|
function shouldDropEvent(cxRumEvent, options) {
|
|
4236
4306
|
if (isDocumentErrorWithoutMessage(cxRumEvent)) {
|
|
@@ -4846,7 +4916,7 @@ var CoralogixRum = {
|
|
|
4846
4916
|
}
|
|
4847
4917
|
CxGlobal[USER_AGENT_KEY] = parseUserAgent(navigator.userAgent);
|
|
4848
4918
|
CxGlobal[SDK_CONFIG_KEY] = resolvedOptions_1;
|
|
4849
|
-
var sampler = getResolvedSampler(
|
|
4919
|
+
var sampler = getResolvedSampler();
|
|
4850
4920
|
if (!resolvedOptions_1.debug && !resolvedOptions_1.public_key) {
|
|
4851
4921
|
console.warn('rumAuth will be required in the future');
|
|
4852
4922
|
}
|
|
@@ -5243,4 +5313,4 @@ var SessionRecordingEventType;
|
|
|
5243
5313
|
SessionRecordingEventType[SessionRecordingEventType["Plugin"] = 6] = "Plugin";
|
|
5244
5314
|
})(SessionRecordingEventType || (SessionRecordingEventType = {}));
|
|
5245
5315
|
|
|
5246
|
-
export { BATCH_TIME_DELAY as B, CxGlobal as C, MAX_BATCH_TIME_MS as M, OtelNetworkAttrs as O, PerformanceTypes as P, Request as R, SESSION_RECORDER_SEGMENTS_MAP as S, UrlBasedLabelProvider as U, cxClearTimeout as a, createCxMutationObserver as b, cxSetTimeout as c, cxRequestAnimationFrame as d, cxCancelAnimationFrame as e,
|
|
5316
|
+
export { BATCH_TIME_DELAY as B, CxGlobal as C, MAX_BATCH_TIME_MS as M, OtelNetworkAttrs as O, PerformanceTypes as P, Request as R, SESSION_RECORDER_SEGMENTS_MAP as S, UrlBasedLabelProvider as U, cxClearTimeout as a, createCxMutationObserver as b, cxSetTimeout as c, cxRequestAnimationFrame as d, cxCancelAnimationFrame as e, getSdkConfig as f, getZoneJsOriginalDom as g, cxClearInterval as h, getNowTime as i, SESSION_RECORDING_NETWORK_ERR0R_MESSAGE as j, cxSetInterval as k, SESSION_RECORDING_DEFAULT_HEADERS as l, SESSION_RECORDING_POSTFIX_URL as m, SESSION_RECORDER_KEY as n, SESSION_RECORDING_DEFAULT_ERROR_MESSAGE as o, CoralogixRum as p, CoralogixLogSeverity as q, SessionRecordingEventType as r, CoralogixEventType as s, UrlType as t };
|
package/package.json
CHANGED
package/sessionRecorder.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __values, __spreadArray, __read, __assign, __awaiter, __generator, __rest } from 'tslib';
|
|
2
|
-
import { c as cxSetTimeout, a as cxClearTimeout, g as getZoneJsOriginalDom, b as createCxMutationObserver, d as cxRequestAnimationFrame, e as cxCancelAnimationFrame, C as CxGlobal, f as
|
|
2
|
+
import { c as cxSetTimeout, a as cxClearTimeout, g as getZoneJsOriginalDom, b as createCxMutationObserver, d as cxRequestAnimationFrame, e as cxCancelAnimationFrame, C as CxGlobal, f as getSdkConfig, h as cxClearInterval, S as SESSION_RECORDER_SEGMENTS_MAP, i as getNowTime, j as SESSION_RECORDING_NETWORK_ERR0R_MESSAGE, k as cxSetInterval, R as Request, l as SESSION_RECORDING_DEFAULT_HEADERS, m as SESSION_RECORDING_POSTFIX_URL, B as BATCH_TIME_DELAY, n as SESSION_RECORDER_KEY, o as SESSION_RECORDING_DEFAULT_ERROR_MESSAGE, M as MAX_BATCH_TIME_MS } from './index.esm2.js';
|
|
3
3
|
import '@opentelemetry/sdk-trace-base';
|
|
4
4
|
import '@opentelemetry/sdk-trace-web';
|
|
5
5
|
import '@opentelemetry/instrumentation';
|
|
@@ -5818,6 +5818,10 @@ var SessionRecorder = (function () {
|
|
|
5818
5818
|
SessionRecorder.prototype.getIsAutoStartRecording = function () {
|
|
5819
5819
|
return this.isAutoStartRecording;
|
|
5820
5820
|
};
|
|
5821
|
+
SessionRecorder.prototype.isConsoleRecordingActive = function () {
|
|
5822
|
+
var _a;
|
|
5823
|
+
return !!this.recordRef && ((_a = getSdkConfig().sessionRecordingConfig) === null || _a === void 0 ? void 0 : _a.recordConsoleEvents) === true;
|
|
5824
|
+
};
|
|
5821
5825
|
Object.defineProperty(SessionRecorder.prototype, "recordingStopDueToTimeout", {
|
|
5822
5826
|
get: function () {
|
|
5823
5827
|
return this._recordingStopDueToTimeout;
|
package/src/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { CoralogixLogSeverity } from './types-external';
|
|
|
3
3
|
export { UrlBasedLabelProvider } from './label-providers/url-based-label-provider';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export { SessionRecordingEventType, type RecordEvent, type RecordPluginEvent, } from './session/session.model';
|
|
6
|
+
export type { ExcludableInstrumentation } from './session/session.consts';
|
|
@@ -2,6 +2,7 @@ import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instr
|
|
|
2
2
|
import { CoralogixRumLabels, CxStackFrame } from '../types';
|
|
3
3
|
export declare const STACK_FRAME_LIMIT = 50;
|
|
4
4
|
export declare const STACK_LINE_LIMIT = 1024;
|
|
5
|
+
export declare function sanitizeConsoleErrorStack(stack: string | undefined): string | undefined;
|
|
5
6
|
export declare function extractMfePath(fileName: string): string | undefined;
|
|
6
7
|
export declare const ERROR_INSTRUMENTATION_NAME = "errors";
|
|
7
8
|
export declare const ErrorAttributes: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { Attributes } from '@opentelemetry/api';
|
|
1
2
|
import { Sampler, SamplingResult } from '@opentelemetry/sdk-trace-base';
|
|
2
3
|
export declare class CxCustomSampler implements Sampler {
|
|
3
|
-
shouldSample(): SamplingResult;
|
|
4
|
+
shouldSample(_context: unknown, _traceId: string, _spanName: string, _spanKind: unknown, attributes: Attributes): SamplingResult;
|
|
4
5
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SessionConfig } from './session.model';
|
|
2
|
+
import { CoralogixOtelWebOptionsInstrumentations } from '../types';
|
|
2
3
|
export declare const MAX_BATCH_TIME_MS: number;
|
|
3
4
|
export declare const SESSION_RECORDING_DEFAULT_HEADERS: Record<string, string>;
|
|
4
5
|
export declare const SESSION_RECORDING_DEFAULT_ERROR_MESSAGE: string;
|
|
@@ -9,6 +10,7 @@ export declare const SESSION_KEY: string;
|
|
|
9
10
|
export declare const PREV_SESSION_KEY: string;
|
|
10
11
|
export declare const MUTATION_LIMIT: number;
|
|
11
12
|
export declare const DEFAULT_SESSION_CONFIG: SessionConfig;
|
|
13
|
+
export type ExcludableInstrumentation = keyof CoralogixOtelWebOptionsInstrumentations;
|
|
12
14
|
export declare const SESSION_IDLE_TIME: number;
|
|
13
15
|
export declare const SESSION_EXPIRATION_TIME: number;
|
|
14
16
|
export declare const SESSION_MANAGER_KEY = "rumSessionManager";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SessionConfig, SessionRecordingConfig } from './session.model';
|
|
2
|
-
import { CoralogixBrowserSdkConfig } from '../types';
|
|
3
2
|
import { AlwaysOnSampler, Sampler } from '@opentelemetry/sdk-trace-base';
|
|
4
3
|
export declare function resolveSessionConfig(config: SessionConfig | undefined): SessionConfig;
|
|
5
4
|
export declare function resolveSessionRecordingConfig(config: SessionRecordingConfig | undefined): SessionRecordingConfig | undefined;
|
|
6
5
|
export declare function isSamplingOn(threshold: number): boolean;
|
|
7
6
|
export declare const isSessionWithError: () => boolean;
|
|
8
|
-
export declare function getResolvedSampler(
|
|
7
|
+
export declare function getResolvedSampler(): AlwaysOnSampler | Sampler;
|
|
@@ -2,6 +2,7 @@ import { eventWithTime } from '../cx-rrweb/rrweb-types';
|
|
|
2
2
|
import { SlimDOMOptions } from '../cx-rrweb/rrweb-snapshot';
|
|
3
3
|
import { CoralogixEventType } from '../types';
|
|
4
4
|
import { recordOptions } from '../cx-rrweb/rrweb';
|
|
5
|
+
import type { ExcludableInstrumentation } from './session.consts';
|
|
5
6
|
export interface SessionRecordingConfig extends Omit<recordOptions<eventWithTime>, 'emit' | 'packFn' | 'plugins' | 'hooks' | 'slimDOMOptions'> {
|
|
6
7
|
enable: boolean;
|
|
7
8
|
autoStartSessionRecording: boolean;
|
|
@@ -23,6 +24,7 @@ export interface SessionConfig {
|
|
|
23
24
|
alwaysTrackSessionsWithErrors?: boolean;
|
|
24
25
|
onlyWithErrorConfig?: SessionWithErrorConfig;
|
|
25
26
|
keepSessionAfterReload?: boolean;
|
|
27
|
+
excludeFromSampling?: ExcludableInstrumentation[];
|
|
26
28
|
}
|
|
27
29
|
export type RecordEvent = eventWithTime;
|
|
28
30
|
export type RecordPluginEvent<T = any> = {
|
|
@@ -28,6 +28,7 @@ export declare class SessionRecorder {
|
|
|
28
28
|
getSessionHasRecording(): boolean;
|
|
29
29
|
updateSegmentIndexCounter(segmentIndexCounter: Record<string, number>): void;
|
|
30
30
|
getIsAutoStartRecording(): boolean;
|
|
31
|
+
isConsoleRecordingActive(): boolean;
|
|
31
32
|
set recordingStopDueToTimeout(value: boolean);
|
|
32
33
|
get recordingStopDueToTimeout(): boolean;
|
|
33
34
|
startRecording(): Promise<void>;
|
package/src/tools/cx-timers.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export declare function cxClearInterval(id: ReturnType<typeof setInterval>): voi
|
|
|
23
23
|
export declare function cxRequestAnimationFrame(callback: FrameRequestCallback): number;
|
|
24
24
|
export declare function cxCancelAnimationFrame(id: number): void;
|
|
25
25
|
export declare function createCxMutationObserver(callback: MutationCallback): MutationObserver;
|
|
26
|
+
export declare function cxRunOutsideZone<T>(fn: () => T): T;
|
package/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.8.2";
|