@interopio/otel 0.0.221 → 0.0.223
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/builder.d.ts +43 -43
- package/dist/builder.js +164 -164
- package/dist/builder.js.map +1 -1
- package/dist/constants.d.ts +7 -7
- package/dist/constants.js +10 -10
- package/dist/container.d.ts +24 -24
- package/dist/container.js +159 -159
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +140 -141
- package/dist/index.js +97 -88
- package/dist/index.js.map +1 -1
- package/dist/logger/log4jsWrapper.d.ts +19 -19
- package/dist/logger/log4jsWrapper.js +59 -59
- package/dist/logger/log4jsWrapper.js.map +1 -1
- package/dist/logger/logWrapper.d.ts +12 -12
- package/dist/logger/logWrapper.js +53 -53
- package/dist/logger/logWrapper.js.map +1 -1
- package/dist/logger/null.d.ts +9 -9
- package/dist/logger/null.js +24 -24
- package/dist/logs/builder.d.ts +9 -9
- package/dist/logs/builder.js +41 -41
- package/dist/logs/builder.js.map +1 -1
- package/dist/logs/logs.d.ts +8 -8
- package/dist/logs/logs.js +23 -23
- package/dist/logs/logs.js.map +1 -1
- package/dist/logs/nullManager.d.ts +7 -7
- package/dist/logs/nullManager.js +17 -17
- package/dist/logs/nullManager.js.map +1 -1
- package/dist/metrics/builder.d.ts +13 -13
- package/dist/metrics/builder.js +49 -49
- package/dist/metrics/builder.js.map +1 -1
- package/dist/metrics/metricsDependencyBuilder.d.ts +51 -51
- package/dist/metrics/metricsDependencyBuilder.js +154 -154
- package/dist/metrics/null.d.ts +11 -11
- package/dist/metrics/null.js +25 -25
- package/dist/metrics/nullMetricsManager.d.ts +8 -8
- package/dist/metrics/nullMetricsManager.js +24 -24
- package/dist/metrics/nullMetricsManager.js.map +1 -1
- package/dist/metrics/nullPerfProvider.d.ts +7 -7
- package/dist/metrics/nullPerfProvider.js +18 -18
- package/dist/nullManager.d.ts +8 -8
- package/dist/nullManager.js +23 -23
- package/dist/pluginLoader.d.ts +3 -3
- package/dist/pluginLoader.js +35 -36
- package/dist/pluginLoader.js.map +1 -1
- package/dist/traces/builder.d.ts +21 -21
- package/dist/traces/builder.js +72 -72
- package/dist/traces/builder.js.map +1 -1
- package/dist/traces/nullTracesManager.d.ts +20 -20
- package/dist/traces/nullTracesManager.js +109 -109
- package/dist/traces/nullTracesManager.js.map +1 -1
- package/dist/traces/nullTracingState.d.ts +25 -25
- package/dist/traces/nullTracingState.js +61 -61
- package/dist/traces/nullTracingState.js.map +1 -1
- package/dist/traces/traces.d.ts +32 -32
- package/dist/traces/traces.js +148 -148
- package/dist/traces/traces.js.map +1 -1
- package/dist/utils/is-plain-object.d.ts +1 -1
- package/dist/utils/is-plain-object.js +35 -36
- package/dist/utils/is-plain-object.js.map +1 -1
- package/dist/utils/isNode.d.ts +1 -1
- package/dist/utils/isNode.js +21 -22
- package/dist/utils/isNode.js.map +1 -1
- package/dist/utils/otelUtils.d.ts +7 -7
- package/dist/utils/otelUtils.js +120 -120
- package/dist/utils/otelUtils.js.map +1 -1
- package/dist/utils/safe-stringify.d.ts +1 -1
- package/dist/utils/safe-stringify.js +17 -18
- package/dist/utils/safe-stringify.js.map +1 -1
- package/insights.d.ts +0 -1
- package/package.json +25 -25
package/dist/pluginLoader.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function registerInsightsPlugin(name, pluginOrFactoryFunc) {
|
|
31
|
-
if (typeof globalThis.ioInsightsPlugins === "undefined") {
|
|
32
|
-
globalThis.ioInsightsPlugins = {};
|
|
33
|
-
}
|
|
34
|
-
globalThis.ioInsightsPlugins[name] = pluginOrFactoryFunc;
|
|
35
|
-
}
|
|
36
|
-
exports.registerInsightsPlugin = registerInsightsPlugin;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadInsightsPlugin = loadInsightsPlugin;
|
|
4
|
+
exports.registerInsightsPlugin = registerInsightsPlugin;
|
|
5
|
+
const returnedPlugins = new Map();
|
|
6
|
+
function loadInsightsPlugin(name, logger) {
|
|
7
|
+
if (returnedPlugins.get(name) !== undefined) {
|
|
8
|
+
return returnedPlugins.get(name);
|
|
9
|
+
}
|
|
10
|
+
if (typeof globalThis.ioInsightsPlugins === "undefined") {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
let plugin = globalThis.ioInsightsPlugins[name];
|
|
14
|
+
if (!plugin) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (typeof plugin === "function") {
|
|
18
|
+
try {
|
|
19
|
+
plugin = plugin();
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
logger === null || logger === void 0 ? void 0 : logger.error(`Error loading io.Insights plugin ${name}`, err);
|
|
23
|
+
returnedPlugins.set(name, null);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
returnedPlugins.set(name, plugin);
|
|
28
|
+
return plugin;
|
|
29
|
+
}
|
|
30
|
+
function registerInsightsPlugin(name, pluginOrFactoryFunc) {
|
|
31
|
+
if (typeof globalThis.ioInsightsPlugins === "undefined") {
|
|
32
|
+
globalThis.ioInsightsPlugins = {};
|
|
33
|
+
}
|
|
34
|
+
globalThis.ioInsightsPlugins[name] = pluginOrFactoryFunc;
|
|
35
|
+
}
|
|
37
36
|
//# sourceMappingURL=pluginLoader.js.map
|
package/dist/pluginLoader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginLoader.js","sourceRoot":"","sources":["../src/pluginLoader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pluginLoader.js","sourceRoot":"","sources":["../src/pluginLoader.ts"],"names":[],"mappings":";;AAKA,gDAwBC;AAED,wDAKC;AAhCD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAe,CAAC;AAC/C,SAAgB,kBAAkB,CAAI,IAAY,EAAE,MAAe;IACjE,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAC5C,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,UAAU,CAAC,iBAAiB,KAAK,WAAW,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,oCAAoC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/D,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,sBAAsB,CAAI,IAAY,EAAE,mBAAoC;IAC1F,IAAI,OAAO,UAAU,CAAC,iBAAiB,KAAK,WAAW,EAAE,CAAC;QACxD,UAAU,CAAC,iBAAiB,GAAG,EAAE,CAAC;IACpC,CAAC;IACD,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC;AAC3D,CAAC"}
|
package/dist/traces/builder.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ContextManager, type TracerProvider } from "@opentelemetry/api";
|
|
2
|
-
import { IOInsights } from "../../insights";
|
|
3
|
-
import { PropagationInfo } from "..";
|
|
4
|
-
export declare class TracesManagerBuilder implements IOInsights.TracesManagerBuilder {
|
|
5
|
-
logger: IOInsights.Logger;
|
|
6
|
-
traceLogger: IOInsights.Logger | null;
|
|
7
|
-
settings: IOInsights.Settings;
|
|
8
|
-
tracerProvider: TracerProvider;
|
|
9
|
-
metrics?: IOInsights.MetricsManager;
|
|
10
|
-
read?: (source: string) => Promise<PropagationInfo | null>;
|
|
11
|
-
store?: (source: string, pi: PropagationInfo) => Promise<void>;
|
|
12
|
-
withLogger(logger: IOInsights.Logger): this;
|
|
13
|
-
withTraceLogger(traceLogger: IOInsights.Logger): this;
|
|
14
|
-
withSettings(settings: IOInsights.Settings): this;
|
|
15
|
-
withMetrics(metrics: IOInsights.MetricsManager): this;
|
|
16
|
-
withTracerProvider(tracerProvider: TracerProvider): this;
|
|
17
|
-
withContextManager(contextManager: ContextManager): this;
|
|
18
|
-
withPropagationInfoStorage(store: (source: string, pi: PropagationInfo) => Promise<void>, read: (source: string) => Promise<PropagationInfo | null>): this;
|
|
19
|
-
build(): IOInsights.TracesManager;
|
|
20
|
-
private buildCore;
|
|
21
|
-
}
|
|
1
|
+
import { ContextManager, type TracerProvider } from "@opentelemetry/api";
|
|
2
|
+
import { IOInsights } from "../../insights";
|
|
3
|
+
import { PropagationInfo } from "..";
|
|
4
|
+
export declare class TracesManagerBuilder implements IOInsights.TracesManagerBuilder {
|
|
5
|
+
logger: IOInsights.Logger;
|
|
6
|
+
traceLogger: IOInsights.Logger | null;
|
|
7
|
+
settings: IOInsights.Settings;
|
|
8
|
+
tracerProvider: TracerProvider;
|
|
9
|
+
metrics?: IOInsights.MetricsManager;
|
|
10
|
+
read?: (source: string) => Promise<PropagationInfo | null>;
|
|
11
|
+
store?: (source: string, pi: PropagationInfo) => Promise<void>;
|
|
12
|
+
withLogger(logger: IOInsights.Logger): this;
|
|
13
|
+
withTraceLogger(traceLogger: IOInsights.Logger): this;
|
|
14
|
+
withSettings(settings: IOInsights.Settings): this;
|
|
15
|
+
withMetrics(metrics: IOInsights.MetricsManager): this;
|
|
16
|
+
withTracerProvider(tracerProvider: TracerProvider): this;
|
|
17
|
+
withContextManager(contextManager: ContextManager): this;
|
|
18
|
+
withPropagationInfoStorage(store: (source: string, pi: PropagationInfo) => Promise<void>, read: (source: string) => Promise<PropagationInfo | null>): this;
|
|
19
|
+
build(): IOInsights.TracesManager;
|
|
20
|
+
private buildCore;
|
|
21
|
+
}
|
package/dist/traces/builder.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TracesManagerBuilder = void 0;
|
|
4
|
-
const nullTracesManager_1 = require("./nullTracesManager");
|
|
5
|
-
const __1 = require("..");
|
|
6
|
-
class TracesManagerBuilder {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.traceLogger = null;
|
|
9
|
-
}
|
|
10
|
-
withLogger(logger) {
|
|
11
|
-
this.logger = logger;
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
withTraceLogger(traceLogger) {
|
|
15
|
-
this.traceLogger = traceLogger;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
withSettings(settings) {
|
|
19
|
-
this.settings = settings;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
withMetrics(metrics) {
|
|
23
|
-
this.metrics = metrics;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
withTracerProvider(tracerProvider) {
|
|
27
|
-
this.tracerProvider = tracerProvider;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
withContextManager(contextManager) {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
this.settings = (_a = this.settings) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
33
|
-
this.settings.traces = (_b = this.settings.traces) !== null && _b !== void 0 ? _b : { enabled: false };
|
|
34
|
-
this.settings.traces.contextManager = () => contextManager;
|
|
35
|
-
this.settings.traces.useOTELContextManager = true;
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
withPropagationInfoStorage(store, read) {
|
|
39
|
-
this.store = store;
|
|
40
|
-
this.read = read;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
build() {
|
|
44
|
-
var _a, _b, _c, _d;
|
|
45
|
-
if (((_a = globalThis.ioInsightsInternals) === null || _a === void 0 ? void 0 : _a.traces) &&
|
|
46
|
-
((_b = this.settings) === null || _b === void 0 ? void 0 : _b.definitiveInstance) !== true) {
|
|
47
|
-
return globalThis.ioInsightsInternals.traces;
|
|
48
|
-
}
|
|
49
|
-
const toReturn = this.buildCore();
|
|
50
|
-
globalThis.ioInsightsInternals = (_c = globalThis.ioInsightsInternals) !== null && _c !== void 0 ? _c : {};
|
|
51
|
-
if (!globalThis.ioInsightsInternals.traces ||
|
|
52
|
-
((_d = this.settings) === null || _d === void 0 ? void 0 : _d.definitiveInstance)) {
|
|
53
|
-
globalThis.ioInsightsInternals.traces = toReturn;
|
|
54
|
-
}
|
|
55
|
-
return toReturn;
|
|
56
|
-
}
|
|
57
|
-
buildCore() {
|
|
58
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
59
|
-
this.settings.traces = (_a = this.settings.traces) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
60
|
-
this.settings.traces.otlpExporterConfig = (_b = this.settings.traces.exporterSettings) !== null && _b !== void 0 ? _b : this.settings.traces.otlpExporterConfig;
|
|
61
|
-
this.settings.traces.exporterSettings = (_c = this.settings.traces.exporterSettings) !== null && _c !== void 0 ? _c : this.settings.traces.otlpExporterConfig;
|
|
62
|
-
let tracePlugin;
|
|
63
|
-
if (((_d = this.settings) === null || _d === void 0 ? void 0 : _d.enabled) !== true ||
|
|
64
|
-
((_f = (_e = this.settings) === null || _e === void 0 ? void 0 : _e.traces) === null || _f === void 0 ? void 0 : _f.enabled) !== true ||
|
|
65
|
-
!(tracePlugin = (0, __1.loadInsightsPlugin)("traces", this.logger))) {
|
|
66
|
-
return new nullTracesManager_1.NullTracesManager((_g = this.settings) === null || _g === void 0 ? void 0 : _g.traces, this.settings, this.logger);
|
|
67
|
-
}
|
|
68
|
-
const manager = tracePlugin.newTracesManager(this.logger, this.settings, (_h = this.traceLogger) !== null && _h !== void 0 ? _h : this.logger, this.metrics, this.store, this.read);
|
|
69
|
-
return manager;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.TracesManagerBuilder = TracesManagerBuilder;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TracesManagerBuilder = void 0;
|
|
4
|
+
const nullTracesManager_1 = require("./nullTracesManager");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
class TracesManagerBuilder {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.traceLogger = null;
|
|
9
|
+
}
|
|
10
|
+
withLogger(logger) {
|
|
11
|
+
this.logger = logger;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
withTraceLogger(traceLogger) {
|
|
15
|
+
this.traceLogger = traceLogger;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
withSettings(settings) {
|
|
19
|
+
this.settings = settings;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
withMetrics(metrics) {
|
|
23
|
+
this.metrics = metrics;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
withTracerProvider(tracerProvider) {
|
|
27
|
+
this.tracerProvider = tracerProvider;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
withContextManager(contextManager) {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
this.settings = (_a = this.settings) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
33
|
+
this.settings.traces = (_b = this.settings.traces) !== null && _b !== void 0 ? _b : { enabled: false };
|
|
34
|
+
this.settings.traces.contextManager = () => contextManager;
|
|
35
|
+
this.settings.traces.useOTELContextManager = true;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
withPropagationInfoStorage(store, read) {
|
|
39
|
+
this.store = store;
|
|
40
|
+
this.read = read;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
build() {
|
|
44
|
+
var _a, _b, _c, _d;
|
|
45
|
+
if (((_a = globalThis.ioInsightsInternals) === null || _a === void 0 ? void 0 : _a.traces) &&
|
|
46
|
+
((_b = this.settings) === null || _b === void 0 ? void 0 : _b.definitiveInstance) !== true) {
|
|
47
|
+
return globalThis.ioInsightsInternals.traces;
|
|
48
|
+
}
|
|
49
|
+
const toReturn = this.buildCore();
|
|
50
|
+
globalThis.ioInsightsInternals = (_c = globalThis.ioInsightsInternals) !== null && _c !== void 0 ? _c : {};
|
|
51
|
+
if (!globalThis.ioInsightsInternals.traces ||
|
|
52
|
+
((_d = this.settings) === null || _d === void 0 ? void 0 : _d.definitiveInstance)) {
|
|
53
|
+
globalThis.ioInsightsInternals.traces = toReturn;
|
|
54
|
+
}
|
|
55
|
+
return toReturn;
|
|
56
|
+
}
|
|
57
|
+
buildCore() {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
59
|
+
this.settings.traces = (_a = this.settings.traces) !== null && _a !== void 0 ? _a : { enabled: false };
|
|
60
|
+
this.settings.traces.otlpExporterConfig = (_b = this.settings.traces.exporterSettings) !== null && _b !== void 0 ? _b : this.settings.traces.otlpExporterConfig;
|
|
61
|
+
this.settings.traces.exporterSettings = (_c = this.settings.traces.exporterSettings) !== null && _c !== void 0 ? _c : this.settings.traces.otlpExporterConfig;
|
|
62
|
+
let tracePlugin;
|
|
63
|
+
if (((_d = this.settings) === null || _d === void 0 ? void 0 : _d.enabled) !== true ||
|
|
64
|
+
((_f = (_e = this.settings) === null || _e === void 0 ? void 0 : _e.traces) === null || _f === void 0 ? void 0 : _f.enabled) !== true ||
|
|
65
|
+
!(tracePlugin = (0, __1.loadInsightsPlugin)("traces", this.logger))) {
|
|
66
|
+
return new nullTracesManager_1.NullTracesManager((_g = this.settings) === null || _g === void 0 ? void 0 : _g.traces, this.settings, this.logger);
|
|
67
|
+
}
|
|
68
|
+
const manager = tracePlugin.newTracesManager(this.logger, this.settings, (_h = this.traceLogger) !== null && _h !== void 0 ? _h : this.logger, this.metrics, this.store, this.read);
|
|
69
|
+
return manager;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.TracesManagerBuilder = TracesManagerBuilder;
|
|
73
73
|
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/traces/builder.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AAGxD,0BAAgG;AAIhG,MAAa,oBAAoB;IAAjC;QAES,gBAAW,GAA6B,IAAI,CAAC;IAsFtD,CAAC;IA/EQ,UAAU,CAAC,MAAyB;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,eAAe,CAAC,WAA8B;QACnD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,YAAY,CAAC,QAA6B;QAC/C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW,CAAC,OAAkC;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO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AgB,CAC1C,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,EACb,MAAA,IAAI,CAAC,WAAW,mCAAI,IAAI,CAAC,MAAM,EAC/B,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAxFD,oDAwFC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { IOInsights } from "../../insights";
|
|
2
|
-
import { NullManager } from "../nullManager";
|
|
3
|
-
export declare class NullTracesManager extends NullManager<IOInsights.TracesSettings> implements IOInsights.TracesManager {
|
|
4
|
-
private _settings;
|
|
5
|
-
private logger;
|
|
6
|
-
get settings(): IOInsights.TracesSettings;
|
|
7
|
-
set settings(value: IOInsights.TracesSettings);
|
|
8
|
-
constructor(_settings: IOInsights.TracesSettings | undefined, otelSettings: IOInsights.Settings | undefined, logger: IOInsights.Logger | undefined);
|
|
9
|
-
withSequenceSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
10
|
-
withSequenceSpanEx<T>(source: string, traceName: string | null, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
11
|
-
get currentTracingState(): IOInsights.TracingState | null;
|
|
12
|
-
set currentTracingState(ts: IOInsights.TracingState | null);
|
|
13
|
-
waitForFinalExport(timeoutMs?: number | undefined): Promise<void>;
|
|
14
|
-
withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
15
|
-
setFilterConfig(filters: IOInsights.SpanFilter[]): void;
|
|
16
|
-
get startupTraceFinished(): (() => void) | undefined;
|
|
17
|
-
get userJourneyMarker(): IOInsights.MarkerSpanCallback | undefined;
|
|
18
|
-
setUserJourneyMarker(userJourneyMarker: IOInsights.MarkerSpanCallback): void;
|
|
19
|
-
get clickstreamMarker(): IOInsights.MarkerSpanCallback | undefined;
|
|
20
|
-
}
|
|
1
|
+
import { IOInsights } from "../../insights";
|
|
2
|
+
import { NullManager } from "../nullManager";
|
|
3
|
+
export declare class NullTracesManager extends NullManager<IOInsights.TracesSettings> implements IOInsights.TracesManager {
|
|
4
|
+
private _settings;
|
|
5
|
+
private logger;
|
|
6
|
+
get settings(): IOInsights.TracesSettings;
|
|
7
|
+
set settings(value: IOInsights.TracesSettings);
|
|
8
|
+
constructor(_settings: IOInsights.TracesSettings | undefined, otelSettings: IOInsights.Settings | undefined, logger: IOInsights.Logger | undefined);
|
|
9
|
+
withSequenceSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
10
|
+
withSequenceSpanEx<T>(source: string, traceName: string | null, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
11
|
+
get currentTracingState(): IOInsights.TracingState | null;
|
|
12
|
+
set currentTracingState(ts: IOInsights.TracingState | null);
|
|
13
|
+
waitForFinalExport(timeoutMs?: number | undefined): Promise<void>;
|
|
14
|
+
withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T> | null, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | IOInsights.WithSpanCallback<T> | null, optionsOrCallback?: IOInsights.WithSpanOptions | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
15
|
+
setFilterConfig(filters: IOInsights.SpanFilter[]): void;
|
|
16
|
+
get startupTraceFinished(): (() => void) | undefined;
|
|
17
|
+
get userJourneyMarker(): IOInsights.MarkerSpanCallback | undefined;
|
|
18
|
+
setUserJourneyMarker(userJourneyMarker: IOInsights.MarkerSpanCallback): void;
|
|
19
|
+
get clickstreamMarker(): IOInsights.MarkerSpanCallback | undefined;
|
|
20
|
+
}
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.NullTracesManager = void 0;
|
|
16
|
-
const nullTracingState_1 = __importDefault(require("./nullTracingState"));
|
|
17
|
-
const traces_1 = __importDefault(require("./traces"));
|
|
18
|
-
const nullManager_1 = require("../nullManager");
|
|
19
|
-
const safe_stringify_1 = require("../utils/safe-stringify");
|
|
20
|
-
class NullTracesManager extends nullManager_1.NullManager {
|
|
21
|
-
get settings() {
|
|
22
|
-
return this._settings || {};
|
|
23
|
-
}
|
|
24
|
-
set settings(value) {
|
|
25
|
-
this._settings = value;
|
|
26
|
-
}
|
|
27
|
-
constructor(_settings, otelSettings, logger) {
|
|
28
|
-
if ((otelSettings === null || otelSettings === void 0 ? void 0 : otelSettings.logSettingsOnStartup) !== false) {
|
|
29
|
-
logger === null || logger === void 0 ? void 0 : logger.info(`Starting NullTracesManager with settings ${(0, safe_stringify_1.safeStringify)(_settings)}`);
|
|
30
|
-
}
|
|
31
|
-
super();
|
|
32
|
-
this._settings = _settings;
|
|
33
|
-
this.logger = logger;
|
|
34
|
-
}
|
|
35
|
-
withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
return this.withSequenceSpanEx(source, source + ".start", filteringContextOrCallback, optionsOrCallback, callback);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return this.withSpan(source, filteringContextOrCallback, null, optionsOrCallback, callback);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
get currentTracingState() {
|
|
46
|
-
return new nullTracingState_1.default("nullTracingState", null, true);
|
|
47
|
-
}
|
|
48
|
-
set currentTracingState(ts) {
|
|
49
|
-
}
|
|
50
|
-
waitForFinalExport(timeoutMs) {
|
|
51
|
-
return Promise.resolve();
|
|
52
|
-
}
|
|
53
|
-
withSpan(source, filteringContextOrCallback, propagationInfoOrCallback, optionsOrCallback, callback) {
|
|
54
|
-
const actualCallback =
|
|
55
|
-
// eslint-disable-next-line no-nested-ternary
|
|
56
|
-
typeof filteringContextOrCallback === "function"
|
|
57
|
-
? filteringContextOrCallback
|
|
58
|
-
: typeof propagationInfoOrCallback === "function"
|
|
59
|
-
? propagationInfoOrCallback
|
|
60
|
-
: typeof optionsOrCallback === "function"
|
|
61
|
-
? optionsOrCallback
|
|
62
|
-
: callback;
|
|
63
|
-
if (!actualCallback) {
|
|
64
|
-
throw new Error("callback must be provided");
|
|
65
|
-
}
|
|
66
|
-
if (typeof actualCallback !== "function") {
|
|
67
|
-
throw new Error("Callback must be a function, received " + typeof actualCallback);
|
|
68
|
-
}
|
|
69
|
-
// ! DO NOT log in this method, danger of infinite loop with
|
|
70
|
-
// interop log publishing
|
|
71
|
-
//
|
|
72
|
-
// this.logger?.debug("nullTracesManager.withSpan: " + source);
|
|
73
|
-
// ! a null manager means no propagation
|
|
74
|
-
//
|
|
75
|
-
// let extractedPI: PropagationInfo | null = null;
|
|
76
|
-
// if (propagationInfoOrCallback) {
|
|
77
|
-
// let propagationInfoCarrier = {};
|
|
78
|
-
// if (!isFunctionType(propagationInfoOrCallback)) {
|
|
79
|
-
// propagationInfoCarrier = { ...propagationInfoOrCallback };
|
|
80
|
-
// }
|
|
81
|
-
// extractedPI = Traces.extractPropagationInfo(propagationInfoCarrier);
|
|
82
|
-
// } else {
|
|
83
|
-
// extractedPI = Traces.currentTracingState?.getPropagationInfo() || null;
|
|
84
|
-
// }
|
|
85
|
-
// const nts = new NullTracingState(source, extractedPI);
|
|
86
|
-
const nts = new nullTracingState_1.default(source, null, true);
|
|
87
|
-
traces_1.default.currentTracingState = nts;
|
|
88
|
-
try {
|
|
89
|
-
return actualCallback(nts);
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
traces_1.default.currentTracingState = null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
setFilterConfig(filters) {
|
|
96
|
-
}
|
|
97
|
-
get startupTraceFinished() {
|
|
98
|
-
return (() => { });
|
|
99
|
-
}
|
|
100
|
-
get userJourneyMarker() {
|
|
101
|
-
return (() => { });
|
|
102
|
-
}
|
|
103
|
-
setUserJourneyMarker(userJourneyMarker) {
|
|
104
|
-
}
|
|
105
|
-
get clickstreamMarker() {
|
|
106
|
-
return (() => { });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
exports.NullTracesManager = NullTracesManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.NullTracesManager = void 0;
|
|
16
|
+
const nullTracingState_1 = __importDefault(require("./nullTracingState"));
|
|
17
|
+
const traces_1 = __importDefault(require("./traces"));
|
|
18
|
+
const nullManager_1 = require("../nullManager");
|
|
19
|
+
const safe_stringify_1 = require("../utils/safe-stringify");
|
|
20
|
+
class NullTracesManager extends nullManager_1.NullManager {
|
|
21
|
+
get settings() {
|
|
22
|
+
return this._settings || {};
|
|
23
|
+
}
|
|
24
|
+
set settings(value) {
|
|
25
|
+
this._settings = value;
|
|
26
|
+
}
|
|
27
|
+
constructor(_settings, otelSettings, logger) {
|
|
28
|
+
if ((otelSettings === null || otelSettings === void 0 ? void 0 : otelSettings.logSettingsOnStartup) !== false) {
|
|
29
|
+
logger === null || logger === void 0 ? void 0 : logger.info(`Starting NullTracesManager with settings ${(0, safe_stringify_1.safeStringify)(_settings)}`);
|
|
30
|
+
}
|
|
31
|
+
super();
|
|
32
|
+
this._settings = _settings;
|
|
33
|
+
this.logger = logger;
|
|
34
|
+
}
|
|
35
|
+
withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
return this.withSequenceSpanEx(source, source + ".start", filteringContextOrCallback, optionsOrCallback, callback);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return this.withSpan(source, filteringContextOrCallback, null, optionsOrCallback, callback);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
get currentTracingState() {
|
|
46
|
+
return new nullTracingState_1.default("nullTracingState", null, true);
|
|
47
|
+
}
|
|
48
|
+
set currentTracingState(ts) {
|
|
49
|
+
}
|
|
50
|
+
waitForFinalExport(timeoutMs) {
|
|
51
|
+
return Promise.resolve();
|
|
52
|
+
}
|
|
53
|
+
withSpan(source, filteringContextOrCallback, propagationInfoOrCallback, optionsOrCallback, callback) {
|
|
54
|
+
const actualCallback =
|
|
55
|
+
// eslint-disable-next-line no-nested-ternary
|
|
56
|
+
typeof filteringContextOrCallback === "function"
|
|
57
|
+
? filteringContextOrCallback
|
|
58
|
+
: typeof propagationInfoOrCallback === "function"
|
|
59
|
+
? propagationInfoOrCallback
|
|
60
|
+
: typeof optionsOrCallback === "function"
|
|
61
|
+
? optionsOrCallback
|
|
62
|
+
: callback;
|
|
63
|
+
if (!actualCallback) {
|
|
64
|
+
throw new Error("callback must be provided");
|
|
65
|
+
}
|
|
66
|
+
if (typeof actualCallback !== "function") {
|
|
67
|
+
throw new Error("Callback must be a function, received " + typeof actualCallback);
|
|
68
|
+
}
|
|
69
|
+
// ! DO NOT log in this method, danger of infinite loop with
|
|
70
|
+
// interop log publishing
|
|
71
|
+
//
|
|
72
|
+
// this.logger?.debug("nullTracesManager.withSpan: " + source);
|
|
73
|
+
// ! a null manager means no propagation
|
|
74
|
+
//
|
|
75
|
+
// let extractedPI: PropagationInfo | null = null;
|
|
76
|
+
// if (propagationInfoOrCallback) {
|
|
77
|
+
// let propagationInfoCarrier = {};
|
|
78
|
+
// if (!isFunctionType(propagationInfoOrCallback)) {
|
|
79
|
+
// propagationInfoCarrier = { ...propagationInfoOrCallback };
|
|
80
|
+
// }
|
|
81
|
+
// extractedPI = Traces.extractPropagationInfo(propagationInfoCarrier);
|
|
82
|
+
// } else {
|
|
83
|
+
// extractedPI = Traces.currentTracingState?.getPropagationInfo() || null;
|
|
84
|
+
// }
|
|
85
|
+
// const nts = new NullTracingState(source, extractedPI);
|
|
86
|
+
const nts = new nullTracingState_1.default(source, null, true);
|
|
87
|
+
traces_1.default.currentTracingState = nts;
|
|
88
|
+
try {
|
|
89
|
+
return actualCallback(nts);
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
traces_1.default.currentTracingState = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
setFilterConfig(filters) {
|
|
96
|
+
}
|
|
97
|
+
get startupTraceFinished() {
|
|
98
|
+
return (() => { });
|
|
99
|
+
}
|
|
100
|
+
get userJourneyMarker() {
|
|
101
|
+
return (() => { });
|
|
102
|
+
}
|
|
103
|
+
setUserJourneyMarker(userJourneyMarker) {
|
|
104
|
+
}
|
|
105
|
+
get clickstreamMarker() {
|
|
106
|
+
return (() => { });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.NullTracesManager = NullTracesManager;
|
|
110
110
|
//# sourceMappingURL=nullTracesManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullTracesManager.js","sourceRoot":"","sources":["../../src/traces/nullTracesManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAkD;AAClD,sDAA8B;AAE9B,gDAA6C;AAC7C,4DAAwD;AACx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;QACzE,WAAW;QACX,4EAA4E;QAC5E,IAAI;QACJ,yDAAyD;QAEzD,MAAM,GAAG,GAAG,IAAI,0BAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAErD,gBAAM,CAAC,mBAAmB,GAAG,GAAG,CAAC;QACjC,IAAI,CAAC;YACH,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACT,gBAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACpC,CAAC;IACH,CAAC;IAED,eAAe,CAAC,OAAgC;IAChD,CAAC;IAED,IAAW,oBAAoB;QAC7B,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAW,iBAAiB;QAC1B,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,oBAAoB,CAAC,iBAAgD;IACrE,CAAC;IAED,IAAW,iBAAiB;QAC1B,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpB,CAAC;CACF;AA1JD,8CA0JC"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { type Exception, type TimeInput, type Attributes, type SpanStatus } from "@opentelemetry/api";
|
|
2
|
-
import { IOInsights } from "../../insights";
|
|
3
|
-
export default class NullTracingState implements IOInsights.TracingState {
|
|
4
|
-
source: string;
|
|
5
|
-
private propagationInfo;
|
|
6
|
-
private disablePropagation;
|
|
7
|
-
private currentSpanStatus;
|
|
8
|
-
constructor(source: string, propagationInfo: IOInsights.PropagationInfo | null, disablePropagation: boolean);
|
|
9
|
-
level: "OFF";
|
|
10
|
-
endSpan(): Promise<void>;
|
|
11
|
-
get enabled(): boolean;
|
|
12
|
-
get id(): undefined;
|
|
13
|
-
get traceId(): undefined;
|
|
14
|
-
set status(status: SpanStatus);
|
|
15
|
-
get status(): SpanStatus;
|
|
16
|
-
addEvent(name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput): this;
|
|
17
|
-
recordException(exception: Exception, time?: TimeInput): void;
|
|
18
|
-
isRecording(): boolean;
|
|
19
|
-
updateName(name: string): this;
|
|
20
|
-
spanContext(): undefined;
|
|
21
|
-
addData(level: IOInsights.SpanVerbosity | keyof typeof IOInsights.SpanVerbosity, data: object | (() => object)): void;
|
|
22
|
-
end(): void;
|
|
23
|
-
getPropagationInfo(): IOInsights.PropagationInfo | null;
|
|
24
|
-
injectPropagationInfo(carrier: IOInsights.PropagationInfoCarrier): void;
|
|
25
|
-
}
|
|
1
|
+
import { type Exception, type TimeInput, type Attributes, type SpanStatus } from "@opentelemetry/api";
|
|
2
|
+
import { IOInsights } from "../../insights";
|
|
3
|
+
export default class NullTracingState implements IOInsights.TracingState {
|
|
4
|
+
source: string;
|
|
5
|
+
private propagationInfo;
|
|
6
|
+
private disablePropagation;
|
|
7
|
+
private currentSpanStatus;
|
|
8
|
+
constructor(source: string, propagationInfo: IOInsights.PropagationInfo | null, disablePropagation: boolean);
|
|
9
|
+
level: "OFF";
|
|
10
|
+
endSpan(): Promise<void>;
|
|
11
|
+
get enabled(): boolean;
|
|
12
|
+
get id(): undefined;
|
|
13
|
+
get traceId(): undefined;
|
|
14
|
+
set status(status: SpanStatus);
|
|
15
|
+
get status(): SpanStatus;
|
|
16
|
+
addEvent(name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput): this;
|
|
17
|
+
recordException(exception: Exception, time?: TimeInput): void;
|
|
18
|
+
isRecording(): boolean;
|
|
19
|
+
updateName(name: string): this;
|
|
20
|
+
spanContext(): undefined;
|
|
21
|
+
addData(level: IOInsights.SpanVerbosity | keyof typeof IOInsights.SpanVerbosity, data: object | (() => object)): void;
|
|
22
|
+
end(): void;
|
|
23
|
+
getPropagationInfo(): IOInsights.PropagationInfo | null;
|
|
24
|
+
injectPropagationInfo(carrier: IOInsights.PropagationInfoCarrier): void;
|
|
25
|
+
}
|