@cloudcare/rum-uniapp 2.1.8 → 2.1.9
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/cjs/boot/buildEnv.js +1 -1
- package/cjs/core/dataMap.js +2 -0
- package/cjs/core/errorCollection.js +3 -1
- package/cjs/rumEventsCollection/error/errorCollection.js +19 -2
- package/cjs/rumEventsCollection/tracing/ddtraceTracer.js +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/core/dataMap.js +2 -0
- package/esm/core/errorCollection.js +3 -1
- package/esm/rumEventsCollection/error/errorCollection.js +20 -3
- package/esm/rumEventsCollection/tracing/ddtraceTracer.js +1 -1
- package/package.json +1 -1
package/cjs/boot/buildEnv.js
CHANGED
package/cjs/core/dataMap.js
CHANGED
|
@@ -134,7 +134,9 @@ function trackNetworkError(configuration, errorObservable) {
|
|
|
134
134
|
resource: {
|
|
135
135
|
method: request.method,
|
|
136
136
|
statusCode: request.status,
|
|
137
|
-
url: request.url
|
|
137
|
+
url: request.url,
|
|
138
|
+
traceId: request.traceId,
|
|
139
|
+
spanId: request.spanId
|
|
138
140
|
},
|
|
139
141
|
type: _errorTools.ErrorSource.NETWORK,
|
|
140
142
|
source: _errorTools.ErrorSource.NETWORK,
|
|
@@ -58,8 +58,10 @@ function doStartErrorCollection(lifeCycle) {
|
|
|
58
58
|
|
|
59
59
|
function processError(error) {
|
|
60
60
|
var resource = error.resource;
|
|
61
|
+
var tracingInfo;
|
|
61
62
|
|
|
62
63
|
if (resource) {
|
|
64
|
+
tracingInfo = computeRequestTracingInfo(resource);
|
|
63
65
|
var urlObj = (0, _utils.urlParse)(error.resource.url).getParse();
|
|
64
66
|
resource = {
|
|
65
67
|
method: error.resource.method,
|
|
@@ -72,7 +74,7 @@ function processError(error) {
|
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
var rawRumEvent = {
|
|
77
|
+
var rawRumEvent = (0, _utils.extend2Lev)({
|
|
76
78
|
date: error.startTime,
|
|
77
79
|
error: {
|
|
78
80
|
message: error.message,
|
|
@@ -83,9 +85,24 @@ function processError(error) {
|
|
|
83
85
|
starttime: error.startTime
|
|
84
86
|
},
|
|
85
87
|
type: _enums.RumEventType.ERROR
|
|
86
|
-
};
|
|
88
|
+
}, tracingInfo);
|
|
87
89
|
return {
|
|
88
90
|
rawRumEvent: rawRumEvent,
|
|
89
91
|
startTime: error.startTime
|
|
90
92
|
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function computeRequestTracingInfo(request) {
|
|
96
|
+
var hasBeenTraced = request.traceId && request.spanId;
|
|
97
|
+
|
|
98
|
+
if (!hasBeenTraced) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
_dd: {
|
|
104
|
+
spanId: request.spanId,
|
|
105
|
+
traceId: request.traceId
|
|
106
|
+
}
|
|
107
|
+
};
|
|
91
108
|
}
|
|
@@ -41,7 +41,7 @@ DDtraceTracer.prototype = {
|
|
|
41
41
|
makeTracingHeaders: function makeTracingHeaders() {
|
|
42
42
|
return {
|
|
43
43
|
'x-datadog-origin': 'rum',
|
|
44
|
-
|
|
44
|
+
'x-datadog-parent-id': this.getSpanId(),
|
|
45
45
|
'x-datadog-sampled': '1',
|
|
46
46
|
'x-datadog-sampling-priority': '1',
|
|
47
47
|
'x-datadog-trace-id': this.getTraceId()
|
package/esm/boot/buildEnv.js
CHANGED
package/esm/core/dataMap.js
CHANGED
|
@@ -105,7 +105,9 @@ export function trackNetworkError(configuration, errorObservable) {
|
|
|
105
105
|
resource: {
|
|
106
106
|
method: request.method,
|
|
107
107
|
statusCode: request.status,
|
|
108
|
-
url: request.url
|
|
108
|
+
url: request.url,
|
|
109
|
+
traceId: request.traceId,
|
|
110
|
+
spanId: request.spanId
|
|
109
111
|
},
|
|
110
112
|
type: ErrorSource.NETWORK,
|
|
111
113
|
source: ErrorSource.NETWORK,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { startAutomaticErrorCollection } from '../../core/errorCollection';
|
|
2
2
|
import { RumEventType } from '../../helper/enums';
|
|
3
3
|
import { LifeCycleEventType } from '../../core/lifeCycle';
|
|
4
|
-
import { urlParse, replaceNumberCharByPath, getStatusGroup } from '../../helper/utils';
|
|
4
|
+
import { urlParse, replaceNumberCharByPath, getStatusGroup, extend2Lev } from '../../helper/utils';
|
|
5
5
|
export function startErrorCollection(lifeCycle, configuration) {
|
|
6
6
|
// return doStartErrorCollection(
|
|
7
7
|
// lifeCycle,
|
|
@@ -44,8 +44,10 @@ export function doStartErrorCollection(lifeCycle) {
|
|
|
44
44
|
|
|
45
45
|
function processError(error) {
|
|
46
46
|
var resource = error.resource;
|
|
47
|
+
var tracingInfo;
|
|
47
48
|
|
|
48
49
|
if (resource) {
|
|
50
|
+
tracingInfo = computeRequestTracingInfo(resource);
|
|
49
51
|
var urlObj = urlParse(error.resource.url).getParse();
|
|
50
52
|
resource = {
|
|
51
53
|
method: error.resource.method,
|
|
@@ -58,7 +60,7 @@ function processError(error) {
|
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
var rawRumEvent = {
|
|
63
|
+
var rawRumEvent = extend2Lev({
|
|
62
64
|
date: error.startTime,
|
|
63
65
|
error: {
|
|
64
66
|
message: error.message,
|
|
@@ -69,9 +71,24 @@ function processError(error) {
|
|
|
69
71
|
starttime: error.startTime
|
|
70
72
|
},
|
|
71
73
|
type: RumEventType.ERROR
|
|
72
|
-
};
|
|
74
|
+
}, tracingInfo);
|
|
73
75
|
return {
|
|
74
76
|
rawRumEvent: rawRumEvent,
|
|
75
77
|
startTime: error.startTime
|
|
76
78
|
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function computeRequestTracingInfo(request) {
|
|
82
|
+
var hasBeenTraced = request.traceId && request.spanId;
|
|
83
|
+
|
|
84
|
+
if (!hasBeenTraced) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
_dd: {
|
|
90
|
+
spanId: request.spanId,
|
|
91
|
+
traceId: request.traceId
|
|
92
|
+
}
|
|
93
|
+
};
|
|
77
94
|
}
|
|
@@ -33,7 +33,7 @@ DDtraceTracer.prototype = {
|
|
|
33
33
|
makeTracingHeaders: function makeTracingHeaders() {
|
|
34
34
|
return {
|
|
35
35
|
'x-datadog-origin': 'rum',
|
|
36
|
-
|
|
36
|
+
'x-datadog-parent-id': this.getSpanId(),
|
|
37
37
|
'x-datadog-sampled': '1',
|
|
38
38
|
'x-datadog-sampling-priority': '1',
|
|
39
39
|
'x-datadog-trace-id': this.getTraceId()
|