@arms/rum-core 0.0.8 → 0.0.17
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/match.js +1 -1
- package/lib/utils/trace.d.ts +2 -1
- package/lib/utils/trace.js +6 -0
- package/package.json +1 -1
package/lib/utils/match.js
CHANGED
package/lib/utils/trace.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MatchOption } from "./match";
|
|
2
|
-
export type PropagatorType = 'tracecontext' | 'b3' | 'b3multi' | 'jaeger';
|
|
2
|
+
export type PropagatorType = 'tracecontext' | 'b3' | 'b3multi' | 'jaeger' | 'sw8';
|
|
3
3
|
export type TraceOption = {
|
|
4
4
|
match: MatchOption;
|
|
5
5
|
propagatorTypes: PropagatorType[];
|
|
@@ -17,5 +17,6 @@ export declare function generateSpanId(): any;
|
|
|
17
17
|
export interface ITracingHeaders {
|
|
18
18
|
[key: string]: string;
|
|
19
19
|
}
|
|
20
|
+
export declare function generateTraceIdForSW8(pid: string): void;
|
|
20
21
|
export declare function makeTracingHeaders(traceId: string, spanId: string, sampled: boolean, propagatorTypes: PropagatorType[], tracestate?: string, baggage?: string): ITracingHeaders;
|
|
21
22
|
export declare function parseTracingOptions(tracingOption: boolean | ITracingOption): ITracingOption;
|
package/lib/utils/trace.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.generateSpanId = generateSpanId;
|
|
5
5
|
exports.generateTraceId = generateTraceId;
|
|
6
|
+
exports.generateTraceIdForSW8 = generateTraceIdForSW8;
|
|
6
7
|
exports.isTraceOption = isTraceOption;
|
|
7
8
|
exports.makeTracingHeaders = makeTracingHeaders;
|
|
8
9
|
exports.parseTracingOptions = parseTracingOptions;
|
|
@@ -38,6 +39,8 @@ function generateTraceId() {
|
|
|
38
39
|
function generateSpanId() {
|
|
39
40
|
return generateId(SPAN_ID_BYTES);
|
|
40
41
|
}
|
|
42
|
+
//skywalking TraceId https://github.com/apache/skywalking-client-js
|
|
43
|
+
function generateTraceIdForSW8(pid) {}
|
|
41
44
|
function makeTracingHeaders(traceId, spanId, sampled, propagatorTypes, tracestate, baggage) {
|
|
42
45
|
var tracingHeaders = {};
|
|
43
46
|
var sample = sampled ? '1' : '0';
|
|
@@ -55,6 +58,9 @@ function makeTracingHeaders(traceId, spanId, sampled, propagatorTypes, tracestat
|
|
|
55
58
|
tracingHeaders['X-B3-SpanId'] = spanId;
|
|
56
59
|
tracingHeaders['X-B3-Sampled'] = sample;
|
|
57
60
|
break;
|
|
61
|
+
case 'sw8':
|
|
62
|
+
// tracingHeaders['sw8'] = `${sample}-${traceIdStr}-${segmentId}-${0}-${pid}-${app.version}-${href}-${host}`;;
|
|
63
|
+
break;
|
|
58
64
|
case 'tracecontext': // https://www.w3.org/TR/trace-context/
|
|
59
65
|
default:
|
|
60
66
|
tracingHeaders['traceparent'] = "00-" + traceId + "-" + spanId + "-0" + sample;
|