@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
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class NullTracingState {
|
|
4
|
-
constructor(source, propagationInfo, disablePropagation) {
|
|
5
|
-
this.source = source;
|
|
6
|
-
this.propagationInfo = propagationInfo;
|
|
7
|
-
this.disablePropagation = disablePropagation;
|
|
8
|
-
this.currentSpanStatus = { code: 0 /*SpanStatusCode.UNSET*/ };
|
|
9
|
-
this.level = "OFF";
|
|
10
|
-
}
|
|
11
|
-
endSpan() {
|
|
12
|
-
return Promise.resolve();
|
|
13
|
-
}
|
|
14
|
-
get enabled() {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
get id() {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
get traceId() {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
set status(status) {
|
|
24
|
-
this.currentSpanStatus = Object.assign({}, status);
|
|
25
|
-
}
|
|
26
|
-
get status() {
|
|
27
|
-
return this.currentSpanStatus;
|
|
28
|
-
}
|
|
29
|
-
addEvent(name, attributesOrStartTime, startTime) {
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
recordException(exception, time) { }
|
|
33
|
-
isRecording() {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
updateName(name) {
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
spanContext() {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
addData(level, data) {
|
|
43
|
-
}
|
|
44
|
-
end() { }
|
|
45
|
-
getPropagationInfo() {
|
|
46
|
-
if (this.propagationInfo) {
|
|
47
|
-
return this.propagationInfo;
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
// // todo vnikolov: should we use otel's own context management at all?
|
|
51
|
-
// const propagationInfo = { };
|
|
52
|
-
// propagation.inject(context.active(), propagationInfo);
|
|
53
|
-
// return propagationInfo;
|
|
54
|
-
}
|
|
55
|
-
injectPropagationInfo(carrier) {
|
|
56
|
-
if (this.propagationInfo && !this.disablePropagation) {
|
|
57
|
-
carrier.__interopIOTracePropagationInfo = this.propagationInfo;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.default = NullTracingState;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class NullTracingState {
|
|
4
|
+
constructor(source, propagationInfo, disablePropagation) {
|
|
5
|
+
this.source = source;
|
|
6
|
+
this.propagationInfo = propagationInfo;
|
|
7
|
+
this.disablePropagation = disablePropagation;
|
|
8
|
+
this.currentSpanStatus = { code: 0 /*SpanStatusCode.UNSET*/ };
|
|
9
|
+
this.level = "OFF";
|
|
10
|
+
}
|
|
11
|
+
endSpan() {
|
|
12
|
+
return Promise.resolve();
|
|
13
|
+
}
|
|
14
|
+
get enabled() {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
get id() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
get traceId() {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
set status(status) {
|
|
24
|
+
this.currentSpanStatus = Object.assign({}, status);
|
|
25
|
+
}
|
|
26
|
+
get status() {
|
|
27
|
+
return this.currentSpanStatus;
|
|
28
|
+
}
|
|
29
|
+
addEvent(name, attributesOrStartTime, startTime) {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
recordException(exception, time) { }
|
|
33
|
+
isRecording() {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
updateName(name) {
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
spanContext() {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
addData(level, data) {
|
|
43
|
+
}
|
|
44
|
+
end() { }
|
|
45
|
+
getPropagationInfo() {
|
|
46
|
+
if (this.propagationInfo) {
|
|
47
|
+
return this.propagationInfo;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
// // todo vnikolov: should we use otel's own context management at all?
|
|
51
|
+
// const propagationInfo = { };
|
|
52
|
+
// propagation.inject(context.active(), propagationInfo);
|
|
53
|
+
// return propagationInfo;
|
|
54
|
+
}
|
|
55
|
+
injectPropagationInfo(carrier) {
|
|
56
|
+
if (this.propagationInfo && !this.disablePropagation) {
|
|
57
|
+
carrier.__interopIOTracePropagationInfo = this.propagationInfo;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = NullTracingState;
|
|
62
62
|
//# sourceMappingURL=nullTracingState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullTracingState.js","sourceRoot":"","sources":["../../src/traces/nullTracingState.ts"],"names":[],"mappings":";;AAQA,MAAqB,gBAAgB;IAInC,YACS,MAAc,EACb,eAAkD,EAClD,kBAA2B;QAF5B,WAAM,GAAN,MAAM,CAAQ;QACb,oBAAe,GAAf,eAAe,CAAmC;QAClD,uBAAkB,GAAlB,kBAAkB,CAAS;QAL7B,sBAAiB,GAAe,EAAE,IAAI,EAAE,CAAQ,CAAC,wBAAwB,EAAE,CAAC;QAOpF,UAAK,GAAG,KAAc,CAAC;IAFiB,CAAC;IAIlC,OAAO;QACZ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAW,EAAE;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAW,OAAO;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAW,MAAM,CAAC,MAAkB;QAClC,IAAI,CAAC,iBAAiB,qBAAQ,MAAM,CAAE,CAAC;IACzC,CAAC;IACD,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAEM,QAAQ,CACb,IAAY,EACZ,qBAA8C,EAC9C,SAAqB;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;IACM,eAAe,CAAC,SAAoB,EAAE,IAAgB,IAAG,CAAC;IAC1D,WAAW;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACM,UAAU,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,OAAO,CAAC,KAAuE,EAAE,IAA6B;IACrH,CAAC;IAEM,GAAG,KAAU,CAAC;IAEd,kBAAkB;QACvB,IAAI,IAAI,CAAC,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"nullTracingState.js","sourceRoot":"","sources":["../../src/traces/nullTracingState.ts"],"names":[],"mappings":";;AAQA,MAAqB,g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qB,CAAC,OAA0C;QACrE,IAAI,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACrD,OAAO,CAAC,+BAA+B,GAAG,IAAI,CAAC,eAAe,CAAC;QACjE,CAAC;IACH,CAAC;CACF;AAxED,mCAwEC"}
|
package/dist/traces/traces.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { IOInsights } from "../../insights";
|
|
2
|
-
/**
|
|
3
|
-
* Null-safe singleton class that can be invoked even if you haven't initialized
|
|
4
|
-
* the library (yet?), or if you don't have access to the current manager instance.
|
|
5
|
-
*/
|
|
6
|
-
export default class Traces {
|
|
7
|
-
private static _instance;
|
|
8
|
-
static get instance(): IOInsights.TracesManager;
|
|
9
|
-
static set instance(value: IOInsights.TracesManager);
|
|
10
|
-
static get currentTracingState(): IOInsights.TracingState;
|
|
11
|
-
static set currentTracingState(value: IOInsights.TracingState | null);
|
|
12
|
-
static removePropagationInfo(propagationInfoCarrier: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined): IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined;
|
|
13
|
-
static extractPropagationInfo(propagationInfoCarrier: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined, deleteProperty?: boolean | undefined): IOInsights.PropagationInfo | null;
|
|
14
|
-
withSequenceSpanEx<T>(source: string, traceName: string | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
15
|
-
withSequenceSpanEx<T>(source: string, traceName: string | null, filteringContext: IOInsights.FilteringContext | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
16
|
-
withSequenceSpan<T>(source: string, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
17
|
-
withSequenceSpan<T>(source: string, filteringContext: IOInsights.FilteringContext | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
18
|
-
withSequenceSpan<T>(source: string, filteringContext: IOInsights.FilteringContext | null, options: IOInsights.WithSpanOptions | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
19
|
-
static withSpan(root: string, decoratorOptions?: IOInsights.WithSpanDecoratorOptions): Function;
|
|
20
|
-
static withSpan<T>(source: string, callback: IOInsights.WithSpanCallback<T>): T;
|
|
21
|
-
static withSpan<T>(source: string, filteringContext: IOInsights.FilteringContext, callback: IOInsights.WithSpanCallback<T>): T;
|
|
22
|
-
static withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T>, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | false | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
23
|
-
static withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T>, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | false | IOInsights.WithSpanCallback<T> | null, options?: IOInsights.WithSpanOptions | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
24
|
-
static isAsyncFunction(value: any): boolean;
|
|
25
|
-
static withSpans<T>(tracingMap: {
|
|
26
|
-
[propertyName in keyof Partial<T>]: ({
|
|
27
|
-
source: string;
|
|
28
|
-
decoratorOptions?: IOInsights.WithSpanDecoratorOptions;
|
|
29
|
-
} | string);
|
|
30
|
-
}, objectToTrace: T): T;
|
|
31
|
-
}
|
|
32
|
-
export declare const withSpan: typeof Traces.withSpan;
|
|
1
|
+
import { IOInsights } from "../../insights";
|
|
2
|
+
/**
|
|
3
|
+
* Null-safe singleton class that can be invoked even if you haven't initialized
|
|
4
|
+
* the library (yet?), or if you don't have access to the current manager instance.
|
|
5
|
+
*/
|
|
6
|
+
export default class Traces {
|
|
7
|
+
private static _instance;
|
|
8
|
+
static get instance(): IOInsights.TracesManager;
|
|
9
|
+
static set instance(value: IOInsights.TracesManager);
|
|
10
|
+
static get currentTracingState(): IOInsights.TracingState;
|
|
11
|
+
static set currentTracingState(value: IOInsights.TracingState | null);
|
|
12
|
+
static removePropagationInfo(propagationInfoCarrier: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined): IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined;
|
|
13
|
+
static extractPropagationInfo(propagationInfoCarrier: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | null | undefined, deleteProperty?: boolean | undefined): IOInsights.PropagationInfo | null;
|
|
14
|
+
withSequenceSpanEx<T>(source: string, traceName: string | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
15
|
+
withSequenceSpanEx<T>(source: string, traceName: string | null, filteringContext: IOInsights.FilteringContext | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
16
|
+
withSequenceSpan<T>(source: string, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
17
|
+
withSequenceSpan<T>(source: string, filteringContext: IOInsights.FilteringContext | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
18
|
+
withSequenceSpan<T>(source: string, filteringContext: IOInsights.FilteringContext | null, options: IOInsights.WithSpanOptions | null, callback: IOInsights.WithSpanCallback<T>): Promise<T>;
|
|
19
|
+
static withSpan(root: string, decoratorOptions?: IOInsights.WithSpanDecoratorOptions): Function;
|
|
20
|
+
static withSpan<T>(source: string, callback: IOInsights.WithSpanCallback<T>): T;
|
|
21
|
+
static withSpan<T>(source: string, filteringContext: IOInsights.FilteringContext, callback: IOInsights.WithSpanCallback<T>): T;
|
|
22
|
+
static withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T>, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | false | IOInsights.WithSpanCallback<T> | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
23
|
+
static withSpan<T>(source: string, filteringContextOrCallback: IOInsights.FilteringContext | IOInsights.WithSpanCallback<T>, propagationInfoOrCallback?: IOInsights.PropagationInfo | IOInsights.PropagationInfoCarrier | false | IOInsights.WithSpanCallback<T> | null, options?: IOInsights.WithSpanOptions | null, callback?: IOInsights.WithSpanCallback<T>): T;
|
|
24
|
+
static isAsyncFunction(value: any): boolean;
|
|
25
|
+
static withSpans<T>(tracingMap: {
|
|
26
|
+
[propertyName in keyof Partial<T>]: ({
|
|
27
|
+
source: string;
|
|
28
|
+
decoratorOptions?: IOInsights.WithSpanDecoratorOptions;
|
|
29
|
+
} | string);
|
|
30
|
+
}, objectToTrace: T): T;
|
|
31
|
+
}
|
|
32
|
+
export declare const withSpan: typeof Traces.withSpan;
|
package/dist/traces/traces.js
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
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.withSpan = void 0;
|
|
16
|
-
const otelUtils_1 = require("../utils/otelUtils");
|
|
17
|
-
const nullTracesManager_1 = require("./nullTracesManager");
|
|
18
|
-
const nullTracingState_1 = __importDefault(require("./nullTracingState"));
|
|
19
|
-
/**
|
|
20
|
-
* Null-safe singleton class that can be invoked even if you haven't initialized
|
|
21
|
-
* the library (yet?), or if you don't have access to the current manager instance.
|
|
22
|
-
*/
|
|
23
|
-
class Traces {
|
|
24
|
-
static get instance() {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
if ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ioInsightsInternals) === null || _a === void 0 ? void 0 : _a.traces) {
|
|
27
|
-
return (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ioInsightsInternals) === null || _b === void 0 ? void 0 : _b.traces;
|
|
28
|
-
}
|
|
29
|
-
if (!Traces._instance) {
|
|
30
|
-
Traces._instance = new nullTracesManager_1.NullTracesManager(undefined, undefined, undefined);
|
|
31
|
-
}
|
|
32
|
-
return Traces._instance;
|
|
33
|
-
}
|
|
34
|
-
static set instance(value) {
|
|
35
|
-
Traces._instance = value;
|
|
36
|
-
}
|
|
37
|
-
static get currentTracingState() {
|
|
38
|
-
var _a;
|
|
39
|
-
return ((_a = Traces.instance) === null || _a === void 0 ? void 0 : _a.currentTracingState) || new nullTracingState_1.default("unknown", null, true);
|
|
40
|
-
}
|
|
41
|
-
static set currentTracingState(value) {
|
|
42
|
-
if (Traces.instance) {
|
|
43
|
-
Traces.instance.currentTracingState = value;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
static removePropagationInfo(propagationInfoCarrier) {
|
|
47
|
-
Traces.extractPropagationInfo(propagationInfoCarrier, true);
|
|
48
|
-
return propagationInfoCarrier;
|
|
49
|
-
}
|
|
50
|
-
static extractPropagationInfo(propagationInfoCarrier, deleteProperty) {
|
|
51
|
-
if (propagationInfoCarrier === null || propagationInfoCarrier === void 0 ? void 0 : propagationInfoCarrier.traceparent) {
|
|
52
|
-
return propagationInfoCarrier;
|
|
53
|
-
}
|
|
54
|
-
const nestedPropagationInfo = propagationInfoCarrier === null || propagationInfoCarrier === void 0 ? void 0 : propagationInfoCarrier.__interopIOTracePropagationInfo;
|
|
55
|
-
if (nestedPropagationInfo) {
|
|
56
|
-
if (deleteProperty === true) {
|
|
57
|
-
delete propagationInfoCarrier.__interopIOTracePropagationInfo;
|
|
58
|
-
}
|
|
59
|
-
return nestedPropagationInfo;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
return Traces.instance.withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
return Traces.instance.withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
static withSpan(source, filteringContextOrDecoratorOptionsOrCallback, propagationInfoOrCallback, optionsOrCallback, callback) {
|
|
76
|
-
// decorator or wrapping a function
|
|
77
|
-
if (!(filteringContextOrDecoratorOptionsOrCallback instanceof Function) &&
|
|
78
|
-
(!filteringContextOrDecoratorOptionsOrCallback ||
|
|
79
|
-
filteringContextOrDecoratorOptionsOrCallback.argMapping ||
|
|
80
|
-
filteringContextOrDecoratorOptionsOrCallback.thisMapping ||
|
|
81
|
-
filteringContextOrDecoratorOptionsOrCallback.defaults) &&
|
|
82
|
-
!propagationInfoOrCallback &&
|
|
83
|
-
!optionsOrCallback &&
|
|
84
|
-
!callback) {
|
|
85
|
-
return function (target, propertyKey, descriptor) {
|
|
86
|
-
let originalFn;
|
|
87
|
-
if (descriptor) {
|
|
88
|
-
// decorator
|
|
89
|
-
originalFn = descriptor.value;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
// wrapping function directly
|
|
93
|
-
originalFn = target;
|
|
94
|
-
}
|
|
95
|
-
let tracedFunction = function (...args) {
|
|
96
|
-
return Traces.withSpan(source, filteringContextOrDecoratorOptionsOrCallback
|
|
97
|
-
? (0, otelUtils_1.extractFilteringContextFromArgs)(filteringContextOrDecoratorOptionsOrCallback, args, this)
|
|
98
|
-
: {}, null, filteringContextOrDecoratorOptionsOrCallback, () => {
|
|
99
|
-
return originalFn.apply(this, args);
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
if (Traces.isAsyncFunction(originalFn)) {
|
|
103
|
-
// fix for interception API using toString() to check for async functions
|
|
104
|
-
const inner = tracedFunction;
|
|
105
|
-
tracedFunction = function __insightsAsyncTracedFunction(...args) {
|
|
106
|
-
return inner.apply(this, args);
|
|
107
|
-
};
|
|
108
|
-
Object.defineProperty(tracedFunction, Symbol.toStringTag, {
|
|
109
|
-
value: "AsyncFunction",
|
|
110
|
-
configurable: true,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
if (descriptor) {
|
|
114
|
-
descriptor.value = tracedFunction;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return tracedFunction;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return Traces.instance.withSpan(source, filteringContextOrDecoratorOptionsOrCallback, propagationInfoOrCallback, optionsOrCallback, callback);
|
|
122
|
-
}
|
|
123
|
-
static isAsyncFunction(value) {
|
|
124
|
-
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
125
|
-
}
|
|
126
|
-
static withSpans(tracingMap, objectToTrace) {
|
|
127
|
-
for (const tracingMapPropertyName in tracingMap) {
|
|
128
|
-
if (typeof objectToTrace[tracingMapPropertyName] === "function") {
|
|
129
|
-
const originalMethod = objectToTrace[tracingMapPropertyName];
|
|
130
|
-
const tracingMapPropertyValue = tracingMap[tracingMapPropertyName];
|
|
131
|
-
if (!tracingMapPropertyValue) {
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
let wrapperMaker;
|
|
135
|
-
if (typeof tracingMapPropertyValue === "string") {
|
|
136
|
-
wrapperMaker = Traces.withSpan(tracingMapPropertyValue);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
wrapperMaker = Traces.withSpan(tracingMapPropertyValue.source, tracingMapPropertyValue.decoratorOptions);
|
|
140
|
-
}
|
|
141
|
-
objectToTrace[tracingMapPropertyName] = wrapperMaker(originalMethod);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return objectToTrace;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
exports.default = Traces;
|
|
148
|
-
exports.withSpan = Traces.withSpan;
|
|
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.withSpan = void 0;
|
|
16
|
+
const otelUtils_1 = require("../utils/otelUtils");
|
|
17
|
+
const nullTracesManager_1 = require("./nullTracesManager");
|
|
18
|
+
const nullTracingState_1 = __importDefault(require("./nullTracingState"));
|
|
19
|
+
/**
|
|
20
|
+
* Null-safe singleton class that can be invoked even if you haven't initialized
|
|
21
|
+
* the library (yet?), or if you don't have access to the current manager instance.
|
|
22
|
+
*/
|
|
23
|
+
class Traces {
|
|
24
|
+
static get instance() {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
if ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ioInsightsInternals) === null || _a === void 0 ? void 0 : _a.traces) {
|
|
27
|
+
return (_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.ioInsightsInternals) === null || _b === void 0 ? void 0 : _b.traces;
|
|
28
|
+
}
|
|
29
|
+
if (!Traces._instance) {
|
|
30
|
+
Traces._instance = new nullTracesManager_1.NullTracesManager(undefined, undefined, undefined);
|
|
31
|
+
}
|
|
32
|
+
return Traces._instance;
|
|
33
|
+
}
|
|
34
|
+
static set instance(value) {
|
|
35
|
+
Traces._instance = value;
|
|
36
|
+
}
|
|
37
|
+
static get currentTracingState() {
|
|
38
|
+
var _a;
|
|
39
|
+
return ((_a = Traces.instance) === null || _a === void 0 ? void 0 : _a.currentTracingState) || new nullTracingState_1.default("unknown", null, true);
|
|
40
|
+
}
|
|
41
|
+
static set currentTracingState(value) {
|
|
42
|
+
if (Traces.instance) {
|
|
43
|
+
Traces.instance.currentTracingState = value;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static removePropagationInfo(propagationInfoCarrier) {
|
|
47
|
+
Traces.extractPropagationInfo(propagationInfoCarrier, true);
|
|
48
|
+
return propagationInfoCarrier;
|
|
49
|
+
}
|
|
50
|
+
static extractPropagationInfo(propagationInfoCarrier, deleteProperty) {
|
|
51
|
+
if (propagationInfoCarrier === null || propagationInfoCarrier === void 0 ? void 0 : propagationInfoCarrier.traceparent) {
|
|
52
|
+
return propagationInfoCarrier;
|
|
53
|
+
}
|
|
54
|
+
const nestedPropagationInfo = propagationInfoCarrier === null || propagationInfoCarrier === void 0 ? void 0 : propagationInfoCarrier.__interopIOTracePropagationInfo;
|
|
55
|
+
if (nestedPropagationInfo) {
|
|
56
|
+
if (deleteProperty === true) {
|
|
57
|
+
delete propagationInfoCarrier.__interopIOTracePropagationInfo;
|
|
58
|
+
}
|
|
59
|
+
return nestedPropagationInfo;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return Traces.instance.withSequenceSpanEx(source, traceName, filteringContextOrCallback, optionsOrCallback, callback);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
return Traces.instance.withSequenceSpan(source, filteringContextOrCallback, optionsOrCallback, callback);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static withSpan(source, filteringContextOrDecoratorOptionsOrCallback, propagationInfoOrCallback, optionsOrCallback, callback) {
|
|
76
|
+
// decorator or wrapping a function
|
|
77
|
+
if (!(filteringContextOrDecoratorOptionsOrCallback instanceof Function) &&
|
|
78
|
+
(!filteringContextOrDecoratorOptionsOrCallback ||
|
|
79
|
+
filteringContextOrDecoratorOptionsOrCallback.argMapping ||
|
|
80
|
+
filteringContextOrDecoratorOptionsOrCallback.thisMapping ||
|
|
81
|
+
filteringContextOrDecoratorOptionsOrCallback.defaults) &&
|
|
82
|
+
!propagationInfoOrCallback &&
|
|
83
|
+
!optionsOrCallback &&
|
|
84
|
+
!callback) {
|
|
85
|
+
return function (target, propertyKey, descriptor) {
|
|
86
|
+
let originalFn;
|
|
87
|
+
if (descriptor) {
|
|
88
|
+
// decorator
|
|
89
|
+
originalFn = descriptor.value;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// wrapping function directly
|
|
93
|
+
originalFn = target;
|
|
94
|
+
}
|
|
95
|
+
let tracedFunction = function (...args) {
|
|
96
|
+
return Traces.withSpan(source, filteringContextOrDecoratorOptionsOrCallback
|
|
97
|
+
? (0, otelUtils_1.extractFilteringContextFromArgs)(filteringContextOrDecoratorOptionsOrCallback, args, this)
|
|
98
|
+
: {}, null, filteringContextOrDecoratorOptionsOrCallback, () => {
|
|
99
|
+
return originalFn.apply(this, args);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
if (Traces.isAsyncFunction(originalFn)) {
|
|
103
|
+
// fix for interception API using toString() to check for async functions
|
|
104
|
+
const inner = tracedFunction;
|
|
105
|
+
tracedFunction = function __insightsAsyncTracedFunction(...args) {
|
|
106
|
+
return inner.apply(this, args);
|
|
107
|
+
};
|
|
108
|
+
Object.defineProperty(tracedFunction, Symbol.toStringTag, {
|
|
109
|
+
value: "AsyncFunction",
|
|
110
|
+
configurable: true,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (descriptor) {
|
|
114
|
+
descriptor.value = tracedFunction;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return tracedFunction;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return Traces.instance.withSpan(source, filteringContextOrDecoratorOptionsOrCallback, propagationInfoOrCallback, optionsOrCallback, callback);
|
|
122
|
+
}
|
|
123
|
+
static isAsyncFunction(value) {
|
|
124
|
+
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
125
|
+
}
|
|
126
|
+
static withSpans(tracingMap, objectToTrace) {
|
|
127
|
+
for (const tracingMapPropertyName in tracingMap) {
|
|
128
|
+
if (typeof objectToTrace[tracingMapPropertyName] === "function") {
|
|
129
|
+
const originalMethod = objectToTrace[tracingMapPropertyName];
|
|
130
|
+
const tracingMapPropertyValue = tracingMap[tracingMapPropertyName];
|
|
131
|
+
if (!tracingMapPropertyValue) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
let wrapperMaker;
|
|
135
|
+
if (typeof tracingMapPropertyValue === "string") {
|
|
136
|
+
wrapperMaker = Traces.withSpan(tracingMapPropertyValue);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
wrapperMaker = Traces.withSpan(tracingMapPropertyValue.source, tracingMapPropertyValue.decoratorOptions);
|
|
140
|
+
}
|
|
141
|
+
objectToTrace[tracingMapPropertyName] = wrapperMaker(originalMethod);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return objectToTrace;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.default = Traces;
|
|
148
|
+
exports.withSpan = Traces.withSpan;
|
|
149
149
|
//# sourceMappingURL=traces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traces.js","sourceRoot":"","sources":["../../src/traces/traces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,kDAAqE;AACrE,2DAAwD;AACxD,0EAAkD;AAIlD;;;GAGG;AACH,MAAqB,MAAM;IAElB,MAAM,KAAK,QAAQ;;QACxB,IAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,mBAAmB,0CAAE,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"traces.js","sourceRoot":"","sources":["../../src/traces/traces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,kDAAqE;AACrE,2DAAwD;AACxD,0EAAkD;AAIlD;;;GAGG;AACH,MAAqB,MAAM;IAElB,MAAM,KAAK,QAAQ;;QACxB,IAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,mBAAmB,0CAAE,MAAM,EAAE,CAAC;YAC5C,OAAO,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,mBAAmB,0CAAE,MAAM,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACtB,MAAM,CAAC,SAAS,GAAG,IAAI,qCAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;IACM,MAAM,KAAK,QAAQ,CAAC,KAA+B;QACxD,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEM,MA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,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;gBAC3G,CAAC;gBACD,aAAa,CAAC,sBAAsB,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAjSD,yBAiSC;AAEY,QAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isPlainObject(o: any): boolean;
|
|
1
|
+
export declare function isPlainObject(o: any): boolean;
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// https://github.com/jonschlinkert/is-plain-object/blob/master/is-plain-object.js
|
|
3
|
-
// cf204a3
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.isPlainObject =
|
|
6
|
-
/*!
|
|
7
|
-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
-
* Released under the MIT License.
|
|
11
|
-
*/
|
|
12
|
-
function isObject(o) {
|
|
13
|
-
return Object.prototype.toString.call(o) === '[object Object]';
|
|
14
|
-
}
|
|
15
|
-
function isPlainObject(o) {
|
|
16
|
-
let ctor;
|
|
17
|
-
let prot;
|
|
18
|
-
if (isObject(o) === false)
|
|
19
|
-
return false;
|
|
20
|
-
// If has modified constructor
|
|
21
|
-
ctor = o.constructor;
|
|
22
|
-
if (ctor === undefined)
|
|
23
|
-
return true;
|
|
24
|
-
// If has modified prototype
|
|
25
|
-
prot = ctor.prototype;
|
|
26
|
-
if (isObject(prot) === false)
|
|
27
|
-
return false;
|
|
28
|
-
// If constructor does not have an Object-specific method
|
|
29
|
-
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
// Most likely a plain Object
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
;
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://github.com/jonschlinkert/is-plain-object/blob/master/is-plain-object.js
|
|
3
|
+
// cf204a3
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isPlainObject = isPlainObject;
|
|
6
|
+
/*!
|
|
7
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/
|
|
12
|
+
function isObject(o) {
|
|
13
|
+
return Object.prototype.toString.call(o) === '[object Object]';
|
|
14
|
+
}
|
|
15
|
+
function isPlainObject(o) {
|
|
16
|
+
let ctor;
|
|
17
|
+
let prot;
|
|
18
|
+
if (isObject(o) === false)
|
|
19
|
+
return false;
|
|
20
|
+
// If has modified constructor
|
|
21
|
+
ctor = o.constructor;
|
|
22
|
+
if (ctor === undefined)
|
|
23
|
+
return true;
|
|
24
|
+
// If has modified prototype
|
|
25
|
+
prot = ctor.prototype;
|
|
26
|
+
if (isObject(prot) === false)
|
|
27
|
+
return false;
|
|
28
|
+
// If constructor does not have an Object-specific method
|
|
29
|
+
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// Most likely a plain Object
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
;
|
|
37
36
|
//# sourceMappingURL=is-plain-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../../src/utils/is-plain-object.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAClF,UAAU
|
|
1
|
+
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../../src/utils/is-plain-object.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAClF,UAAU;;AAaV,sCAqBC;AAhCD;;;;;GAKG;AAEH,SAAS,QAAQ,CAAC,CAAM;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,iBAAiB,CAAC;AACjE,CAAC;AAED,SAAgB,aAAa,CAAC,CAAM;IAClC,IAAI,IAAI,CAAC;IACT,IAAI,IAAI,CAAC;IAET,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAExC,8BAA8B;IAC9B,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC;IACrB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEpC,4BAA4B;IAC5B,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IACtB,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAE3C,yDAAyD;IACzD,IAAI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,KAAK,KAAK,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,6BAA6B;IAC7B,OAAO,IAAI,CAAC;AACd,CAAC;AAAA,CAAC"}
|
package/dist/utils/isNode.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isNode(): boolean;
|
|
1
|
+
export declare function isNode(): boolean;
|