@coralogix/browser 1.0.8 → 1.0.16
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/package.json +3 -3
- package/src/CoralogixExporter.d.ts +1 -0
- package/src/CoralogixExporter.js +21 -4
- package/src/CoralogixExporter.js.map +1 -1
- package/src/CoralogixSpanAttributesProcessor.js +2 -0
- package/src/CoralogixSpanAttributesProcessor.js.map +1 -1
- package/src/constants.d.ts +16 -4
- package/src/constants.js +17 -4
- package/src/constants.js.map +1 -1
- package/src/index.js +12 -7
- package/src/index.js.map +1 -1
- package/src/{CoralogixCustomLogInstrumentation.d.ts → instrumentations/CoralogixCustomLogInstrumentation.d.ts} +1 -1
- package/src/{CoralogixCustomLogInstrumentation.js → instrumentations/CoralogixCustomLogInstrumentation.js} +2 -2
- package/src/instrumentations/CoralogixCustomLogInstrumentation.js.map +1 -0
- package/src/{CoralogixErrorInstrumentation.js → instrumentations/CoralogixErrorInstrumentation.js} +6 -6
- package/src/instrumentations/CoralogixErrorInstrumentation.js.map +1 -0
- package/src/{CoralogixFetchInstrumentation.js → instrumentations/CoralogixFetchInstrumentation.js} +5 -5
- package/src/instrumentations/CoralogixFetchInstrumentation.js.map +1 -0
- package/src/instrumentations/CoralogixUserInteractionInstrumentation.d.ts +17 -0
- package/src/instrumentations/CoralogixUserInteractionInstrumentation.js +62 -0
- package/src/instrumentations/CoralogixUserInteractionInstrumentation.js.map +1 -0
- package/src/{CoralogixXhrInstrumentation.js → instrumentations/CoralogixXhrInstrumentation.js} +5 -5
- package/src/instrumentations/CoralogixXhrInstrumentation.js.map +1 -0
- package/src/tools/addEventListener.d.ts +54 -0
- package/src/tools/addEventListener.js +30 -0
- package/src/tools/addEventListener.js.map +1 -0
- package/src/tools/getGlobalObject.d.ts +5 -0
- package/src/tools/getGlobalObject.js +36 -0
- package/src/tools/getGlobalObject.js.map +1 -0
- package/src/tools/getZoneJsOriginalDom.d.ts +9 -0
- package/src/tools/getZoneJsOriginalDom.js +17 -0
- package/src/tools/getZoneJsOriginalDom.js.map +1 -0
- package/src/types.d.ts +18 -9
- package/src/types.js +1 -0
- package/src/types.js.map +1 -1
- package/src/utils..d.ts +3 -2
- package/src/utils..js +18 -4
- package/src/utils..js.map +1 -1
- package/src/version.d.ts +1 -1
- package/src/version.js +1 -1
- package/src/version.js.map +1 -1
- package/src/CoralogixCustomLogInstrumentation.js.map +0 -1
- package/src/CoralogixErrorInstrumentation.js.map +0 -1
- package/src/CoralogixFetchInstrumentation.js.map +0 -1
- package/src/CoralogixXhrInstrumentation.js.map +0 -1
- package/tests/integration/utils.d.ts +0 -7
- package/tests/integration/utils.js +0 -39
- package/tests/integration/utils.js.map +0 -1
- package/tests/unit/CoralogixRum.test.d.ts +0 -1
- package/tests/unit/CoralogixRum.test.js +0 -75
- package/tests/unit/CoralogixRum.test.js.map +0 -1
- package/tests/unit/CoralogixSpanAttributesProcessor.test.d.ts +0 -1
- package/tests/unit/CoralogixSpanAttributesProcessor.test.js +0 -15
- package/tests/unit/CoralogixSpanAttributesProcessor.test.js.map +0 -1
- package/tests/unit/sdk-version.test.d.ts +0 -1
- package/tests/unit/sdk-version.test.js +0 -9
- package/tests/unit/sdk-version.test.js.map +0 -1
- package/tests/unit/session-manager.test.d.ts +0 -1
- package/tests/unit/session-manager.test.js +0 -42
- package/tests/unit/session-manager.test.js.map +0 -1
- package/tests/unit/test-utils.d.ts +0 -2
- package/tests/unit/test-utils.js +0 -14
- package/tests/unit/test-utils.js.map +0 -1
- /package/src/{CoralogixErrorInstrumentation.d.ts → instrumentations/CoralogixErrorInstrumentation.d.ts} +0 -0
- /package/src/{CoralogixFetchInstrumentation.d.ts → instrumentations/CoralogixFetchInstrumentation.d.ts} +0 -0
- /package/src/{CoralogixXhrInstrumentation.d.ts → instrumentations/CoralogixXhrInstrumentation.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coralogix/browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "Official Coralogix SDK for browsers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"@opentelemetry/sdk-trace-base": "1.15.2",
|
|
13
13
|
"@opentelemetry/sdk-trace-web": "1.15.2",
|
|
14
14
|
"@types/idle-js": "1.2.1",
|
|
15
|
-
"@types/lodash-es": "4.17.8",
|
|
16
15
|
"error-stack-parser": "2.1.4",
|
|
17
16
|
"idle-js": "1.2.0",
|
|
18
17
|
"lodash-es": "4.17.21",
|
|
19
|
-
"
|
|
18
|
+
"@types/lodash-es": "4.17.8",
|
|
20
19
|
"tslib": "2.6.1",
|
|
20
|
+
"ts-node": "10.9.1",
|
|
21
21
|
"typescript": "4.9.5",
|
|
22
22
|
"uuid": "9.0.0"
|
|
23
23
|
},
|
|
@@ -2,6 +2,7 @@ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
|
2
2
|
import { CoralogixBrowserSdkConfig } from './types';
|
|
3
3
|
type CoralogixExporterConfig = Pick<CoralogixBrowserSdkConfig, 'public_key' | 'application' | 'coralogixDomain'>;
|
|
4
4
|
export declare class CoralogixExporter implements SpanExporter {
|
|
5
|
+
private isActive;
|
|
5
6
|
private public_key;
|
|
6
7
|
private application;
|
|
7
8
|
private coralogixDomain;
|
package/src/CoralogixExporter.js
CHANGED
|
@@ -2,10 +2,11 @@ import { CoralogixEventType, OtelNetworkAttrs, } from './types';
|
|
|
2
2
|
import { CORALOGIX_LOGS_URL_SUFFIX, CoralogixAttributes, CoralogixDomainsApiUrlMap, miillisecondsInSecond, SESSION_MANAGER_KEY, } from './constants';
|
|
3
3
|
import { CoralogixLogSeverity } from './types-external';
|
|
4
4
|
import ErrorStackParser from 'error-stack-parser';
|
|
5
|
-
import { parseUserAgent } from './utils.';
|
|
5
|
+
import { getUrlFragments, parseUserAgent } from './utils.';
|
|
6
6
|
import { SDK_VERSION } from './version';
|
|
7
7
|
export class CoralogixExporter {
|
|
8
8
|
constructor({ public_key, application, coralogixDomain, }) {
|
|
9
|
+
this.isActive = true;
|
|
9
10
|
this.public_key = '';
|
|
10
11
|
this.application = '';
|
|
11
12
|
this.coralogixDomain = 'EU2';
|
|
@@ -14,6 +15,8 @@ export class CoralogixExporter {
|
|
|
14
15
|
this.coralogixDomain = coralogixDomain;
|
|
15
16
|
}
|
|
16
17
|
export(spans) {
|
|
18
|
+
if (!this.isActive)
|
|
19
|
+
return;
|
|
17
20
|
const sessionManger = window[SESSION_MANAGER_KEY];
|
|
18
21
|
const session = sessionManger.getSession();
|
|
19
22
|
const cxSpans = spans.map((s) => this._mapToCxSpan(s, session));
|
|
@@ -30,6 +33,7 @@ export class CoralogixExporter {
|
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
shutdown() {
|
|
36
|
+
this.isActive = false;
|
|
33
37
|
return Promise.resolve();
|
|
34
38
|
}
|
|
35
39
|
_mapToCxSpan(span, session) {
|
|
@@ -47,13 +51,14 @@ export class CoralogixExporter {
|
|
|
47
51
|
app_name: attributes[CoralogixAttributes.APP_NAME],
|
|
48
52
|
app_version: attributes[CoralogixAttributes.APP_VERSION],
|
|
49
53
|
};
|
|
54
|
+
const severity = (attributes === null || attributes === void 0 ? void 0 : attributes[CoralogixAttributes.SEVERITY]) ||
|
|
55
|
+
CoralogixLogSeverity.Info;
|
|
50
56
|
return {
|
|
51
57
|
version_metadata,
|
|
52
58
|
applicationName: this.application,
|
|
53
59
|
subsystemName: 'cx_rum',
|
|
54
60
|
isErrorWithStacktrace,
|
|
55
|
-
severity
|
|
56
|
-
CoralogixLogSeverity.Info,
|
|
61
|
+
severity,
|
|
57
62
|
timestamp: startTime[0] * miillisecondsInSecond,
|
|
58
63
|
instrumentation_data: {
|
|
59
64
|
otelSpan: {
|
|
@@ -80,10 +85,11 @@ export class CoralogixExporter {
|
|
|
80
85
|
user_email,
|
|
81
86
|
user_metadata }), page_context: {
|
|
82
87
|
page_url: attributes[CoralogixAttributes.LOCATION_HREF],
|
|
88
|
+
page_fragments: attributes[CoralogixAttributes.LOCATION_FRAGMENTS],
|
|
83
89
|
}, event_context: {
|
|
84
90
|
type: attributes[CoralogixAttributes.EVENT_TYPE],
|
|
85
91
|
source: attributes[CoralogixAttributes.SOURCE],
|
|
86
|
-
severity
|
|
92
|
+
severity,
|
|
87
93
|
}, labels,
|
|
88
94
|
spanId,
|
|
89
95
|
traceId, environment: attributes[CoralogixAttributes.ENVIRONMENT] || '' }),
|
|
@@ -124,6 +130,7 @@ export class CoralogixExporter {
|
|
|
124
130
|
method: attributes[OtelNetworkAttrs.METHOD],
|
|
125
131
|
status_code: attributes[OtelNetworkAttrs.STATUS_CODE],
|
|
126
132
|
url: attributes[OtelNetworkAttrs.URL],
|
|
133
|
+
fragments: getUrlFragments(attributes[OtelNetworkAttrs.URL]),
|
|
127
134
|
host: attributes[OtelNetworkAttrs.HOST],
|
|
128
135
|
schema: attributes[OtelNetworkAttrs.SCHEME],
|
|
129
136
|
status_text: attributes[OtelNetworkAttrs.STATUS_TEXT],
|
|
@@ -147,6 +154,16 @@ export class CoralogixExporter {
|
|
|
147
154
|
},
|
|
148
155
|
};
|
|
149
156
|
}
|
|
157
|
+
case CoralogixEventType.USER_INTERACTION: {
|
|
158
|
+
return {
|
|
159
|
+
interaction_context: {
|
|
160
|
+
target_element: attributes[CoralogixAttributes.TARGET_ELEMENT],
|
|
161
|
+
event_name: attributes[CoralogixAttributes.INTERACTION_EVENT_NAME],
|
|
162
|
+
target_element_inner_text: attributes[CoralogixAttributes.ELEMENT_INNER_TEXT],
|
|
163
|
+
target_element_inner_html: attributes[CoralogixAttributes.ELEMENT_INNER_HTML],
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
150
167
|
}
|
|
151
168
|
return {};
|
|
152
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoralogixExporter.js","sourceRoot":"","sources":["../../../../libs/browser/src/CoralogixExporter.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAKlB,gBAAgB,GAGjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,gBAAgC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"CoralogixExporter.js","sourceRoot":"","sources":["../../../../libs/browser/src/CoralogixExporter.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAKlB,gBAAgB,GAGjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,gBAAgC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,OAAO,iBAAiB;IAM5B,YAAY,EACV,UAAU,EACV,WAAW,EACX,eAAe,GACS;QATlB,aAAQ,GAAG,IAAI,CAAC;QAChB,eAAU,GAAG,EAAE,CAAC;QAChB,gBAAW,GAAG,EAAE,CAAC;QACjB,oBAAe,GAAoB,KAAK,CAAC;QAO/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,KAAqB;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,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAW,CAChC,CAAC;oBAEhB,OAAO;wBACL,WAAW,EAAE;4BACX,OAAO,EAAE,KAAK,CAAC,OAAO;4BACtB,IAAI,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI;yBAClB;qBACF,CAAC;iBACH;gBAED,OAAO;oBACL,WAAW,EAAE;wBACX,OAAO,EAAE,EAAE;qBACZ;iBACF,CAAC;aACH;YACD,KAAK,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;gBACxC,OAAO;oBACL,mBAAmB,EAAE;wBACnB,cAAc,EAAE,UAAU,CACxB,mBAAmB,CAAC,cAAc,CACzB;wBACX,UAAU,EAAE,UAAU,CACpB,mBAAmB,CAAC,sBAAsB,CACjC;wBACX,yBAAyB,EAAE,UAAU,CACnC,mBAAmB,CAAC,kBAAkB,CAC7B;wBACX,yBAAyB,EAAE,UAAU,CACnC,mBAAmB,CAAC,kBAAkB,CAC7B;qBACZ;iBACF,CAAC;aACH;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CoralogixAttributes } from './constants';
|
|
2
|
+
import { getUrlFragments } from './utils.';
|
|
2
3
|
export class CoralogixSpanAttributesProcessor {
|
|
3
4
|
constructor(labels) {
|
|
4
5
|
this.labels = {
|
|
@@ -35,6 +36,7 @@ export class CoralogixSpanAttributesProcessor {
|
|
|
35
36
|
onStart(span) {
|
|
36
37
|
var _a, _b, _c, _d;
|
|
37
38
|
span.setAttribute(CoralogixAttributes.LOCATION_HREF, location.href);
|
|
39
|
+
span.setAttribute(CoralogixAttributes.LOCATION_FRAGMENTS, getUrlFragments(location.href));
|
|
38
40
|
span.setAttribute(CoralogixAttributes.USER_AGENT, navigator.userAgent);
|
|
39
41
|
span.setAttribute(CoralogixAttributes.COUNTRY, (_d = (_c = (_b = (_a = new Date().toString()) === null || _a === void 0 ? void 0 : _a.split('(')) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.split(' ')) === null || _d === void 0 ? void 0 : _d[0]);
|
|
40
42
|
span.setAttributes(this.labels);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoralogixSpanAttributesProcessor.js","sourceRoot":"","sources":["../../../../libs/browser/src/CoralogixSpanAttributesProcessor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"CoralogixSpanAttributesProcessor.js","sourceRoot":"","sources":["../../../../libs/browser/src/CoralogixSpanAttributesProcessor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,OAAO,gCAAgC;IAK3C,YAAY,MAAmB;QAJvB,WAAM,GAAuB;YACnC,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,IAAI;SAC1C,CAAC;QAGA,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;IACH,CAAC;IAED,eAAe,CAAC,MAA2B;QACzC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,SAAS,CAC7D,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CACb,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,MAA2B;QAC3C,IAAI,CAAC,MAAM,mBACT,CAAC,mBAAmB,CAAC,aAAa,CAAC,EACjC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAC7C,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAChD,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,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,CAAC;IAED,KAAK,KAAU,CAAC;IAEhB,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEO,eAAe,CAAC,MAA0B;QAChD,MAAM,cAAc,GAA2B,EAAE,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,cAAc,CAAC,GAAG,CAAC;gBACjB,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ;oBAC7B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;oBACb,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SACnC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
|
package/src/constants.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CoralogixBrowserSdkConfig } from './types';
|
|
2
|
-
import { CoralogixErrorInstrumentation } from './CoralogixErrorInstrumentation';
|
|
3
|
-
import { CoralogixFetchInstrumentation } from './CoralogixFetchInstrumentation';
|
|
4
|
-
import { CoralogixXhrInstrumentation } from './CoralogixXhrInstrumentation';
|
|
5
|
-
import { CoralogixCustomLogInstrumentation } from './CoralogixCustomLogInstrumentation';
|
|
2
|
+
import { CoralogixErrorInstrumentation } from './instrumentations/CoralogixErrorInstrumentation';
|
|
3
|
+
import { CoralogixFetchInstrumentation } from './instrumentations/CoralogixFetchInstrumentation';
|
|
4
|
+
import { CoralogixXhrInstrumentation } from './instrumentations/CoralogixXhrInstrumentation';
|
|
5
|
+
import { CoralogixCustomLogInstrumentation } from './instrumentations/CoralogixCustomLogInstrumentation';
|
|
6
|
+
import { CoralogixUserInteractionInstrumentation } from './instrumentations/CoralogixUserInteractionInstrumentation';
|
|
6
7
|
export declare const miillisecondsInSecond = 1000;
|
|
7
8
|
export declare const CORALOGIX_LOGS_URL_SUFFIX = "/browser/v1beta/logs";
|
|
8
9
|
export declare const MAX_EXPORT_BATCH_SIZE = 50;
|
|
10
|
+
export declare const MAX_INTERACTION_ELEMENT_SIZE = 1024;
|
|
9
11
|
export declare const SCHEDULE_DELAY_MILLIS: number;
|
|
10
12
|
export declare const REQUIRED_CONFIG_KEYS: Array<keyof CoralogixBrowserSdkConfig>;
|
|
11
13
|
export declare const OPTIONS_DEFAULTS: Partial<CoralogixBrowserSdkConfig>;
|
|
@@ -25,10 +27,15 @@ export declare const INSTRUMENTATIONS: readonly [{
|
|
|
25
27
|
readonly Instrument: typeof CoralogixCustomLogInstrumentation;
|
|
26
28
|
readonly confKey: "custom";
|
|
27
29
|
readonly disable: false;
|
|
30
|
+
}, {
|
|
31
|
+
readonly Instrument: typeof CoralogixUserInteractionInstrumentation;
|
|
32
|
+
readonly confKey: "interactions";
|
|
33
|
+
readonly disable: false;
|
|
28
34
|
}];
|
|
29
35
|
export declare const CoralogixAttributes: {
|
|
30
36
|
USER_AGENT: string;
|
|
31
37
|
LOCATION_HREF: string;
|
|
38
|
+
LOCATION_FRAGMENTS: string;
|
|
32
39
|
EVENT_TYPE: string;
|
|
33
40
|
SEVERITY: string;
|
|
34
41
|
USER_CONTEXT: string;
|
|
@@ -44,6 +51,11 @@ export declare const CoralogixAttributes: {
|
|
|
44
51
|
LOG: string;
|
|
45
52
|
CUSTOM_LABELS: string;
|
|
46
53
|
ENVIRONMENT: string;
|
|
54
|
+
INTERACTION_EVENT_NAME: string;
|
|
55
|
+
ELEMENT_INNER_TEXT: string;
|
|
56
|
+
ELEMENT_INNER_HTML: string;
|
|
57
|
+
TARGET_XPATH: string;
|
|
58
|
+
TARGET_ELEMENT: string;
|
|
47
59
|
};
|
|
48
60
|
export declare const CoralogixDomainsApiUrlMap: {
|
|
49
61
|
EU1: string;
|
package/src/constants.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { CoralogixErrorInstrumentation, ERROR_INSTRUMENTATION_NAME, ErrorAttributes, } from './CoralogixErrorInstrumentation';
|
|
2
|
-
import { CoralogixFetchInstrumentation } from './CoralogixFetchInstrumentation';
|
|
3
|
-
import { CoralogixXhrInstrumentation } from './CoralogixXhrInstrumentation';
|
|
4
|
-
import { CoralogixCustomLogInstrumentation } from './CoralogixCustomLogInstrumentation';
|
|
1
|
+
import { CoralogixErrorInstrumentation, ERROR_INSTRUMENTATION_NAME, ErrorAttributes, } from './instrumentations/CoralogixErrorInstrumentation';
|
|
2
|
+
import { CoralogixFetchInstrumentation } from './instrumentations/CoralogixFetchInstrumentation';
|
|
3
|
+
import { CoralogixXhrInstrumentation } from './instrumentations/CoralogixXhrInstrumentation';
|
|
4
|
+
import { CoralogixCustomLogInstrumentation } from './instrumentations/CoralogixCustomLogInstrumentation';
|
|
5
|
+
import { CoralogixUserInteractionInstrumentation } from './instrumentations/CoralogixUserInteractionInstrumentation';
|
|
5
6
|
export const miillisecondsInSecond = 1000;
|
|
6
7
|
export const CORALOGIX_LOGS_URL_SUFFIX = '/browser/v1beta/logs';
|
|
7
8
|
export const MAX_EXPORT_BATCH_SIZE = 50;
|
|
9
|
+
export const MAX_INTERACTION_ELEMENT_SIZE = 1024;
|
|
8
10
|
export const SCHEDULE_DELAY_MILLIS = 2 * miillisecondsInSecond;
|
|
9
11
|
export const REQUIRED_CONFIG_KEYS = [
|
|
10
12
|
'application',
|
|
@@ -41,10 +43,16 @@ export const INSTRUMENTATIONS = [
|
|
|
41
43
|
confKey: 'custom',
|
|
42
44
|
disable: false,
|
|
43
45
|
},
|
|
46
|
+
{
|
|
47
|
+
Instrument: CoralogixUserInteractionInstrumentation,
|
|
48
|
+
confKey: 'interactions',
|
|
49
|
+
disable: false,
|
|
50
|
+
},
|
|
44
51
|
];
|
|
45
52
|
export const CoralogixAttributes = {
|
|
46
53
|
USER_AGENT: 'user_agent',
|
|
47
54
|
LOCATION_HREF: 'location_href',
|
|
55
|
+
LOCATION_FRAGMENTS: 'location_fragments',
|
|
48
56
|
EVENT_TYPE: 'event_type',
|
|
49
57
|
SEVERITY: 'severity',
|
|
50
58
|
USER_CONTEXT: 'user_context',
|
|
@@ -56,6 +64,11 @@ export const CoralogixAttributes = {
|
|
|
56
64
|
LOG: 'cx_log',
|
|
57
65
|
CUSTOM_LABELS: 'custom_labels',
|
|
58
66
|
ENVIRONMENT: 'environment',
|
|
67
|
+
INTERACTION_EVENT_NAME: 'interaction_event_name',
|
|
68
|
+
ELEMENT_INNER_TEXT: 'element_inner_text',
|
|
69
|
+
ELEMENT_INNER_HTML: 'element_inner_html',
|
|
70
|
+
TARGET_XPATH: 'target_xpath',
|
|
71
|
+
TARGET_ELEMENT: 'target_element',
|
|
59
72
|
};
|
|
60
73
|
export const CoralogixDomainsApiUrlMap = {
|
|
61
74
|
EU1: 'https://ingress.coralogix.com',
|
package/src/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../libs/browser/src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,eAAe,GAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../libs/browser/src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,eAAe,GAChB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AACzG,OAAO,EAAE,uCAAuC,EAAE,MAAM,4DAA4D,CAAC;AAErH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAE1C,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAA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B,sBAAsB,EAAE,wBAAwB;IAChD,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,mCAAmC;IACxC,GAAG,EAAE,8BAA8B;IACnC,GAAG,EAAE,8BAA8B;IACnC,GAAG,EAAE,iCAAiC,EAAE,6BAA6B;CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,GAAG,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CoralogixAttributes, INSTRUMENTATIONS, MAX_EXPORT_BATCH_SIZE, OPTIONS_D
|
|
|
5
5
|
import { registerInstrumentations } from '@opentelemetry/instrumentation';
|
|
6
6
|
import { CoralogixExporter } from './CoralogixExporter';
|
|
7
7
|
import { CoralogixLogSeverity } from './types-external';
|
|
8
|
-
import { CoralogixCustomLogInstrumentation } from './CoralogixCustomLogInstrumentation';
|
|
8
|
+
import { CoralogixCustomLogInstrumentation } from './instrumentations/CoralogixCustomLogInstrumentation';
|
|
9
9
|
import { CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator, } from '@opentelemetry/core';
|
|
10
10
|
import { CoralogixWebTracerProvider } from './CoralogixWebTracerProvider';
|
|
11
11
|
import { isNil } from 'lodash-es';
|
|
@@ -15,6 +15,7 @@ let _deregisterInstrumentations;
|
|
|
15
15
|
let _customInstrumentation;
|
|
16
16
|
let tracerProvider;
|
|
17
17
|
let attributesProcessor;
|
|
18
|
+
let exporter;
|
|
18
19
|
export const CoralogixRum = {
|
|
19
20
|
get isInited() {
|
|
20
21
|
return isInited;
|
|
@@ -50,11 +51,11 @@ export const CoralogixRum = {
|
|
|
50
51
|
}
|
|
51
52
|
const { ignoreUrls, labels, user_context, application, version, traceParentInHeader, environment, } = resolvedOptions;
|
|
52
53
|
tracerProvider = new CoralogixWebTracerProvider();
|
|
53
|
-
const pluginDefaults = {
|
|
54
|
+
const pluginDefaults = {};
|
|
54
55
|
// Resolve instrumentations.
|
|
55
56
|
const instrumentations = INSTRUMENTATIONS.map(({ Instrument, confKey, disable }) => {
|
|
56
57
|
var _a;
|
|
57
|
-
const pluginConf = getInstrumentationConfig((_a = resolvedOptions === null || resolvedOptions === void 0 ? void 0 : resolvedOptions.instrumentations) === null || _a === void 0 ? void 0 : _a[confKey], pluginDefaults, disable
|
|
58
|
+
const pluginConf = getInstrumentationConfig((_a = resolvedOptions === null || resolvedOptions === void 0 ? void 0 : resolvedOptions.instrumentations) === null || _a === void 0 ? void 0 : _a[confKey], pluginDefaults, disable);
|
|
58
59
|
if (pluginConf) {
|
|
59
60
|
let instrumentation;
|
|
60
61
|
switch (confKey) {
|
|
@@ -62,6 +63,11 @@ export const CoralogixRum = {
|
|
|
62
63
|
instrumentation = new Instrument(Object.assign(Object.assign({}, pluginConf), { ignoreErrors: options === null || options === void 0 ? void 0 : options.ignoreErrors }));
|
|
63
64
|
break;
|
|
64
65
|
}
|
|
66
|
+
case 'fetch':
|
|
67
|
+
case 'xhr': {
|
|
68
|
+
instrumentation = new Instrument(Object.assign(Object.assign({}, pluginConf), { ignoreUrls }));
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
65
71
|
default:
|
|
66
72
|
instrumentation = new Instrument(pluginConf);
|
|
67
73
|
}
|
|
@@ -84,11 +90,11 @@ export const CoralogixRum = {
|
|
|
84
90
|
// Add Span Attributes Processor.
|
|
85
91
|
tracerProvider.addSpanProcessor(attributesProcessor);
|
|
86
92
|
// Add Batch Span Processor and Exporter
|
|
87
|
-
tracerProvider.addSpanProcessor(new BatchSpanProcessor(new CoralogixExporter({
|
|
93
|
+
tracerProvider.addSpanProcessor(new BatchSpanProcessor((exporter = new CoralogixExporter({
|
|
88
94
|
public_key: options === null || options === void 0 ? void 0 : options.public_key,
|
|
89
95
|
application,
|
|
90
96
|
coralogixDomain: options === null || options === void 0 ? void 0 : options.coralogixDomain,
|
|
91
|
-
}), {
|
|
97
|
+
})), {
|
|
92
98
|
maxExportBatchSize: MAX_EXPORT_BATCH_SIZE,
|
|
93
99
|
scheduledDelayMillis: SCHEDULE_DELAY_MILLIS,
|
|
94
100
|
}));
|
|
@@ -119,10 +125,9 @@ export const CoralogixRum = {
|
|
|
119
125
|
}
|
|
120
126
|
_deregisterInstrumentations === null || _deregisterInstrumentations === void 0 ? void 0 : _deregisterInstrumentations();
|
|
121
127
|
_deregisterInstrumentations = undefined;
|
|
122
|
-
tracerProvider === null || tracerProvider === void 0 ? void 0 : tracerProvider.shutdown();
|
|
123
|
-
tracerProvider = undefined;
|
|
124
128
|
(_a = window[SESSION_MANAGER_KEY]) === null || _a === void 0 ? void 0 : _a.stop();
|
|
125
129
|
window[SESSION_MANAGER_KEY] = undefined;
|
|
130
|
+
exporter === null || exporter === void 0 ? void 0 : exporter.shutdown();
|
|
126
131
|
isInited = false;
|
|
127
132
|
},
|
|
128
133
|
setUserContext(userContext) {
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/browser/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/browser/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,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AAO,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,IAAI;QAChB,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,IAAI;QAChB,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,OAAO,EAAE,IAAI;QACjB,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ,CAAC,OAAO,EAAE,IAAI;QACpB,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;CACF,CAAC;AAED,MAAc,CAAC,YAAY,GAAG,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
2
|
-
import { CoralogixLogSeverity } from '
|
|
2
|
+
import { CoralogixLogSeverity } from '../types-external';
|
|
3
3
|
export declare const CUSTOM_INSTRUMENTATION_VERSION = "1";
|
|
4
4
|
export declare enum LogSource {
|
|
5
5
|
CODE = "code"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InstrumentationBase, } from '@opentelemetry/instrumentation';
|
|
2
2
|
import { hrTime } from '@opentelemetry/core';
|
|
3
|
-
import { CoralogixAttributes } from '
|
|
4
|
-
import { CoralogixEventType } from '
|
|
3
|
+
import { CoralogixAttributes } from '../constants';
|
|
4
|
+
import { CoralogixEventType } from '../types';
|
|
5
5
|
export const CUSTOM_INSTRUMENTATION_VERSION = '1';
|
|
6
6
|
export var LogSource;
|
|
7
7
|
(function (LogSource) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoralogixCustomLogInstrumentation.js","sourceRoot":"","sources":["../../../../../libs/browser/src/instrumentations/CoralogixCustomLogInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAElD,MAAM,CAAN,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,0BAAa,CAAA;AACf,CAAC,EAFW,SAAS,KAAT,SAAS,QAEpB;AAED,MAAM,OAAO,iCAAkC,SAAQ,mBAAmB;IACxE,YAAY,MAA6B;QACvC,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,8BAA8B,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,KAAU,CAAC;IAEN,OAAO,KAAI,CAAC;IAEZ,MAAM,KAAI,CAAC;IAEpB,GAAG,CAAC,QAA8B,EAAE,OAAe,EAAE,IAAU;QAC7D,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;QAErB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE;YACzD,SAAS,EAAE,GAAG;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC1E,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAE1D,IAAI,CAAC,YAAY,CACf,mBAAmB,CAAC,GAAG,EACvB,IAAI,CAAC,SAAS,CAAC;YACb,QAAQ;YACR,OAAO;YACP,IAAI;SACL,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;CACF"}
|
package/src/{CoralogixErrorInstrumentation.js → instrumentations/CoralogixErrorInstrumentation.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getElementXPath } from '@opentelemetry/sdk-trace-web';
|
|
2
2
|
import { hrTime } from '@opentelemetry/core';
|
|
3
3
|
import { InstrumentationBase, } from '@opentelemetry/instrumentation';
|
|
4
|
-
import {
|
|
5
|
-
import { CoralogixAttributes } from '
|
|
6
|
-
import { CoralogixEventType } from '
|
|
7
|
-
import { CoralogixLogSeverity } from '
|
|
4
|
+
import { unwrap, wrap } from 'shimmer';
|
|
5
|
+
import { CoralogixAttributes } from '../constants';
|
|
6
|
+
import { CoralogixEventType } from '../types';
|
|
7
|
+
import { CoralogixLogSeverity } from '../types-external';
|
|
8
8
|
export const ERROR_INSTRUMENTATION_NAME = 'errors';
|
|
9
9
|
export const ERROR_INSTRUMENTATION_VERSION = '1';
|
|
10
10
|
export const ErrorAttributes = {
|
|
@@ -57,7 +57,6 @@ export class CoralogixErrorInstrumentation extends InstrumentationBase {
|
|
|
57
57
|
super(ERROR_INSTRUMENTATION_NAME, ERROR_INSTRUMENTATION_VERSION, config);
|
|
58
58
|
this.ignoreErrors = config.ignoreErrors;
|
|
59
59
|
}
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
61
60
|
init() { }
|
|
62
61
|
enable() {
|
|
63
62
|
wrap(console, 'error', _consoleErrorHandler(this));
|
|
@@ -112,10 +111,11 @@ export class CoralogixErrorInstrumentation extends InstrumentationBase {
|
|
|
112
111
|
const now = hrTime();
|
|
113
112
|
const { message, name } = err;
|
|
114
113
|
const span = this.tracer.startSpan('error', { startTime: now });
|
|
114
|
+
const cleanMessage = message.split('\n')[0];
|
|
115
115
|
addErrorDefaultAttributes(span);
|
|
116
116
|
span.setAttribute(CoralogixAttributes.SOURCE, source);
|
|
117
117
|
span.setAttribute(ErrorAttributes.TYPE, name);
|
|
118
|
-
span.setAttribute(ErrorAttributes.MESSAGE,
|
|
118
|
+
span.setAttribute(ErrorAttributes.MESSAGE, cleanMessage);
|
|
119
119
|
addStackIfUseful(span, err);
|
|
120
120
|
span.end(now);
|
|
121
121
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoralogixErrorInstrumentation.js","sourceRoot":"","sources":["../../../../../libs/browser/src/instrumentations/CoralogixErrorInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;CACzB,CAAC;AAEF,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,yDAA0C,CAAA;IAC1C,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAOD,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,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,EAAE,GAAG,GAAY,CAAC;gBACvC,WAAW,GAAG,IAAI,GAAG,GAAG,GAAG,OAAO,CAAC;gBACnC,MAAM;aACP;YACD,KAAK,GAAG,YAAY,UAAU,CAAC,CAAC;gBAC9B,MAAM,EAAE,OAAO,EAAE,GAAG,GAAiB,CAAC;gBACtC,WAAW,GAAG,OAAO,CAAC;gBACtB,MAAM;aACP;YACD,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC;gBACzB,MAAM,EAAE,IAAI,EAAE,GAAG,GAAY,CAAC;gBAC9B,WAAW,GAAG,IAAI,CAAC;gBACnB,MAAM;aACP;YACD,KAAK,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;gBAC5B,WAAW,GAAG,GAAa,CAAC;gBAC5B,MAAM;aACP;YACD,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC;gBACzB,WAAW,GAAI,GAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC5C,MAAM;aACP;YACD;gBACE,WAAW,GAAG,GAAa,CAAC;SAC/B;QAED,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE;YAC3C,IAAI,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;gBAClC,OAAO,IAAI,CAAC;aACb;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
package/src/{CoralogixFetchInstrumentation.js → instrumentations/CoralogixFetchInstrumentation.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FetchInstrumentation, } from '@opentelemetry/instrumentation-fetch';
|
|
2
|
-
import { CoralogixAttributes } from '
|
|
3
|
-
import { CoralogixEventType } from '
|
|
4
|
-
import { CoralogixLogSeverity } from '
|
|
5
|
-
import { propagateTraceHeaderCorsUrls } from '
|
|
6
|
-
import { isNetworkError } from '
|
|
2
|
+
import { CoralogixAttributes } from '../constants';
|
|
3
|
+
import { CoralogixEventType } from '../types';
|
|
4
|
+
import { CoralogixLogSeverity } from '../types-external';
|
|
5
|
+
import { propagateTraceHeaderCorsUrls } from '../CoralogixPropgator';
|
|
6
|
+
import { isNetworkError } from '../utils.';
|
|
7
7
|
export var FetchSource;
|
|
8
8
|
(function (FetchSource) {
|
|
9
9
|
FetchSource["FETCH"] = "fetch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoralogixFetchInstrumentation.js","sourceRoot":"","sources":["../../../../../libs/browser/src/instrumentations/CoralogixFetchInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,GAErB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,8BAAe,CAAA;AACjB,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB;AAED,MAAM,OAAO,6BAA8B,SAAQ,oBAAoB;IACrE,YAAY,MAAkC;QAC5C,4BAA4B,CAAC,MAAM,CAAC,CAAC;QAErC,MAAM,CAAC,2BAA2B,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;YAE1B,IAAI,CAAC,YAAY,CACf,mBAAmB,CAAC,QAAQ,EAC5B,cAAc,CAAC,MAAM,CAAC;gBACpB,CAAC,CAAC,oBAAoB,CAAC,KAAK;gBAC5B,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAC9B,CAAC;YACF,IAAI,CAAC,YAAY,CACf,mBAAmB,CAAC,UAAU,EAC9B,kBAAkB,CAAC,eAAe,CACnC,CAAC;YACF,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC,CAAC;QAEF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEQ,MAAM;QACb,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { EventName } from '../types';
|
|
3
|
+
export declare const USER_INTERACTION_INSTRUMENTATION_NAME = "user-interaction";
|
|
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
|
+
export declare const DEFAULT_INSTRUMENTED_EVENTS: UserInteractionEventsConfig;
|
|
10
|
+
export declare class CoralogixUserInteractionInstrumentation extends InstrumentationBase {
|
|
11
|
+
private handler;
|
|
12
|
+
private stop;
|
|
13
|
+
constructor(config: CoralogixUserInteractionInstrumentationConfig);
|
|
14
|
+
enable(): void;
|
|
15
|
+
disable(): void;
|
|
16
|
+
protected init(): undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { InstrumentationBase, } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { hrTime } from '@opentelemetry/core';
|
|
3
|
+
import { CoralogixAttributes, MAX_INTERACTION_ELEMENT_SIZE, } from '../constants';
|
|
4
|
+
import { CoralogixEventType } from '../types';
|
|
5
|
+
import { addEventListeners } from '../tools/addEventListener';
|
|
6
|
+
export const USER_INTERACTION_INSTRUMENTATION_NAME = 'user-interaction';
|
|
7
|
+
export const USER_INTERACTION_INSTRUMENTATION_VERSION = '1';
|
|
8
|
+
export const DEFAULT_INSTRUMENTED_EVENTS = {
|
|
9
|
+
["click" /* DOM_EVENT.CLICK */]: true,
|
|
10
|
+
};
|
|
11
|
+
export class CoralogixUserInteractionInstrumentation extends InstrumentationBase {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super(USER_INTERACTION_INSTRUMENTATION_NAME, USER_INTERACTION_INSTRUMENTATION_VERSION, config);
|
|
14
|
+
this.handler = (_) => { };
|
|
15
|
+
this.stop = () => { };
|
|
16
|
+
}
|
|
17
|
+
enable() {
|
|
18
|
+
var _a;
|
|
19
|
+
this.handler = (e) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const now = hrTime();
|
|
22
|
+
const span = this.tracer.startSpan(USER_INTERACTION_INSTRUMENTATION_NAME, {
|
|
23
|
+
startTime: now,
|
|
24
|
+
});
|
|
25
|
+
span.setAttribute(CoralogixAttributes.EVENT_TYPE, CoralogixEventType.USER_INTERACTION);
|
|
26
|
+
span.setAttribute(CoralogixAttributes.INTERACTION_EVENT_NAME, e.type);
|
|
27
|
+
if (e.target && e.target instanceof HTMLElement) {
|
|
28
|
+
[
|
|
29
|
+
[
|
|
30
|
+
CoralogixAttributes.ELEMENT_INNER_HTML,
|
|
31
|
+
((_a = e.target.innerHTML) === null || _a === void 0 ? void 0 : _a.length) < MAX_INTERACTION_ELEMENT_SIZE
|
|
32
|
+
? e.target.innerHTML
|
|
33
|
+
: '',
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
CoralogixAttributes.ELEMENT_INNER_TEXT,
|
|
37
|
+
e.target.innerText.slice(0, MAX_INTERACTION_ELEMENT_SIZE),
|
|
38
|
+
],
|
|
39
|
+
[CoralogixAttributes.TARGET_ELEMENT, e.target.nodeName],
|
|
40
|
+
].forEach(([key, value]) => {
|
|
41
|
+
span.setAttribute(key, value);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
span.end(now);
|
|
45
|
+
};
|
|
46
|
+
const eventsMap = Object.assign(Object.assign({}, DEFAULT_INSTRUMENTED_EVENTS), (_a = this._config) === null || _a === void 0 ? void 0 : _a['events']);
|
|
47
|
+
const eventNames = Object.entries(eventsMap)
|
|
48
|
+
.filter(([_, enabled]) => enabled)
|
|
49
|
+
.map(([eventName]) => eventName);
|
|
50
|
+
this.stop = addEventListeners(document, eventNames, this.handler, {
|
|
51
|
+
capture: true,
|
|
52
|
+
passive: true,
|
|
53
|
+
}).stop;
|
|
54
|
+
}
|
|
55
|
+
disable() {
|
|
56
|
+
this.stop();
|
|
57
|
+
}
|
|
58
|
+
init() {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=CoralogixUserInteractionInstrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoralogixUserInteractionInstrumentation.js","sourceRoot":"","sources":["../../../../../libs/browser/src/instrumentations/CoralogixUserInteractionInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAa,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAa,MAAM,2BAA2B,CAAC;AAEzE,MAAM,CAAC,MAAM,qCAAqC,GAAG,kBAAkB,CAAC;AACxE,MAAM,CAAC,MAAM,wCAAwC,GAAG,GAAG,CAAC;AAS5D,MAAM,CAAC,MAAM,2BAA2B,GAAgC;IACtE,+BAAiB,EAAE,IAAI;CACxB,CAAC;AAEF,MAAM,OAAO,uCAAwC,SAAQ,mBAAmB;IAI9E,YAAY,MAAqD;QAC/D,KAAK,CACH,qCAAqC,EACrC,wCAAwC,EACxC,MAAM,CACP,CAAC;QARI,YAAO,GAAG,CAAC,CAAQ,EAAE,EAAE,GAAE,CAAC,CAAC;QAC3B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0CAAG,QAAQ,CAAC,CAC5B,CAAC;QAEF,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;aACzC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAgB,CAAC;QAElD,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE;YAChE,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAC,IAAI,CAAC;IACV,CAAC;IAEQ,OAAO;QACd,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAES,IAAI;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
package/src/{CoralogixXhrInstrumentation.js → instrumentations/CoralogixXhrInstrumentation.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { XMLHttpRequestInstrumentation, } from '@opentelemetry/instrumentation-xml-http-request';
|
|
2
|
-
import { CoralogixAttributes } from '
|
|
3
|
-
import { CoralogixEventType } from '
|
|
4
|
-
import { CoralogixLogSeverity } from '
|
|
5
|
-
import { isNetworkError } from '
|
|
6
|
-
import { propagateTraceHeaderCorsUrls } from '
|
|
2
|
+
import { CoralogixAttributes } from '../constants';
|
|
3
|
+
import { CoralogixEventType } from '../types';
|
|
4
|
+
import { CoralogixLogSeverity } from '../types-external';
|
|
5
|
+
import { isNetworkError } from '../utils.';
|
|
6
|
+
import { propagateTraceHeaderCorsUrls } from '../CoralogixPropgator';
|
|
7
7
|
export var XHRSource;
|
|
8
8
|
(function (XHRSource) {
|
|
9
9
|
XHRSource["XHR"] = "xhr";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoralogixXhrInstrumentation.js","sourceRoot":"","sources":["../../../../../libs/browser/src/instrumentations/CoralogixXhrInstrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,GAE9B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,CAAN,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,wBAAW,CAAA;AACb,CAAC,EAFW,SAAS,KAAT,SAAS,QAEpB;AAED,MAAM,OAAO,2BAA4B,SAAQ,6BAA6B;IAC5E,YAAY,MAA2C;QACrD,4BAA4B,CAAC,MAAM,CAAC,CAAC;QAErC,MAAM,CAAC,2BAA2B,GAAG,CAAC,IAAU,EAAE,GAAmB,EAAE,EAAE;YACvE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;YAEvB,IAAI,CAAC,YAAY,CACf,mBAAmB,CAAC,QAAQ,EAC5B,cAAc,CAAC,MAAM,CAAC;gBACpB,CAAC,CAAC,oBAAoB,CAAC,KAAK;gBAC5B,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAC9B,CAAC;YACF,IAAI,CAAC,YAAY,CACf,mBAAmB,CAAC,UAAU,EAC9B,kBAAkB,CAAC,eAAe,CACnC,CAAC;YACF,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/D,CAAC,CAAC;QAEF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF"}
|