o11y 260.4.0 → 260.5.0
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/dist/modules/o11y/client/client.js +33 -1
- package/dist/modules/o11y/client/client.js.map +1 -1
- package/dist/modules/o11y/client/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/client/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/client/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/client/version.d.ts +1 -1
- package/dist/modules/o11y/collectors/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/collectors/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/collectors/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/collectors/version.d.ts +1 -1
- package/dist/modules/o11y/core_envelope/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/core_envelope/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/core_envelope/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/core_envelope/version.d.ts +1 -1
- package/dist/modules/o11y/shared/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/shared/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/shared/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/shared/version.d.ts +1 -1
- package/dist/modules/o11y/simple_collector/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/simple_collector/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/simple_collector/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/simple_collector/version.d.ts +1 -1
- package/dist/modules/o11y/web_vitals/interfaces/Instrumentation.d.ts +1 -0
- package/dist/modules/o11y/web_vitals/library/InstrumentationImpl.d.ts +1 -0
- package/dist/modules/o11y/web_vitals/library/Tracing.d.ts +2 -0
- package/dist/modules/o11y/web_vitals/version.d.ts +1 -1
- package/dist/modules/o11y/web_vitals/web_vitals.js +32 -0
- package/dist/modules/o11y/web_vitals/web_vitals.js.map +1 -1
- package/package.json +1 -1
|
@@ -511,10 +511,18 @@ const headerSpanId = 'X-B3-SpanId';
|
|
|
511
511
|
const headerSampled = 'X-B3-Sampled';
|
|
512
512
|
const headerParentSpanId = 'X-B3-ParentSpanId';
|
|
513
513
|
const headerRequestId = 'X-SFDC-Request-Id';
|
|
514
|
+
const headerBaggage = 'baggage';
|
|
514
515
|
const defaultActivityNameForFetch = 'fetch';
|
|
515
516
|
const defaultActivityNameForXhrSend = 'xhr_send';
|
|
516
517
|
const defaultTimingActivityName = 'perf-timing';
|
|
517
518
|
const defaultFuzzyMapRange = 50;
|
|
519
|
+
const userSettableHeaders = [
|
|
520
|
+
headerBaggage,
|
|
521
|
+
headerTraceId,
|
|
522
|
+
headerSpanId,
|
|
523
|
+
headerParentSpanId,
|
|
524
|
+
headerSampled
|
|
525
|
+
];
|
|
518
526
|
const o11yInfoForXHR = new WeakMap();
|
|
519
527
|
class Tracing {
|
|
520
528
|
constructor(_instr, _idleDetector) {
|
|
@@ -553,6 +561,18 @@ class Tracing {
|
|
|
553
561
|
}
|
|
554
562
|
return text;
|
|
555
563
|
}
|
|
564
|
+
static setHeaders(headers) {
|
|
565
|
+
if (headers === undefined) {
|
|
566
|
+
Tracing._userHeaders = {};
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
Object.entries(headers).forEach(([key]) => {
|
|
570
|
+
if (!userSettableHeaders.includes(key)) {
|
|
571
|
+
delete headers[key];
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
Tracing._userHeaders = headers;
|
|
575
|
+
}
|
|
556
576
|
static getHeaders(traceId, spanId, isSampled, options) {
|
|
557
577
|
utility.requireArgument(spanId, 'spanId', 'string');
|
|
558
578
|
const useB3Headers = options === null || options === void 0 ? void 0 : options.useB3Headers;
|
|
@@ -668,6 +688,13 @@ class Tracing {
|
|
|
668
688
|
traceHeaders = undefined;
|
|
669
689
|
}
|
|
670
690
|
}
|
|
691
|
+
if (Tracing._userHeaders && Object.keys(Tracing._userHeaders).length > 0) {
|
|
692
|
+
traceHeaders = { ...traceHeaders };
|
|
693
|
+
Object.entries(Tracing._userHeaders).forEach(([key, value]) => {
|
|
694
|
+
traceHeaders[key] = value;
|
|
695
|
+
});
|
|
696
|
+
Tracing._userHeaders = undefined;
|
|
697
|
+
}
|
|
671
698
|
return traceHeaders || {};
|
|
672
699
|
}
|
|
673
700
|
static _extractHeader(headerName, input, init) {
|
|
@@ -1884,6 +1911,10 @@ class InstrumentationImpl {
|
|
|
1884
1911
|
act.stop((_c = options === null || options === void 0 ? void 0 : options.stopPayload) === null || _c === void 0 ? void 0 : _c.schema, (_d = options === null || options === void 0 ? void 0 : options.stopPayload) === null || _d === void 0 ? void 0 : _d.payload, options === null || options === void 0 ? void 0 : options.stopOptions);
|
|
1885
1912
|
}
|
|
1886
1913
|
}
|
|
1914
|
+
invokeNetworkCallWithHeaders(apiCall, params, headers) {
|
|
1915
|
+
Tracing.setHeaders(headers);
|
|
1916
|
+
return apiCall(...params);
|
|
1917
|
+
}
|
|
1887
1918
|
}
|
|
1888
1919
|
InstrumentationImpl.defaultAppName = 'APP_NOT_REGISTERED';
|
|
1889
1920
|
|
|
@@ -2397,6 +2428,7 @@ class NextgenImpl {
|
|
|
2397
2428
|
registerForLogPrompt: this._appInstr.registerForLogPrompt.bind(this._appInstr),
|
|
2398
2429
|
activity: this._appInstr.activity.bind(this._appInstr),
|
|
2399
2430
|
activityAsync: this._appInstr.activityAsync.bind(this._appInstr),
|
|
2431
|
+
invokeNetworkCallWithHeaders: this._appInstr.invokeNetworkCallWithHeaders.bind(this._appInstr),
|
|
2400
2432
|
startRootActivity: this._appInstr.startRootActivity.bind(this._appInstr),
|
|
2401
2433
|
registerLogCollector: this._isSender ? noOpFunc : this.registerLogCollector.bind(this),
|
|
2402
2434
|
registerMetricsCollector: this._isSender
|
|
@@ -2751,7 +2783,7 @@ class ConsoleCollector {
|
|
|
2751
2783
|
}
|
|
2752
2784
|
}
|
|
2753
2785
|
|
|
2754
|
-
const version = '260.
|
|
2786
|
+
const version = '260.5.0';
|
|
2755
2787
|
|
|
2756
2788
|
const idleDetector = new IdleDetectorImpl({
|
|
2757
2789
|
logThreshold: 300,
|