@interopio/otel 0.0.13 → 0.0.16
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 +1 -2
- package/dist/builder.js +17 -15
- package/dist/builder.js.map +1 -1
- package/dist/container.d.ts +2 -1
- package/dist/container.js +3 -6
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/log4jsWrapper.d.ts +7 -1
- package/dist/logger/log4jsWrapper.js +7 -1
- package/dist/logger/log4jsWrapper.js.map +1 -1
- package/dist/metrics/builder.js +6 -2
- package/dist/metrics/builder.js.map +1 -1
- package/dist/metrics/factory/builder.d.ts +1 -0
- package/dist/metrics/factory/builder.js +10 -0
- package/dist/metrics/factory/builder.js.map +1 -1
- package/dist/metrics/metrics/application/duration.d.ts +23 -3
- package/dist/metrics/metrics/application/duration.js +83 -2
- package/dist/metrics/metrics/application/duration.js.map +1 -1
- package/dist/metrics/metrics/application/durationSoft.d.ts +4 -0
- package/dist/metrics/metrics/application/durationSoft.js +34 -0
- package/dist/metrics/metrics/application/durationSoft.js.map +1 -0
- package/dist/metrics/metrics/base/types.d.ts +1 -1
- package/dist/traces/builder.d.ts +11 -1
- package/dist/traces/builder.js +27 -6
- package/dist/traces/builder.js.map +1 -1
- package/dist/traces/ioInsightsSampler.d.ts +3 -2
- package/dist/traces/ioInsightsSampler.js +14 -8
- package/dist/traces/ioInsightsSampler.js.map +1 -1
- package/dist/traces/manager.d.ts +9 -7
- package/dist/traces/manager.js +113 -63
- package/dist/traces/manager.js.map +1 -1
- package/dist/traces/nullTracesManager.d.ts +8 -3
- package/dist/traces/nullTracesManager.js +47 -12
- package/dist/traces/nullTracesManager.js.map +1 -1
- package/dist/traces/nullTracingState.d.ts +21 -0
- package/dist/traces/nullTracingState.js +57 -0
- package/dist/traces/nullTracingState.js.map +1 -0
- package/dist/traces/traces.d.ts +21 -0
- package/dist/traces/traces.js +65 -0
- package/dist/traces/traces.js.map +1 -0
- package/dist/traces/tracingState.d.ts +8 -8
- package/dist/traces/tracingState.js +18 -31
- package/dist/traces/tracingState.js.map +1 -1
- package/dist/traces/types.d.ts +238 -26
- package/dist/traces/types.js.map +1 -1
- package/dist/traces/utils/index.d.ts +16 -8
- package/dist/traces/utils/index.js +123 -35
- package/dist/traces/utils/index.js.map +1 -1
- package/dist/types.d.ts +41 -3
- package/dist/validation/metrics/application/duration.d.ts +2 -2
- package/dist/validation/metrics/application/duration.js.map +1 -1
- package/dist/validation/traces/filter.js +5 -3
- package/dist/validation/traces/filter.js.map +1 -1
- package/dist/validation/traces/withSpan.d.ts +1 -1
- package/dist/validation/traces/withSpan.js.map +1 -1
- package/package.json +5 -4
- package/dist/metrics/metrics/application/durationBase.d.ts +0 -22
- package/dist/metrics/metrics/application/durationBase.js +0 -97
- package/dist/metrics/metrics/application/durationBase.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NullTracingState = void 0;
|
|
4
|
+
const api_1 = require("@opentelemetry/api");
|
|
5
|
+
class NullTracingState {
|
|
6
|
+
constructor(source, propagationInfo) {
|
|
7
|
+
this.source = source;
|
|
8
|
+
this.propagationInfo = propagationInfo;
|
|
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
|
+
setStatus(status) {
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
addEvent(name, attributesOrStartTime, startTime) {
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
recordException(exception, time) { }
|
|
30
|
+
isRecording() {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
updateName(name) {
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
spanContext() {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
addData(level, data) {
|
|
40
|
+
return Promise.resolve();
|
|
41
|
+
}
|
|
42
|
+
getPropagationInfo() {
|
|
43
|
+
if (this.propagationInfo) {
|
|
44
|
+
return this.propagationInfo;
|
|
45
|
+
}
|
|
46
|
+
const propagationInfo = {};
|
|
47
|
+
api_1.propagation.inject(api_1.context.active(), propagationInfo);
|
|
48
|
+
return propagationInfo;
|
|
49
|
+
}
|
|
50
|
+
injectPropagationInfo(carrier) {
|
|
51
|
+
if (this.propagationInfo) {
|
|
52
|
+
carrier.__interopIOTracePropagationInfo = this.propagationInfo;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.NullTracingState = NullTracingState;
|
|
57
|
+
//# sourceMappingURL=nullTracingState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullTracingState.js","sourceRoot":"","sources":["../../src/traces/nullTracingState.ts"],"names":[],"mappings":";;;AASA,4CAO4B;AAE5B,MAAa,gBAAgB;IAC3B,YAAmB,MAAc,EAAU,eAAuC;QAA/D,WAAM,GAAN,MAAM,CAAQ;QAAU,oBAAe,GAAf,eAAe,CAAwB;QAElF,UAAK,GAAG,KAAc,CAAC;IAF8D,CAAC;IAI/E,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;IACM,SAAS,CAAC,MAAkB;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACM,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,KAAyC,EAAE,IAAmB;QAC3E,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEM,kBAAkB;QACvB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,OAAO,IAAI,CAAC,eAAe,CAAC;SAC7B;QACD,MAAM,eAAe,GAAG,EAAG,CAAC;QAC5B,iBAAW,CAAC,MAAM,CAAC,aAAO,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC;QACtD,OAAO,eAAe,CAAC;IACzB,CAAC;IAEM,qBAAqB,CAAC,OAA+B;QAC1D,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,OAAO,CAAC,+BAA+B,GAAG,IAAI,CAAC,eAAe,CAAC;SAChE;IACH,CAAC;CACF;AA1DD,4CA0DC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PropagationInfo, PropagationInfoCarrier, TracesManager, TracingContext, TracingState, WithSpanCallback } from "./types";
|
|
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(): TracesManager;
|
|
9
|
+
static set instance(value: TracesManager);
|
|
10
|
+
private static _currentTracingState;
|
|
11
|
+
static get currentTracingState(): TracingState;
|
|
12
|
+
static set currentTracingState(value: TracingState | null);
|
|
13
|
+
static extractTracingPropagationInfo(propagationInfoCarrier: PropagationInfo | PropagationInfoCarrier, deleteProperty?: boolean | undefined): PropagationInfo | null;
|
|
14
|
+
static withSpan(root: string, argMapping?: {
|
|
15
|
+
argMapping: Record<string, string>;
|
|
16
|
+
}): any;
|
|
17
|
+
static withSpan<T>(source: string, callback: WithSpanCallback<T>): Promise<T>;
|
|
18
|
+
static withSpan<T>(source: string, tracingContext: TracingContext | any, callback: WithSpanCallback<T>): Promise<T>;
|
|
19
|
+
static withSpan<T>(source: string, tracingContextOrCallback: TracingContext | WithSpanCallback<T> | any, propagationInfoOrCallback?: PropagationInfo | PropagationInfoCarrier | WithSpanCallback<T>, callback?: WithSpanCallback<T>): Promise<T>;
|
|
20
|
+
}
|
|
21
|
+
export declare const withSpan: typeof Traces.withSpan;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withSpan = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
+
// TODO: fix types
|
|
6
|
+
const nullTracesManager_1 = require("./nullTracesManager");
|
|
7
|
+
const nullTracingState_1 = require("./nullTracingState");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
/**
|
|
10
|
+
* Null-safe singleton class that can be invoked even if you haven't initialized
|
|
11
|
+
* the library (yet?), or if you don't have access to the current manager instance.
|
|
12
|
+
*/
|
|
13
|
+
class Traces {
|
|
14
|
+
static get instance() {
|
|
15
|
+
return Traces._instance;
|
|
16
|
+
}
|
|
17
|
+
static set instance(value) {
|
|
18
|
+
Traces._instance = value;
|
|
19
|
+
}
|
|
20
|
+
static get currentTracingState() {
|
|
21
|
+
return Traces._currentTracingState || new nullTracingState_1.NullTracingState("unknown", null);
|
|
22
|
+
}
|
|
23
|
+
static set currentTracingState(value) {
|
|
24
|
+
Traces._currentTracingState = value;
|
|
25
|
+
}
|
|
26
|
+
static extractTracingPropagationInfo(propagationInfoCarrier, deleteProperty) {
|
|
27
|
+
if (propagationInfoCarrier.traceparent) {
|
|
28
|
+
return propagationInfoCarrier;
|
|
29
|
+
}
|
|
30
|
+
const nestedPropagationInfo = propagationInfoCarrier
|
|
31
|
+
.__interopIOTracePropagationInfo;
|
|
32
|
+
if (nestedPropagationInfo) {
|
|
33
|
+
if (deleteProperty === true) {
|
|
34
|
+
delete propagationInfoCarrier.__interopIOTracePropagationInfo;
|
|
35
|
+
}
|
|
36
|
+
return nestedPropagationInfo;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static withSpan(source, tracingContextOrCallback, propagationInfoOrCallback, callback) {
|
|
43
|
+
// decorator
|
|
44
|
+
if ((!tracingContextOrCallback || tracingContextOrCallback["argMapping"]) &&
|
|
45
|
+
!propagationInfoOrCallback &&
|
|
46
|
+
!callback) {
|
|
47
|
+
return function (target, propertyKey, descriptor) {
|
|
48
|
+
const originalFn = descriptor.value;
|
|
49
|
+
descriptor.value = function (...args) {
|
|
50
|
+
return Traces.withSpan(source + "." + propertyKey, tracingContextOrCallback
|
|
51
|
+
? Object.assign({}, (0, utils_1.extractTracingContextFromArgs)(tracingContextOrCallback, args)) : {
|
|
52
|
+
args,
|
|
53
|
+
}, () => {
|
|
54
|
+
return originalFn.apply(this, args);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return Traces.instance.withSpan(source, tracingContextOrCallback, propagationInfoOrCallback, callback);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = Traces;
|
|
63
|
+
Traces._instance = new nullTracesManager_1.NullTracesManager();
|
|
64
|
+
exports.withSpan = Traces.withSpan;
|
|
65
|
+
//# sourceMappingURL=traces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traces.js","sourceRoot":"","sources":["../../src/traces/traces.ts"],"names":[],"mappings":";;;AAAA,uDAA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MAAM,CAAC,QAAQ,CACpB,MAAM,GAAG,GAAG,GAAG,WAAW,EAC1B,wBAAwB;wBACtB,CAAC,mBAAM,IAAA,qCAA6B,EAAC,wBAAwB,EAAE,IAAI,CAAC,EACpE,CAAC,CAAC;wBACE,IAAI;qBACL,EACL,GAAG,EAAE;wBACH,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBACtC,CAAC,CACF,CAAC;gBACJ,CAAC,CAAC;YACJ,CAAC,CAAC;SACH;QAED,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAC7B,MAAM,EACN,wBAA+B,EAC/B,yBAAgC,EAChC,QAAe,CAChB,CAAC;IACJ,CAAC;;AAxFH,yBAyFC;AAvFgB,gBAAS,GAAkB,IAAI,qCAAiB,EAAE,CAAC;AAyFvD,QAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Logger } from "../logger/types";
|
|
3
2
|
import { AttributeData, PropagationInfo, PropagationInfoCarrier, TracingState as ITracingState, Verbosity } from "./types";
|
|
4
|
-
import { Span, SpanContext, Exception, TimeInput, Attributes, SpanStatus } from "@opentelemetry/api";
|
|
3
|
+
import { Span, SpanContext, Exception, TimeInput, Attributes, SpanStatus, SpanStatusCode } from "@opentelemetry/api";
|
|
5
4
|
export declare class TracingState implements ITracingState {
|
|
6
5
|
source: string;
|
|
7
6
|
level: keyof typeof Verbosity;
|
|
8
7
|
span: Span;
|
|
9
8
|
private logger;
|
|
10
9
|
private version;
|
|
11
|
-
|
|
10
|
+
SpanStatusCode: typeof SpanStatusCode;
|
|
11
|
+
currentSpanStatus: SpanStatus;
|
|
12
|
+
constructor(source: string, level: keyof typeof Verbosity, span: Span, logger: Logger, version: string);
|
|
12
13
|
endSpan(timedOut?: boolean): Promise<void>;
|
|
13
14
|
get enabled(): boolean;
|
|
14
15
|
private hasEnded;
|
|
15
|
-
private _timeoutId;
|
|
16
|
-
get timeoutId(): NodeJS.Timeout | undefined;
|
|
17
16
|
private spanContextField;
|
|
18
17
|
get id(): string;
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
get traceId(): string;
|
|
19
|
+
setStatus(status: SpanStatus): this;
|
|
20
|
+
addEvent(name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput): this;
|
|
21
21
|
recordException(exception: Exception, time?: TimeInput): void;
|
|
22
22
|
isRecording(): boolean;
|
|
23
|
-
updateName(name: string):
|
|
23
|
+
updateName(name: string): this;
|
|
24
24
|
spanContext(): SpanContext;
|
|
25
25
|
addData(level: Verbosity | keyof typeof Verbosity, data: AttributeData): Promise<void>;
|
|
26
26
|
getPropagationInfo(): PropagationInfo;
|
|
@@ -5,59 +5,45 @@ const types_1 = require("./types");
|
|
|
5
5
|
const api_1 = require("@opentelemetry/api");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
7
|
class TracingState {
|
|
8
|
-
constructor(source, level, span, logger, version
|
|
8
|
+
constructor(source, level, span, logger, version) {
|
|
9
9
|
this.source = source;
|
|
10
10
|
this.level = level;
|
|
11
11
|
this.span = span;
|
|
12
12
|
this.logger = logger;
|
|
13
13
|
this.version = version;
|
|
14
|
+
this.SpanStatusCode = api_1.SpanStatusCode;
|
|
15
|
+
this.currentSpanStatus = { code: api_1.SpanStatusCode.UNSET };
|
|
14
16
|
this.hasEnded = false;
|
|
15
17
|
this.spanContextField = span.spanContext();
|
|
16
|
-
if (spanTimeoutMs && spanTimeoutMs >= 0) {
|
|
17
|
-
this._timeoutId = setTimeout(() => {
|
|
18
|
-
this.endSpan(true);
|
|
19
|
-
}, spanTimeoutMs);
|
|
20
|
-
}
|
|
21
18
|
}
|
|
22
19
|
endSpan(timedOut) {
|
|
23
|
-
var _a
|
|
20
|
+
var _a;
|
|
24
21
|
if (this.hasEnded) {
|
|
25
22
|
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug(`Span ended more than once: ${this.source}`);
|
|
26
23
|
}
|
|
27
24
|
else {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (timedOut) {
|
|
31
|
-
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.debug(`Span timed out and was automatically ended: ${this.source}`);
|
|
32
|
-
this.span.setStatus({
|
|
33
|
-
code: api_1.SpanStatusCode.ERROR,
|
|
34
|
-
message: "Span timed out",
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
clearTimeout(this.timeoutId);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
finally {
|
|
42
|
-
this.span.end();
|
|
43
|
-
}
|
|
25
|
+
this.hasEnded = true;
|
|
26
|
+
this.span.end();
|
|
44
27
|
}
|
|
45
28
|
return Promise.resolve();
|
|
46
29
|
}
|
|
47
30
|
get enabled() {
|
|
48
31
|
return true;
|
|
49
32
|
}
|
|
50
|
-
get timeoutId() {
|
|
51
|
-
return this._timeoutId;
|
|
52
|
-
}
|
|
53
33
|
get id() {
|
|
54
34
|
return this.spanContextField.spanId;
|
|
55
35
|
}
|
|
36
|
+
get traceId() {
|
|
37
|
+
return this.spanContextField.traceId;
|
|
38
|
+
}
|
|
56
39
|
setStatus(status) {
|
|
57
|
-
|
|
40
|
+
this.currentSpanStatus = Object.assign({}, status);
|
|
41
|
+
this.span.setStatus.call(this.span, status);
|
|
42
|
+
return this;
|
|
58
43
|
}
|
|
59
44
|
addEvent(name, attributesOrStartTime, startTime) {
|
|
60
|
-
|
|
45
|
+
this.span.addEvent.call(this.span, name, attributesOrStartTime, startTime);
|
|
46
|
+
return this;
|
|
61
47
|
}
|
|
62
48
|
recordException(exception, time) {
|
|
63
49
|
this.span.recordException.call(this.span, exception, time);
|
|
@@ -66,7 +52,8 @@ class TracingState {
|
|
|
66
52
|
return this.span.isRecording.call(this.span);
|
|
67
53
|
}
|
|
68
54
|
updateName(name) {
|
|
69
|
-
|
|
55
|
+
this.span.updateName.call(this.span, name);
|
|
56
|
+
return this;
|
|
70
57
|
}
|
|
71
58
|
spanContext() {
|
|
72
59
|
return this.span.spanContext.call(this.span);
|
|
@@ -91,8 +78,8 @@ class TracingState {
|
|
|
91
78
|
// TODO vnikolov: check if this needs to be populated
|
|
92
79
|
tracestate: this.spanContextField.traceState && String(this.spanContextField.traceState),
|
|
93
80
|
};
|
|
94
|
-
// this is a NOOP because we're using base SDK
|
|
95
|
-
|
|
81
|
+
// // this is a NOOP because we're using base SDK
|
|
82
|
+
// propagation.inject(context.active(), propagationInfo);
|
|
96
83
|
return propagationInfo;
|
|
97
84
|
}
|
|
98
85
|
injectPropagationInfo(carrier) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracingState.js","sourceRoot":"","sources":["../../src/traces/tracingState.ts"],"names":[],"mappings":";;;AAGA,mCAMiB;AACjB,4CAU4B;AAC5B,mCAA8C;AAE9C,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"tracingState.js","sourceRoot":"","sources":["../../src/traces/tracingState.ts"],"names":[],"mappings":";;;AAGA,mCAMiB;AACjB,4CAU4B;AAC5B,mCAA8C;AAE9C,MAAa,YAAY;IAGvB,YACS,MAAc,EACd,KAA6B,EAC7B,IAAU,EACT,MAAc,EACd,OAAe;QAJhB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAwB;QAC7B,SAAI,GAAJ,IAAI,CAAM;QACT,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAQ;QAPlB,mBAAc,GAAG,oBAAc,CAAC;QAChC,sBAAiB,GAAe,EAAE,IAAI,EAAE,oBAAc,CAAC,KAAK,EAAE,CAAC;QAyB9D,aAAQ,GAAG,KAAK,CAAC;QAjBvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAEM,OAAO,CAAC,QAAkB;;QAC/B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAA,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api";
|
|
1
|
+
import { Attributes, Span, SpanStatus, SpanStatusCode, TimeInput, TracerProvider } from "@opentelemetry/api";
|
|
3
2
|
import { Logger } from "../logger/types";
|
|
4
3
|
import { Manager } from "../types";
|
|
4
|
+
import { OTLPExporterNodeConfigBase } from "@opentelemetry/otlp-exporter-base";
|
|
5
|
+
import { Sampler, SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
5
6
|
export interface TracesManager extends Manager<TracesSettings> {
|
|
6
|
-
|
|
7
|
-
withSpan(source: string, callback: WithSpanCallback): Promise<
|
|
8
|
-
withSpan(source: string, tracingContext: TracingContext, callback: WithSpanCallback): Promise<
|
|
9
|
-
withSpan(source: string, tracingContext: TracingContext, propagationInfo: PropagationInfo | PropagationInfoCarrier, callback: WithSpanCallback): Promise<ReturnType<WithSpanCallback>>;
|
|
7
|
+
withSpan<T>(source: string, callback: WithSpanCallback<T>): Promise<T>;
|
|
8
|
+
withSpan<T>(source: string, tracingContext: TracingContext, callback: WithSpanCallback<T>): Promise<T>;
|
|
9
|
+
withSpan<T>(source: string, tracingContext: TracingContext, propagationInfo: PropagationInfo | PropagationInfoCarrier, callback: WithSpanCallback<T>): Promise<T>;
|
|
10
10
|
}
|
|
11
|
-
export type WithSpanCallback = (tracingState: TracingState) =>
|
|
11
|
+
export type WithSpanCallback<T> = (tracingState: TracingState) => T | Promise<T>;
|
|
12
12
|
export interface PropagationInfo {
|
|
13
13
|
traceparent?: string;
|
|
14
14
|
tracestate?: string;
|
|
@@ -18,21 +18,22 @@ export interface PropagationInfoCarrier {
|
|
|
18
18
|
}
|
|
19
19
|
export interface TracingState {
|
|
20
20
|
enabled: boolean;
|
|
21
|
+
SpanStatusCode?: typeof SpanStatusCode;
|
|
21
22
|
level: keyof typeof Verbosity;
|
|
22
23
|
addData(level: Verbosity | keyof typeof Verbosity, data: AttributeData): Promise<void>;
|
|
23
24
|
source: string;
|
|
24
25
|
id?: string;
|
|
25
|
-
|
|
26
|
+
traceId?: string;
|
|
26
27
|
endSpan(): Promise<void>;
|
|
27
|
-
span
|
|
28
|
+
span?: Span;
|
|
28
29
|
getPropagationInfo: () => PropagationInfo | null;
|
|
29
30
|
injectPropagationInfo: (carrier: PropagationInfoCarrier & object) => void;
|
|
30
|
-
setStatus?:
|
|
31
|
-
addEvent?:
|
|
31
|
+
setStatus?: (status: SpanStatus) => this;
|
|
32
|
+
addEvent?: (name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput) => this;
|
|
32
33
|
recordException?: Span["recordException"];
|
|
33
34
|
isRecording?: Span["isRecording"];
|
|
34
|
-
updateName?:
|
|
35
|
-
spanContext?: Span["spanContext"];
|
|
35
|
+
updateName?: (name: string) => this;
|
|
36
|
+
spanContext?: Span["spanContext"] | (() => undefined);
|
|
36
37
|
}
|
|
37
38
|
export type AttributeArray = Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
|
38
39
|
export interface AttributeData {
|
|
@@ -42,7 +43,11 @@ export interface TracingContext {
|
|
|
42
43
|
app?: string;
|
|
43
44
|
user?: string;
|
|
44
45
|
serviceName?: string;
|
|
45
|
-
|
|
46
|
+
serviceId?: string;
|
|
47
|
+
platformVersion?: string;
|
|
48
|
+
serviceVersion?: string;
|
|
49
|
+
userId?: string;
|
|
50
|
+
[key: string]: string | number | boolean | undefined;
|
|
46
51
|
}
|
|
47
52
|
export declare enum Verbosity {
|
|
48
53
|
OFF = 0,
|
|
@@ -54,37 +59,244 @@ export declare enum Verbosity {
|
|
|
54
59
|
HIGHEST = 6
|
|
55
60
|
}
|
|
56
61
|
export interface Filter {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Specifies the source string used for matching spans.
|
|
64
|
+
* Spans match only if their source equals this value, or
|
|
65
|
+
* if their source starts with '<source>.' (e.g. my.api.foo
|
|
66
|
+
* starts with my.api).
|
|
67
|
+
*
|
|
68
|
+
* Start string with "#" for case-insensitive regex match.
|
|
69
|
+
*/
|
|
70
|
+
source?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Specifies the context values used for matching spans.
|
|
73
|
+
* Spans match only if all the values in this object match
|
|
74
|
+
* the context values returned by the context getter callback
|
|
75
|
+
* and the filteringContext config property.
|
|
76
|
+
*
|
|
77
|
+
* Start strings with "#" for case-insensitive regex match.
|
|
78
|
+
*/
|
|
79
|
+
context?: {
|
|
61
80
|
[key: string]: string | number | boolean;
|
|
62
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Whether the matched span will be created or will be a no-op.
|
|
84
|
+
*
|
|
85
|
+
* If not specified, see 'TracesDefaultsSettings'.
|
|
86
|
+
*/
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* If filter is disabled, setting this to "true" will stop the propagation
|
|
90
|
+
* of tracing contexts.
|
|
91
|
+
*/
|
|
92
|
+
stopPropagation?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The attribute verbosity level of matched spans.
|
|
95
|
+
*
|
|
96
|
+
* If not specified, see 'TracesDefaultsSettings'.
|
|
97
|
+
*/
|
|
98
|
+
level?: keyof typeof Verbosity;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the filtering context will be added as span attributes
|
|
101
|
+
* to the matched span.
|
|
102
|
+
*
|
|
103
|
+
* If not specified, see 'TracesDefaultsSettings'.
|
|
104
|
+
*/
|
|
105
|
+
addContextToTrace?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether the span's status will be set to OK on completion, if
|
|
108
|
+
* it's still UNSET.
|
|
109
|
+
*
|
|
110
|
+
* If not specified, see 'TracesDefaultsSettings'.
|
|
111
|
+
*/
|
|
112
|
+
autoSetSuccessStatus?: boolean;
|
|
63
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Used for spans that didn't match a Filter or SamplingSettings entry,
|
|
116
|
+
* or if particular property isn't provided in matched entry.
|
|
117
|
+
*/
|
|
64
118
|
export interface TracesDefaultsSettings {
|
|
119
|
+
/**
|
|
120
|
+
* Whether the span will be created or will be a no-op. See 'Filter'.
|
|
121
|
+
*
|
|
122
|
+
* Defaults to 'true'.
|
|
123
|
+
*/
|
|
65
124
|
enabled?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* If filter is disabled, setting this to "true" will stop the propagation
|
|
127
|
+
* of tracing contexts.
|
|
128
|
+
*/
|
|
129
|
+
stopPropagation?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Default span attribute verbosity level. See 'Filter'.
|
|
132
|
+
*
|
|
133
|
+
* Defaults to 'INFO'.
|
|
134
|
+
*/
|
|
66
135
|
level?: keyof typeof Verbosity;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the filtering context will be added as span attributes
|
|
138
|
+
* to the span. See 'Filter'.
|
|
139
|
+
*
|
|
140
|
+
* Defaults to 'true'.
|
|
141
|
+
*/
|
|
142
|
+
addContextToTrace?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the span's status will be set to OK on completion, if
|
|
145
|
+
* it's still UNSET. See 'Filter'.
|
|
146
|
+
*
|
|
147
|
+
* Defaults to 'false'.
|
|
148
|
+
*/
|
|
149
|
+
autoSetSuccessStatus?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Default sampling setting/probability. See 'SamplingSettings'.
|
|
152
|
+
*
|
|
153
|
+
* Defaults to 'true'.
|
|
154
|
+
*/
|
|
67
155
|
sample?: number | boolean;
|
|
68
156
|
}
|
|
69
157
|
export interface TracesSettings {
|
|
158
|
+
/**
|
|
159
|
+
* Whether tracing functionality is enabled.
|
|
160
|
+
* If disabled, API is still usable, but methods are no-ops.
|
|
161
|
+
* Defaults to 'false'.
|
|
162
|
+
*/
|
|
70
163
|
enabled: boolean;
|
|
71
|
-
|
|
72
|
-
|
|
164
|
+
/**
|
|
165
|
+
* If provided, this value will be added to the span attributes
|
|
166
|
+
* and to the span filtering context (see 'filters').
|
|
167
|
+
*/
|
|
168
|
+
platformVersion?: string;
|
|
169
|
+
/**
|
|
170
|
+
* If provided, these values will be added to the span attributes
|
|
171
|
+
* and to the span filtering context (see 'filters').
|
|
172
|
+
*/
|
|
173
|
+
filteringContext?: {
|
|
174
|
+
[key: string]: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Array of filter entries used to determine whether
|
|
178
|
+
* a particular operation will create a tracing span, and
|
|
179
|
+
* what verbosity level will apply to attributes added
|
|
180
|
+
* to that span.
|
|
181
|
+
*
|
|
182
|
+
* If no matching filter entry is found,
|
|
183
|
+
* the settings from 'default' are used.
|
|
184
|
+
*/
|
|
73
185
|
filters?: Filter[];
|
|
74
|
-
|
|
186
|
+
/**
|
|
187
|
+
* If true, use a predefined list of filters for well-known
|
|
188
|
+
* platform traces.
|
|
189
|
+
*
|
|
190
|
+
* Defaults to true.
|
|
191
|
+
*/
|
|
192
|
+
useDefaultFilters?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Array of sampling setting entries used to determine
|
|
195
|
+
* whether a span will be sampled.
|
|
196
|
+
*
|
|
197
|
+
* If no matching sampling setting entry is found,
|
|
198
|
+
* the settings from 'default' are used.
|
|
199
|
+
*/
|
|
200
|
+
sampling?: SamplingSettings[];
|
|
201
|
+
/**
|
|
202
|
+
* Default settings if appropriate entries aren't found
|
|
203
|
+
* in 'filters' and 'sampling' collections.
|
|
204
|
+
*/
|
|
75
205
|
default?: TracesDefaultsSettings;
|
|
76
|
-
|
|
206
|
+
/**
|
|
207
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
208
|
+
* it will initialize its own.
|
|
209
|
+
*
|
|
210
|
+
* If 'url' is specified, TracerProvider will
|
|
211
|
+
* have an OTLPTraceExporter using this destination URL.
|
|
212
|
+
*/
|
|
213
|
+
url?: string;
|
|
214
|
+
/**
|
|
215
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
216
|
+
* it will initialize its own.
|
|
217
|
+
*
|
|
218
|
+
* If 'url' is specified, TracerProvider will
|
|
219
|
+
* have an OTLPTraceExporter with 'url' as detination URL and
|
|
220
|
+
* 'otlpExporterConfig' as additional * config.
|
|
221
|
+
*/
|
|
222
|
+
otlpExporterConfig?: OTLPExporterNodeConfigBase;
|
|
223
|
+
/**
|
|
224
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
225
|
+
* it will initialize its own.
|
|
226
|
+
*
|
|
227
|
+
* If 'console' is 'true', TracerProvider will
|
|
228
|
+
* have a ConsoleTraceExporter.
|
|
229
|
+
*/
|
|
230
|
+
console?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
233
|
+
* it will initialize its own, with this provided service.name
|
|
234
|
+
* attribute.
|
|
235
|
+
*/
|
|
77
236
|
serviceName?: string;
|
|
78
|
-
|
|
79
|
-
|
|
237
|
+
/**
|
|
238
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
239
|
+
* it will initialize its own, with this provided service.instance.id
|
|
240
|
+
* attribute.
|
|
241
|
+
*/
|
|
242
|
+
serviceId?: string;
|
|
243
|
+
/**
|
|
244
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
245
|
+
* it will initialize its own, with this provided service.version
|
|
246
|
+
* attribute.
|
|
247
|
+
*/
|
|
248
|
+
serviceVersion?: string;
|
|
249
|
+
/**
|
|
250
|
+
* If an OTEL TraceProvider isn't provided to the library,
|
|
251
|
+
* it will initialize its own, with this provided user.id
|
|
252
|
+
* attribute.
|
|
253
|
+
*/
|
|
254
|
+
userId?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Builder overrides
|
|
257
|
+
*/
|
|
258
|
+
tracingContextGetter?: (() => TracingContext) | undefined;
|
|
259
|
+
tracerProvider?: TracerProvider;
|
|
260
|
+
samplerGetter?: (defaultSampler: Sampler) => Sampler;
|
|
261
|
+
spanProcessors?: SpanProcessor[];
|
|
262
|
+
spanExporters?: SpanExporter[];
|
|
263
|
+
providerRegistrationSettings?: any;
|
|
80
264
|
}
|
|
81
265
|
export interface SamplingSettings {
|
|
266
|
+
/**
|
|
267
|
+
* Span name to determine if span will match this sampling setting entry.
|
|
268
|
+
* Start string with "#" for case-insensitive regex match
|
|
269
|
+
*/
|
|
270
|
+
name?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Span attributes that determine if span will match this sampling setting entry.
|
|
273
|
+
* Useful e.g. for checking otel.library.name/otel.scope.name attribute to filter
|
|
274
|
+
* auto-instrumentated spans.
|
|
275
|
+
* Start strings with "#" for case-insensitive regex match.
|
|
276
|
+
*/
|
|
82
277
|
attributes?: {
|
|
83
|
-
[key: string]: string | number;
|
|
278
|
+
[key: string]: string | number | boolean;
|
|
84
279
|
};
|
|
280
|
+
/**
|
|
281
|
+
* Context values that determine if span will match this sampling setting entry.
|
|
282
|
+
* 'Context' here refers to the object returned from the 'contextGetter' callback at the
|
|
283
|
+
* time of sampling, not the OTEL context concept.
|
|
284
|
+
* This is useful for sampling based on the current client environment - current user, application,
|
|
285
|
+
* server node, time of day, etc.
|
|
286
|
+
* Start strings with "#" for case-insensitive regex match.
|
|
287
|
+
*/
|
|
85
288
|
context?: {
|
|
86
|
-
[key: string]: string | number;
|
|
289
|
+
[key: string]: string | number | boolean;
|
|
87
290
|
};
|
|
291
|
+
/**
|
|
292
|
+
* Probability that span will be sampled, based on its traceId
|
|
293
|
+
* Spans from the same trace will always either all be sampled, or none will,
|
|
294
|
+
* provided they all have the same sampling probability.
|
|
295
|
+
* If true: will be sampled
|
|
296
|
+
* If false: will not be sampled
|
|
297
|
+
* If number between 0 and 1: has this probability of being sampled.
|
|
298
|
+
* Precision: 3 decimal digits
|
|
299
|
+
*/
|
|
88
300
|
sample: number | boolean;
|
|
89
301
|
}
|
|
90
302
|
export interface TracesManagerBuilder {
|
package/dist/traces/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/traces/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/traces/types.ts"],"names":[],"mappings":";;;AAmFA,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,6CAAM,CAAA;IACN,qDAAU,CAAA;IACV,2CAAK,CAAA;IACL,yCAAI,CAAA;IACJ,yCAAI,CAAA;IACJ,+CAAO,CAAA;AACT,CAAC,EARW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAQpB"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Sampler, SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
2
|
+
import { ContextManager, TracerProvider } from "@opentelemetry/api";
|
|
3
|
+
import { AttributeData, Filter, TracesDefaultsSettings, TracesSettings, TracingContext } from "../types";
|
|
3
4
|
import { Span } from "@opentelemetry/api";
|
|
4
|
-
|
|
5
|
+
import { Logger } from "../../logger/types";
|
|
6
|
+
export declare const isSpanEnabled: (match: Filter | undefined, defaultMatch: TracesDefaultsSettings | undefined) => boolean | undefined;
|
|
5
7
|
export declare const isFilterMatch: (filter: Filter, context: TracingContext, source: string) => boolean;
|
|
6
|
-
export declare const setTracerProvider: (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
console?: boolean;
|
|
10
|
-
}) => void;
|
|
8
|
+
export declare const setTracerProvider: (tracerProvider?: TracerProvider, sampler?: ((defaultSampler: Sampler) => Sampler) | undefined, spanProcessors?: SpanProcessor[], spanExporters?: SpanExporter[], providerRegistrationSettings?: {
|
|
9
|
+
contextManager?: ContextManager;
|
|
10
|
+
}, contextGetter?: () => TracingContext, logger?: Logger, settings?: TracesSettings) => void;
|
|
11
11
|
export declare const saveDataInAttribute: (data: AttributeData, otelSpan: Span) => void;
|
|
12
12
|
export declare const replacePlaceHolders: (settings: any, context: any) => any;
|
|
13
13
|
export declare const isFunctionType: (variable: unknown) => boolean;
|
|
14
|
+
export declare const deep_value: (obj: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
}, path: any) => any;
|
|
17
|
+
export declare const extractTracingContextFromArgs: (template: {
|
|
18
|
+
argMapping: {
|
|
19
|
+
[x: string]: string;
|
|
20
|
+
};
|
|
21
|
+
}, args: any[]) => any;
|