@arms/rum-core 0.0.19 → 0.0.20
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/lib/utils/trace.d.ts +1 -1
- package/lib/utils/trace.js +9 -1
- package/package.json +1 -1
package/lib/utils/trace.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface ITracingOption {
|
|
|
13
13
|
baggage?: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare function generateTraceId(): string;
|
|
16
|
-
export declare function generateSpanId():
|
|
16
|
+
export declare function generateSpanId(): any;
|
|
17
17
|
export interface ITracingHeaders {
|
|
18
18
|
[key: string]: string;
|
|
19
19
|
}
|
package/lib/utils/trace.js
CHANGED
|
@@ -28,7 +28,15 @@ function generateTraceId() {
|
|
|
28
28
|
return traceId;
|
|
29
29
|
}
|
|
30
30
|
function generateSpanId() {
|
|
31
|
-
|
|
31
|
+
var list = new Array(16);
|
|
32
|
+
for (var i = 0; i < 16; i++) {
|
|
33
|
+
list[i] = Math.floor(Math.random() * 16) + 48;
|
|
34
|
+
// valid hex characters in the range 48-57 and 97-102
|
|
35
|
+
if (list[i] >= 58) {
|
|
36
|
+
list[i] += 39;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return String.fromCharCode.apply(null, list.slice(0, 16));
|
|
32
40
|
}
|
|
33
41
|
//skywalking TraceId https://github.com/apache/skywalking-client-js
|
|
34
42
|
function generateTraceIdForSW8(pid) {}
|