@opentelemetry/api 0.21.0 → 1.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -73
- package/README.md +5 -46
- package/build/src/api/context.d.ts +4 -6
- package/build/src/api/context.js +14 -12
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +3 -7
- package/build/src/api/diag.js +3 -15
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/propagation.d.ts +2 -10
- package/build/src/api/propagation.js +5 -13
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +3 -12
- package/build/src/api/trace.js +4 -12
- package/build/src/api/trace.js.map +1 -1
- package/build/{esm/baggage/types.d.ts → src/baggage/Baggage.d.ts} +2 -20
- package/build/{esm/baggage/types.js → src/baggage/Baggage.js} +3 -2
- package/build/src/baggage/Baggage.js.map +1 -0
- package/build/src/baggage/Entry.d.ts +20 -0
- package/build/src/baggage/{types.js → Entry.js} +1 -1
- package/build/src/baggage/Entry.js.map +1 -0
- package/build/src/baggage/{utils.d.ts → index.d.ts} +5 -2
- package/build/src/baggage/{utils.js → index.js} +16 -5
- package/build/src/baggage/index.js.map +1 -0
- package/build/{esm/baggage/internal/baggage-impl.d.ts → src/baggage/internal/baggage.d.ts} +3 -2
- package/build/src/baggage/internal/{baggage-impl.js → baggage.js} +1 -1
- package/build/src/baggage/internal/baggage.js.map +1 -0
- package/build/src/context/NoopContextManager.d.ts +1 -1
- package/build/src/context/NoopContextManager.js +8 -6
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.d.ts +59 -0
- package/build/src/context/context.js +101 -7
- package/build/src/context/context.js.map +1 -1
- package/build/src/context/types.d.ts +2 -2
- package/build/src/diag/types.d.ts +0 -6
- package/build/src/index.d.ts +8 -2
- package/build/src/index.js +9 -4
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +1 -1
- package/build/src/internal/global-utils.js +5 -7
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.d.ts +1 -0
- package/build/src/propagation/NoopTextMapPropagator.js +2 -1
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/trace/Event.d.ts +9 -0
- package/build/{esm/diag/index.js → src/trace/Event.js} +3 -3
- package/build/src/trace/Event.js.map +1 -0
- package/build/{esm/trace/NonRecordingSpan.d.ts → src/trace/NoopSpan.d.ts} +4 -4
- package/build/src/trace/{NonRecordingSpan.js → NoopSpan.js} +17 -17
- package/build/src/trace/NoopSpan.js.map +1 -0
- package/build/src/trace/NoopTracer.d.ts +1 -3
- package/build/src/trace/NoopTracer.js +8 -32
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.d.ts +1 -0
- package/build/src/trace/NoopTracerProvider.js +3 -2
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.d.ts +0 -1
- package/build/src/trace/ProxyTracer.js +1 -5
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.js +1 -2
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/TimedEvent.d.ts +10 -0
- package/build/{esm/context/types.js → src/trace/TimedEvent.js} +3 -2
- package/build/src/trace/TimedEvent.js.map +1 -0
- package/build/src/trace/link.d.ts +3 -3
- package/build/src/trace/link_context.d.ts +6 -0
- package/build/src/trace/link_context.js +18 -0
- package/build/src/trace/link_context.js.map +1 -0
- package/build/src/trace/span.d.ts +1 -1
- package/build/src/trace/spancontext-utils.d.ts +0 -8
- package/build/src/trace/spancontext-utils.js +1 -27
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace/tracer.d.ts +0 -46
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +15 -20
- package/build/esm/api/context.d.ts +0 -41
- package/build/esm/api/context.js +0 -89
- package/build/esm/api/context.js.map +0 -1
- package/build/esm/api/diag.d.ts +0 -38
- package/build/esm/api/diag.js +0 -89
- package/build/esm/api/diag.js.map +0 -1
- package/build/esm/api/propagation.d.ts +0 -48
- package/build/esm/api/propagation.js +0 -87
- package/build/esm/api/propagation.js.map +0 -1
- package/build/esm/api/trace.d.ts +0 -39
- package/build/esm/api/trace.js +0 -72
- package/build/esm/api/trace.js.map +0 -1
- package/build/esm/baggage/context-helpers.d.ts +0 -23
- package/build/esm/baggage/context-helpers.js +0 -47
- package/build/esm/baggage/context-helpers.js.map +0 -1
- package/build/esm/baggage/internal/baggage-impl.js +0 -61
- package/build/esm/baggage/internal/baggage-impl.js.map +0 -1
- package/build/esm/baggage/internal/symbol.d.ts +0 -5
- package/build/esm/baggage/internal/symbol.js +0 -20
- package/build/esm/baggage/internal/symbol.js.map +0 -1
- package/build/esm/baggage/types.js.map +0 -1
- package/build/esm/baggage/utils.d.ts +0 -15
- package/build/esm/baggage/utils.js +0 -46
- package/build/esm/baggage/utils.js.map +0 -1
- package/build/esm/common/Exception.d.ts +0 -26
- package/build/esm/common/Exception.js +0 -17
- package/build/esm/common/Exception.js.map +0 -1
- package/build/esm/common/Time.d.ts +0 -8
- package/build/esm/common/Time.js +0 -2
- package/build/esm/common/Time.js.map +0 -1
- package/build/esm/context/NoopContextManager.d.ts +0 -9
- package/build/esm/context/NoopContextManager.js +0 -47
- package/build/esm/context/NoopContextManager.js.map +0 -1
- package/build/esm/context/context.d.ts +0 -6
- package/build/esm/context/context.js +0 -52
- package/build/esm/context/context.js.map +0 -1
- package/build/esm/context/types.d.ts +0 -52
- package/build/esm/context/types.js.map +0 -1
- package/build/esm/diag/ComponentLogger.d.ts +0 -20
- package/build/esm/diag/ComponentLogger.js +0 -77
- package/build/esm/diag/ComponentLogger.js.map +0 -1
- package/build/esm/diag/consoleLogger.d.ts +0 -38
- package/build/esm/diag/consoleLogger.js +0 -54
- package/build/esm/diag/consoleLogger.js.map +0 -1
- package/build/esm/diag/index.d.ts +0 -3
- package/build/esm/diag/index.js.map +0 -1
- package/build/esm/diag/internal/logLevelLogger.d.ts +0 -3
- package/build/esm/diag/internal/logLevelLogger.js +0 -41
- package/build/esm/diag/internal/logLevelLogger.js.map +0 -1
- package/build/esm/diag/internal/noopLogger.d.ts +0 -8
- package/build/esm/diag/internal/noopLogger.js +0 -31
- package/build/esm/diag/internal/noopLogger.js.map +0 -1
- package/build/esm/diag/types.d.ts +0 -70
- package/build/esm/diag/types.js +0 -41
- package/build/esm/diag/types.js.map +0 -1
- package/build/esm/index.d.ts +0 -53
- package/build/esm/index.js +0 -63
- package/build/esm/index.js.map +0 -1
- package/build/esm/internal/global-utils.d.ts +0 -16
- package/build/esm/internal/global-utils.js +0 -60
- package/build/esm/internal/global-utils.js.map +0 -1
- package/build/esm/internal/semver.d.ts +0 -34
- package/build/esm/internal/semver.js +0 -106
- package/build/esm/internal/semver.js.map +0 -1
- package/build/esm/platform/browser/globalThis.d.ts +0 -3
- package/build/esm/platform/browser/globalThis.js +0 -19
- package/build/esm/platform/browser/globalThis.js.map +0 -1
- package/build/esm/platform/browser/index.d.ts +0 -2
- package/build/esm/platform/browser/index.js +0 -17
- package/build/esm/platform/browser/index.js.map +0 -1
- package/build/esm/platform/index.d.ts +0 -2
- package/build/esm/platform/index.js +0 -17
- package/build/esm/platform/index.js.map +0 -1
- package/build/esm/platform/node/globalThis.d.ts +0 -3
- package/build/esm/platform/node/globalThis.js +0 -19
- package/build/esm/platform/node/globalThis.js.map +0 -1
- package/build/esm/platform/node/index.d.ts +0 -2
- package/build/esm/platform/node/index.js +0 -17
- package/build/esm/platform/node/index.js.map +0 -1
- package/build/esm/propagation/NoopTextMapPropagator.d.ts +0 -13
- package/build/esm/propagation/NoopTextMapPropagator.js +0 -34
- package/build/esm/propagation/NoopTextMapPropagator.js.map +0 -1
- package/build/esm/propagation/TextMapPropagator.d.ts +0 -84
- package/build/esm/propagation/TextMapPropagator.js +0 -38
- package/build/esm/propagation/TextMapPropagator.js.map +0 -1
- package/build/esm/trace/NonRecordingSpan.js +0 -62
- package/build/esm/trace/NonRecordingSpan.js.map +0 -1
- package/build/esm/trace/NoopTracer.d.ts +0 -14
- package/build/esm/trace/NoopTracer.js +0 -74
- package/build/esm/trace/NoopTracer.js.map +0 -1
- package/build/esm/trace/NoopTracerProvider.d.ts +0 -12
- package/build/esm/trace/NoopTracerProvider.js +0 -32
- package/build/esm/trace/NoopTracerProvider.js.map +0 -1
- package/build/esm/trace/ProxyTracer.d.ts +0 -23
- package/build/esm/trace/ProxyTracer.js +0 -51
- package/build/esm/trace/ProxyTracer.js.map +0 -1
- package/build/esm/trace/ProxyTracerProvider.d.ts +0 -24
- package/build/esm/trace/ProxyTracerProvider.js +0 -54
- package/build/esm/trace/ProxyTracerProvider.js.map +0 -1
- package/build/esm/trace/Sampler.d.ts +0 -30
- package/build/esm/trace/Sampler.js +0 -17
- package/build/esm/trace/Sampler.js.map +0 -1
- package/build/esm/trace/SamplingResult.d.ts +0 -39
- package/build/esm/trace/SamplingResult.js +0 -38
- package/build/esm/trace/SamplingResult.js.map +0 -1
- package/build/esm/trace/SpanOptions.d.ts +0 -23
- package/build/esm/trace/SpanOptions.js +0 -17
- package/build/esm/trace/SpanOptions.js.map +0 -1
- package/build/esm/trace/attributes.d.ts +0 -10
- package/build/esm/trace/attributes.js +0 -17
- package/build/esm/trace/attributes.js.map +0 -1
- package/build/esm/trace/context-utils.d.ts +0 -37
- package/build/esm/trace/context-utils.js +0 -66
- package/build/esm/trace/context-utils.js.map +0 -1
- package/build/esm/trace/link.d.ts +0 -24
- package/build/esm/trace/link.js +0 -17
- package/build/esm/trace/link.js.map +0 -1
- package/build/esm/trace/span.d.ts +0 -101
- package/build/esm/trace/span.js +0 -17
- package/build/esm/trace/span.js.map +0 -1
- package/build/esm/trace/span_context.d.ts +0 -53
- package/build/esm/trace/span_context.js +0 -17
- package/build/esm/trace/span_context.js.map +0 -1
- package/build/esm/trace/span_kind.d.ts +0 -27
- package/build/esm/trace/span_kind.js +0 -43
- package/build/esm/trace/span_kind.js.map +0 -1
- package/build/esm/trace/spancontext-utils.d.ts +0 -20
- package/build/esm/trace/spancontext-utils.js +0 -49
- package/build/esm/trace/spancontext-utils.js.map +0 -1
- package/build/esm/trace/status.d.ts +0 -25
- package/build/esm/trace/status.js +0 -20
- package/build/esm/trace/status.js.map +0 -1
- package/build/esm/trace/trace_flags.d.ts +0 -7
- package/build/esm/trace/trace_flags.js +0 -23
- package/build/esm/trace/trace_flags.js.map +0 -1
- package/build/esm/trace/trace_state.d.ts +0 -38
- package/build/esm/trace/trace_state.js +0 -17
- package/build/esm/trace/trace_state.js.map +0 -1
- package/build/esm/trace/tracer.d.ts +0 -70
- package/build/esm/trace/tracer.js +0 -17
- package/build/esm/trace/tracer.js.map +0 -1
- package/build/esm/trace/tracer_provider.d.ts +0 -19
- package/build/esm/trace/tracer_provider.js +0 -17
- package/build/esm/trace/tracer_provider.js.map +0 -1
- package/build/esm/version.d.ts +0 -2
- package/build/esm/version.js +0 -18
- package/build/esm/version.js.map +0 -1
- package/build/src/baggage/context-helpers.d.ts +0 -23
- package/build/src/baggage/context-helpers.js +0 -53
- package/build/src/baggage/context-helpers.js.map +0 -1
- package/build/src/baggage/internal/baggage-impl.d.ts +0 -12
- package/build/src/baggage/internal/baggage-impl.js.map +0 -1
- package/build/src/baggage/types.d.ts +0 -60
- package/build/src/baggage/types.js.map +0 -1
- package/build/src/baggage/utils.js.map +0 -1
- package/build/src/diag/ComponentLogger.d.ts +0 -20
- package/build/src/diag/ComponentLogger.js +0 -80
- package/build/src/diag/ComponentLogger.js.map +0 -1
- package/build/src/trace/NonRecordingSpan.d.ts +0 -25
- package/build/src/trace/NonRecordingSpan.js.map +0 -1
- package/build/src/trace/context-utils.d.ts +0 -37
- package/build/src/trace/context-utils.js +0 -74
- package/build/src/trace/context-utils.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoopSpan.js","sourceRoot":"","sources":["../../../src/trace/NoopSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,yDAA2D;AAE3D;;;;GAIG;AACH;IACE,kBACmB,YAAgD;QAAhD,6BAAA,EAAA,eAA4B,wCAAoB;QAAhD,iBAAY,GAAZ,YAAY,CAAoC;IAChE,CAAC;IAEJ,yBAAyB;IACzB,0BAAO,GAAP;QACE,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,0BAA0B;IAC1B,+BAAY,GAAZ,UAAa,IAAY,EAAE,MAAe;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,gCAAa,GAAb,UAAc,WAA2B;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,2BAAQ,GAAR,UAAS,KAAa,EAAE,WAA4B;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,4BAAS,GAAT,UAAU,OAAmB;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,6BAAU,GAAV,UAAW,KAAa;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,sBAAG,GAAH,UAAI,QAAoB,IAAS,CAAC;IAElC,iDAAiD;IACjD,8BAAW,GAAX;QACE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,kCAAe,GAAf,UAAgB,UAAqB,EAAE,KAAiB,IAAS,CAAC;IACpE,eAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,4BAAQ"}
|
|
@@ -7,8 +7,6 @@ import { Tracer } from './tracer';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class NoopTracer implements Tracer {
|
|
9
9
|
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
|
10
|
-
startActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, fn: F): ReturnType<F>;
|
|
11
|
-
startActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, opts: SpanOptions | undefined, fn: F): ReturnType<F>;
|
|
12
|
-
startActiveSpan<F extends (span: Span) => ReturnType<F>>(name: string, opts: SpanOptions | undefined, ctx: Context | undefined, fn: F): ReturnType<F>;
|
|
13
10
|
}
|
|
11
|
+
export declare const NOOP_TRACER: NoopTracer;
|
|
14
12
|
//# sourceMappingURL=NoopTracer.d.ts.map
|
|
@@ -15,10 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.NoopTracer = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
18
|
+
exports.NOOP_TRACER = exports.NoopTracer = void 0;
|
|
19
|
+
var context_1 = require("../context/context");
|
|
20
|
+
var NoopSpan_1 = require("./NoopSpan");
|
|
22
21
|
var spancontext_utils_1 = require("./spancontext-utils");
|
|
23
22
|
/**
|
|
24
23
|
* No-op implementations of {@link Tracer}.
|
|
@@ -30,41 +29,17 @@ var NoopTracer = /** @class */ (function () {
|
|
|
30
29
|
NoopTracer.prototype.startSpan = function (name, options, context) {
|
|
31
30
|
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
32
31
|
if (root) {
|
|
33
|
-
return new
|
|
32
|
+
return new NoopSpan_1.NoopSpan();
|
|
34
33
|
}
|
|
35
|
-
var parentFromContext = context &&
|
|
34
|
+
var parentFromContext = context && context_1.getSpanContext(context);
|
|
36
35
|
if (isSpanContext(parentFromContext) &&
|
|
37
36
|
spancontext_utils_1.isSpanContextValid(parentFromContext)) {
|
|
38
|
-
return new
|
|
37
|
+
return new NoopSpan_1.NoopSpan(parentFromContext);
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
41
|
-
return new
|
|
40
|
+
return new NoopSpan_1.NoopSpan();
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
|
-
NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {
|
|
45
|
-
var opts;
|
|
46
|
-
var ctx;
|
|
47
|
-
var fn;
|
|
48
|
-
if (arguments.length < 2) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
else if (arguments.length === 2) {
|
|
52
|
-
fn = arg2;
|
|
53
|
-
}
|
|
54
|
-
else if (arguments.length === 3) {
|
|
55
|
-
opts = arg2;
|
|
56
|
-
fn = arg3;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
opts = arg2;
|
|
60
|
-
ctx = arg3;
|
|
61
|
-
fn = arg4;
|
|
62
|
-
}
|
|
63
|
-
var parentContext = ctx !== null && ctx !== void 0 ? ctx : __1.context.active();
|
|
64
|
-
var span = this.startSpan(name, opts, parentContext);
|
|
65
|
-
var contextWithSpanSet = context_utils_1.setSpan(parentContext, span);
|
|
66
|
-
return __1.context.with(contextWithSpanSet, fn, undefined, span);
|
|
67
|
-
};
|
|
68
43
|
return NoopTracer;
|
|
69
44
|
}());
|
|
70
45
|
exports.NoopTracer = NoopTracer;
|
|
@@ -74,4 +49,5 @@ function isSpanContext(spanContext) {
|
|
|
74
49
|
typeof spanContext['traceId'] === 'string' &&
|
|
75
50
|
typeof spanContext['traceFlags'] === 'number');
|
|
76
51
|
}
|
|
52
|
+
exports.NOOP_TRACER = new NoopTracer();
|
|
77
53
|
//# sourceMappingURL=NoopTracer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTracer.js","sourceRoot":"","sources":["../../../src/trace/NoopTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"NoopTracer.js","sourceRoot":"","sources":["../../../src/trace/NoopTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAAoD;AAEpD,uCAAsC;AAEtC,yDAAyD;AAKzD;;GAEG;AACH;IAAA;IAmBA,CAAC;IAlBC,gCAAgC;IAChC,8BAAS,GAAT,UAAU,IAAY,EAAE,OAAqB,EAAE,OAAiB;QAC9D,IAAM,IAAI,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC;QACpC,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,mBAAQ,EAAE,CAAC;SACvB;QAED,IAAM,iBAAiB,GAAG,OAAO,IAAI,wBAAc,CAAC,OAAO,CAAC,CAAC;QAE7D,IACE,aAAa,CAAC,iBAAiB,CAAC;YAChC,sCAAkB,CAAC,iBAAiB,CAAC,EACrC;YACA,OAAO,IAAI,mBAAQ,CAAC,iBAAiB,CAAC,CAAC;SACxC;aAAM;YACL,OAAO,IAAI,mBAAQ,EAAE,CAAC;SACvB;IACH,CAAC;IACH,iBAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,gCAAU;AAqBvB,SAAS,aAAa,CAAC,WAAgB;IACrC,OAAO,CACL,OAAO,WAAW,KAAK,QAAQ;QAC/B,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,QAAQ;QACzC,OAAO,WAAW,CAAC,SAAS,CAAC,KAAK,QAAQ;QAC1C,OAAO,WAAW,CAAC,YAAY,CAAC,KAAK,QAAQ,CAC9C,CAAC;AACJ,CAAC;AAEY,QAAA,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -9,4 +9,5 @@ import { TracerProvider } from './tracer_provider';
|
|
|
9
9
|
export declare class NoopTracerProvider implements TracerProvider {
|
|
10
10
|
getTracer(_name?: string, _version?: string): Tracer;
|
|
11
11
|
}
|
|
12
|
+
export declare const NOOP_TRACER_PROVIDER: NoopTracerProvider;
|
|
12
13
|
//# sourceMappingURL=NoopTracerProvider.d.ts.map
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.NoopTracerProvider = void 0;
|
|
18
|
+
exports.NOOP_TRACER_PROVIDER = exports.NoopTracerProvider = void 0;
|
|
19
19
|
var NoopTracer_1 = require("./NoopTracer");
|
|
20
20
|
/**
|
|
21
21
|
* An implementation of the {@link TracerProvider} which returns an impotent
|
|
@@ -27,9 +27,10 @@ var NoopTracerProvider = /** @class */ (function () {
|
|
|
27
27
|
function NoopTracerProvider() {
|
|
28
28
|
}
|
|
29
29
|
NoopTracerProvider.prototype.getTracer = function (_name, _version) {
|
|
30
|
-
return
|
|
30
|
+
return NoopTracer_1.NOOP_TRACER;
|
|
31
31
|
};
|
|
32
32
|
return NoopTracerProvider;
|
|
33
33
|
}());
|
|
34
34
|
exports.NoopTracerProvider = NoopTracerProvider;
|
|
35
|
+
exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
35
36
|
//# sourceMappingURL=NoopTracerProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/NoopTracerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"NoopTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/NoopTracerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAA2C;AAI3C;;;;;GAKG;AACH;IAAA;IAIA,CAAC;IAHC,sCAAS,GAAT,UAAU,KAAc,EAAE,QAAiB;QACzC,OAAO,wBAAW,CAAC;IACrB,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,IAIC;AAJY,gDAAkB;AAMlB,QAAA,oBAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -13,7 +13,6 @@ export declare class ProxyTracer implements Tracer {
|
|
|
13
13
|
private _delegate?;
|
|
14
14
|
constructor(_provider: ProxyTracerProvider, name: string, version?: string | undefined);
|
|
15
15
|
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
|
16
|
-
startActiveSpan<F extends (span: Span) => unknown>(_name: string, _options: F | SpanOptions, _context?: F | Context, _fn?: F): ReturnType<F>;
|
|
17
16
|
/**
|
|
18
17
|
* Try to get a tracer from the proxy tracer provider.
|
|
19
18
|
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
@@ -29,10 +29,6 @@ var ProxyTracer = /** @class */ (function () {
|
|
|
29
29
|
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
|
30
30
|
return this._getTracer().startSpan(name, options, context);
|
|
31
31
|
};
|
|
32
|
-
ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {
|
|
33
|
-
var tracer = this._getTracer();
|
|
34
|
-
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
35
|
-
};
|
|
36
32
|
/**
|
|
37
33
|
* Try to get a tracer from the proxy tracer provider.
|
|
38
34
|
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
@@ -43,7 +39,7 @@ var ProxyTracer = /** @class */ (function () {
|
|
|
43
39
|
}
|
|
44
40
|
var tracer = this._provider.getDelegateTracer(this.name, this.version);
|
|
45
41
|
if (!tracer) {
|
|
46
|
-
return
|
|
42
|
+
return NoopTracer_1.NOOP_TRACER;
|
|
47
43
|
}
|
|
48
44
|
this._delegate = tracer;
|
|
49
45
|
return this._delegate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProxyTracer.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"ProxyTracer.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,2CAA2C;AAM3C;;GAEG;AACH;IAIE,qBACU,SAA8B,EACtB,IAAY,EACZ,OAAgB;QAFxB,cAAS,GAAT,SAAS,CAAqB;QACtB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAS;IAC/B,CAAC;IAEJ,+BAAS,GAAT,UAAU,IAAY,EAAE,OAAqB,EAAE,OAAiB;QAC9D,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACK,gCAAU,GAAlB;QACE,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC;SACvB;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAEzE,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,wBAAW,CAAC;SACpB;QAED,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACH,kBAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,kCAAW"}
|
|
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.ProxyTracerProvider = void 0;
|
|
19
19
|
var ProxyTracer_1 = require("./ProxyTracer");
|
|
20
20
|
var NoopTracerProvider_1 = require("./NoopTracerProvider");
|
|
21
|
-
var NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider();
|
|
22
21
|
/**
|
|
23
22
|
* Tracer provider which provides {@link ProxyTracer}s.
|
|
24
23
|
*
|
|
@@ -39,7 +38,7 @@ var ProxyTracerProvider = /** @class */ (function () {
|
|
|
39
38
|
};
|
|
40
39
|
ProxyTracerProvider.prototype.getDelegate = function () {
|
|
41
40
|
var _a;
|
|
42
|
-
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
41
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopTracerProvider_1.NOOP_TRACER_PROVIDER;
|
|
43
42
|
};
|
|
44
43
|
/**
|
|
45
44
|
* Set the delegate tracer provider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProxyTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,6CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"ProxyTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,6CAA4C;AAC5C,2DAA4D;AAE5D;;;;;;;GAOG;AACH;IAAA;IA2BA,CAAC;IAxBC;;OAEG;IACH,uCAAS,GAAT,UAAU,IAAY,EAAE,OAAgB;;QACtC,OAAO,OACL,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,mCACrC,IAAI,yBAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CACrC,CAAC;IACJ,CAAC;IAED,yCAAW,GAAX;;QACE,aAAO,IAAI,CAAC,SAAS,mCAAI,yCAAoB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,yCAAW,GAAX,UAAY,QAAwB;QAClC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,+CAAiB,GAAjB,UAAkB,IAAY,EAAE,OAAgB;;QAC9C,aAAO,IAAI,CAAC,SAAS,0CAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE;IAClD,CAAC;IACH,0BAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,kDAAmB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Event } from './Event';
|
|
2
|
+
import { HrTime } from '../common/Time';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a timed event.
|
|
5
|
+
* A timed event is an event with a timestamp.
|
|
6
|
+
*/
|
|
7
|
+
export interface TimedEvent extends Event {
|
|
8
|
+
time: HrTime;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=TimedEvent.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
* Copyright The OpenTelemetry Authors
|
|
3
4
|
*
|
|
@@ -13,5 +14,5 @@
|
|
|
13
14
|
* See the License for the specific language governing permissions and
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
//# sourceMappingURL=TimedEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimedEvent.js","sourceRoot":"","sources":["../../../src/trace/TimedEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanAttributes } from './attributes';
|
|
2
|
-
import {
|
|
2
|
+
import { LinkContext } from './link_context';
|
|
3
3
|
/**
|
|
4
4
|
* A pointer from the current {@link Span} to another span in the same trace or
|
|
5
5
|
* in a different trace.
|
|
@@ -16,8 +16,8 @@ import { SpanContext } from './span_context';
|
|
|
16
16
|
* Service Provider) can be correlated.
|
|
17
17
|
*/
|
|
18
18
|
export interface Link {
|
|
19
|
-
/** The {@link
|
|
20
|
-
context:
|
|
19
|
+
/** The {@link LinkContext} of a linked span. */
|
|
20
|
+
context: LinkContext;
|
|
21
21
|
/** A set of {@link SpanAttributes} on the link. */
|
|
22
22
|
attributes?: SpanAttributes;
|
|
23
23
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
//# sourceMappingURL=link_context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link_context.js","sourceRoot":"","sources":["../../../src/trace/link_context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Span } from './span';
|
|
2
1
|
import { SpanContext } from './span_context';
|
|
3
2
|
export declare const INVALID_SPANID = "0000000000000000";
|
|
4
3
|
export declare const INVALID_TRACEID = "00000000000000000000000000000000";
|
|
@@ -10,11 +9,4 @@ export declare function isValidSpanId(spanId: string): boolean;
|
|
|
10
9
|
* @return true if this {@link SpanContext} is valid.
|
|
11
10
|
*/
|
|
12
11
|
export declare function isSpanContextValid(spanContext: SpanContext): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
|
|
15
|
-
*
|
|
16
|
-
* @param spanContext span context to be wrapped
|
|
17
|
-
* @returns a new non-recording {@link Span} with the provided context
|
|
18
|
-
*/
|
|
19
|
-
export declare function wrapSpanContext(spanContext: SpanContext): Span;
|
|
20
12
|
//# sourceMappingURL=spancontext-utils.d.ts.map
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
/*
|
|
5
|
-
* Copyright The OpenTelemetry Authors
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
var NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
3
|
+
exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;
|
|
20
4
|
var trace_flags_1 = require("./trace_flags");
|
|
21
5
|
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
|
22
6
|
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
|
@@ -43,14 +27,4 @@ function isSpanContextValid(spanContext) {
|
|
|
43
27
|
return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));
|
|
44
28
|
}
|
|
45
29
|
exports.isSpanContextValid = isSpanContextValid;
|
|
46
|
-
/**
|
|
47
|
-
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
|
|
48
|
-
*
|
|
49
|
-
* @param spanContext span context to be wrapped
|
|
50
|
-
* @returns a new non-recording {@link Span} with the provided context
|
|
51
|
-
*/
|
|
52
|
-
function wrapSpanContext(spanContext) {
|
|
53
|
-
return new NonRecordingSpan_1.NonRecordingSpan(spanContext);
|
|
54
|
-
}
|
|
55
|
-
exports.wrapSpanContext = wrapSpanContext;
|
|
56
30
|
//# sourceMappingURL=spancontext-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spancontext-utils.js","sourceRoot":"","sources":["../../../src/trace/spancontext-utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"spancontext-utils.js","sourceRoot":"","sources":["../../../src/trace/spancontext-utils.ts"],"names":[],"mappings":";;;AAgBA,6CAA2C;AAE3C,IAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,IAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAChC,QAAA,cAAc,GAAG,kBAAkB,CAAC;AACpC,QAAA,eAAe,GAAG,kCAAkC,CAAC;AACrD,QAAA,oBAAoB,GAAgB;IAC/C,OAAO,EAAE,uBAAe;IACxB,MAAM,EAAE,sBAAc;IACtB,UAAU,EAAE,wBAAU,CAAC,IAAI;CAC5B,CAAC;AAEF,SAAgB,cAAc,CAAC,OAAe;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,uBAAe,CAAC;AAC1E,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAc;IAC1C,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,sBAAc,CAAC;AACtE,CAAC;AAFD,sCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,WAAwB;IACzD,OAAO,CACL,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CACzE,CAAC;AACJ,CAAC;AAJD,gDAIC"}
|
|
@@ -20,51 +20,5 @@ export interface Tracer {
|
|
|
20
20
|
* span.end();
|
|
21
21
|
*/
|
|
22
22
|
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
|
23
|
-
/**
|
|
24
|
-
* Starts a new {@link Span} and calls the given function passing it the
|
|
25
|
-
* created span as first argument.
|
|
26
|
-
* Additionally the new span gets set in context and this context is activated
|
|
27
|
-
* for the duration of the function call.
|
|
28
|
-
*
|
|
29
|
-
* @param name The name of the span
|
|
30
|
-
* @param [options] SpanOptions used for span creation
|
|
31
|
-
* @param [context] Context to use to extract parent
|
|
32
|
-
* @param fn function called in the context of the span and receives the newly created span as an argument
|
|
33
|
-
* @returns return value of fn
|
|
34
|
-
* @example
|
|
35
|
-
* const something = tracer.startActiveSpan('op', span => {
|
|
36
|
-
* try {
|
|
37
|
-
* do some work
|
|
38
|
-
* span.setStatus({code: SpanStatusCode.OK});
|
|
39
|
-
* return something;
|
|
40
|
-
* } catch (err) {
|
|
41
|
-
* span.setStatus({
|
|
42
|
-
* code: SpanStatusCode.ERROR,
|
|
43
|
-
* message: err.message,
|
|
44
|
-
* });
|
|
45
|
-
* throw err;
|
|
46
|
-
* } finally {
|
|
47
|
-
* span.end();
|
|
48
|
-
* }
|
|
49
|
-
* });
|
|
50
|
-
* @example
|
|
51
|
-
* const span = tracer.startActiveSpan('op', span => {
|
|
52
|
-
* try {
|
|
53
|
-
* do some work
|
|
54
|
-
* return span;
|
|
55
|
-
* } catch (err) {
|
|
56
|
-
* span.setStatus({
|
|
57
|
-
* code: SpanStatusCode.ERROR,
|
|
58
|
-
* message: err.message,
|
|
59
|
-
* });
|
|
60
|
-
* throw err;
|
|
61
|
-
* }
|
|
62
|
-
* });
|
|
63
|
-
* do some more work
|
|
64
|
-
* span.end();
|
|
65
|
-
*/
|
|
66
|
-
startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
|
|
67
|
-
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
|
|
68
|
-
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
|
|
69
23
|
}
|
|
70
24
|
//# sourceMappingURL=tracer.d.ts.map
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "1.0.0-rc.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
4
|
"description": "Public API for OpenTelemetry",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
|
-
"module": "build/esm/index.js",
|
|
7
6
|
"types": "build/src/index.d.ts",
|
|
8
7
|
"browser": {
|
|
9
8
|
"./src/platform/index.ts": "./src/platform/browser/index.ts",
|
|
10
|
-
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
|
|
11
9
|
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
|
|
12
10
|
},
|
|
13
11
|
"repository": "https://github.com/open-telemetry/opentelemetry-js-api.git",
|
|
14
12
|
"scripts": {
|
|
15
13
|
"build": "npm run compile",
|
|
16
|
-
"clean": "tsc --build --clean
|
|
14
|
+
"clean": "tsc --build --clean",
|
|
17
15
|
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
|
|
18
16
|
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
|
|
19
|
-
"compile": "tsc --build
|
|
17
|
+
"compile": "tsc --build",
|
|
20
18
|
"docs": "typedoc",
|
|
21
19
|
"docs:deploy": "gh-pages --dist docs/out",
|
|
22
20
|
"docs:test": "linkinator docs/out --silent --skip david-dm.org",
|
|
@@ -42,9 +40,6 @@
|
|
|
42
40
|
"node": ">=8.0.0"
|
|
43
41
|
},
|
|
44
42
|
"files": [
|
|
45
|
-
"build/esm/**/*.js",
|
|
46
|
-
"build/esm/**/*.js.map",
|
|
47
|
-
"build/esm/**/*.d.ts",
|
|
48
43
|
"build/src/**/*.js",
|
|
49
44
|
"build/src/**/*.js.map",
|
|
50
45
|
"build/src/**/*.d.ts",
|
|
@@ -55,14 +50,14 @@
|
|
|
55
50
|
"access": "public"
|
|
56
51
|
},
|
|
57
52
|
"devDependencies": {
|
|
58
|
-
"@types/mocha": "8.2.
|
|
59
|
-
"@types/node": "14.14.
|
|
60
|
-
"@types/sinon": "
|
|
53
|
+
"@types/mocha": "8.2.1",
|
|
54
|
+
"@types/node": "14.14.28",
|
|
55
|
+
"@types/sinon": "9.0.10",
|
|
61
56
|
"@types/webpack-env": "1.16.0",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "4.
|
|
63
|
-
"@typescript-eslint/parser": "4.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "4.15.1",
|
|
58
|
+
"@typescript-eslint/parser": "4.15.1",
|
|
64
59
|
"codecov": "3.8.1",
|
|
65
|
-
"eslint": "7.
|
|
60
|
+
"eslint": "7.20.0",
|
|
66
61
|
"eslint-plugin-header": "3.1.1",
|
|
67
62
|
"eslint-plugin-import": "2.22.1",
|
|
68
63
|
"gh-pages": "3.1.0",
|
|
@@ -74,15 +69,15 @@
|
|
|
74
69
|
"karma-mocha": "2.0.1",
|
|
75
70
|
"karma-spec-reporter": "0.0.32",
|
|
76
71
|
"karma-webpack": "4.0.2",
|
|
77
|
-
"lerna-changelog": "1.0.1",
|
|
78
|
-
"linkinator": "2.13.
|
|
72
|
+
"lerna-changelog": "^1.0.1",
|
|
73
|
+
"linkinator": "2.13.5",
|
|
79
74
|
"mocha": "7.2.0",
|
|
80
75
|
"nyc": "15.1.0",
|
|
81
|
-
"sinon": "
|
|
82
|
-
"ts-loader": "8.
|
|
76
|
+
"sinon": "9.2.4",
|
|
77
|
+
"ts-loader": "8.0.17",
|
|
83
78
|
"ts-mocha": "8.0.0",
|
|
84
|
-
"typedoc": "0.20.
|
|
85
|
-
"typescript": "4.
|
|
79
|
+
"typedoc": "0.20.25",
|
|
80
|
+
"typescript": "4.1.5",
|
|
86
81
|
"webpack": "4.46.0"
|
|
87
82
|
}
|
|
88
83
|
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Context, ContextManager } from '../context/types';
|
|
2
|
-
/**
|
|
3
|
-
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
|
4
|
-
*/
|
|
5
|
-
export declare class ContextAPI {
|
|
6
|
-
private static _instance?;
|
|
7
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
8
|
-
private constructor();
|
|
9
|
-
/** Get the singleton instance of the Context API */
|
|
10
|
-
static getInstance(): ContextAPI;
|
|
11
|
-
/**
|
|
12
|
-
* Set the current context manager.
|
|
13
|
-
*
|
|
14
|
-
* @returns true if the context manager was successfully registered, else false
|
|
15
|
-
*/
|
|
16
|
-
setGlobalContextManager(contextManager: ContextManager): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Get the currently active context
|
|
19
|
-
*/
|
|
20
|
-
active(): Context;
|
|
21
|
-
/**
|
|
22
|
-
* Execute a function with an active context
|
|
23
|
-
*
|
|
24
|
-
* @param context context to be active during function execution
|
|
25
|
-
* @param fn function to execute in a context
|
|
26
|
-
* @param thisArg optional receiver to be used for calling fn
|
|
27
|
-
* @param args optional arguments forwarded to fn
|
|
28
|
-
*/
|
|
29
|
-
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
30
|
-
/**
|
|
31
|
-
* Bind a context to a target function or event emitter
|
|
32
|
-
*
|
|
33
|
-
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
34
|
-
* @param target function or event emitter to bind
|
|
35
|
-
*/
|
|
36
|
-
bind<T>(context: Context, target: T): T;
|
|
37
|
-
private _getContextManager;
|
|
38
|
-
/** Disable and remove the global context manager */
|
|
39
|
-
disable(): void;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=context.d.ts.map
|
package/build/esm/api/context.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
17
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
18
|
-
to[j] = from[i];
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
import { NoopContextManager } from '../context/NoopContextManager';
|
|
22
|
-
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
|
23
|
-
var API_NAME = 'context';
|
|
24
|
-
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
25
|
-
/**
|
|
26
|
-
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
|
27
|
-
*/
|
|
28
|
-
var ContextAPI = /** @class */ (function () {
|
|
29
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
30
|
-
function ContextAPI() {
|
|
31
|
-
}
|
|
32
|
-
/** Get the singleton instance of the Context API */
|
|
33
|
-
ContextAPI.getInstance = function () {
|
|
34
|
-
if (!this._instance) {
|
|
35
|
-
this._instance = new ContextAPI();
|
|
36
|
-
}
|
|
37
|
-
return this._instance;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Set the current context manager.
|
|
41
|
-
*
|
|
42
|
-
* @returns true if the context manager was successfully registered, else false
|
|
43
|
-
*/
|
|
44
|
-
ContextAPI.prototype.setGlobalContextManager = function (contextManager) {
|
|
45
|
-
return registerGlobal(API_NAME, contextManager);
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Get the currently active context
|
|
49
|
-
*/
|
|
50
|
-
ContextAPI.prototype.active = function () {
|
|
51
|
-
return this._getContextManager().active();
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Execute a function with an active context
|
|
55
|
-
*
|
|
56
|
-
* @param context context to be active during function execution
|
|
57
|
-
* @param fn function to execute in a context
|
|
58
|
-
* @param thisArg optional receiver to be used for calling fn
|
|
59
|
-
* @param args optional arguments forwarded to fn
|
|
60
|
-
*/
|
|
61
|
-
ContextAPI.prototype.with = function (context, fn, thisArg) {
|
|
62
|
-
var _a;
|
|
63
|
-
var args = [];
|
|
64
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
65
|
-
args[_i - 3] = arguments[_i];
|
|
66
|
-
}
|
|
67
|
-
return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], args));
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Bind a context to a target function or event emitter
|
|
71
|
-
*
|
|
72
|
-
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
73
|
-
* @param target function or event emitter to bind
|
|
74
|
-
*/
|
|
75
|
-
ContextAPI.prototype.bind = function (context, target) {
|
|
76
|
-
return this._getContextManager().bind(context, target);
|
|
77
|
-
};
|
|
78
|
-
ContextAPI.prototype._getContextManager = function () {
|
|
79
|
-
return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;
|
|
80
|
-
};
|
|
81
|
-
/** Disable and remove the global context manager */
|
|
82
|
-
ContextAPI.prototype.disable = function () {
|
|
83
|
-
this._getContextManager().disable();
|
|
84
|
-
unregisterGlobal(API_NAME);
|
|
85
|
-
};
|
|
86
|
-
return ContextAPI;
|
|
87
|
-
}());
|
|
88
|
-
export { ContextAPI };
|
|
89
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,IAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,IAAM,oBAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH;IAGE,+FAA+F;IAC/F;IAAuB,CAAC;IAExB,oDAAoD;IACtC,sBAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,4CAAuB,GAA9B,UAA+B,cAA8B;QAC3D,OAAO,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,2BAAM,GAAb;QACE,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;;OAOG;IACI,yBAAI,GAAX,UACE,OAAgB,EAChB,EAAK,EACL,OAA8B;;QAC9B,cAAU;aAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;YAAV,6BAAU;;QAEV,OAAO,CAAA,KAAA,IAAI,CAAC,kBAAkB,EAAE,CAAA,CAAC,IAAI,0BAAC,OAAO,EAAE,EAAE,EAAE,OAAO,GAAK,IAAI,GAAE;IACvE,CAAC;IAED;;;;;OAKG;IACI,yBAAI,GAAX,UAAe,OAAgB,EAAE,MAAS;QACxC,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAEO,uCAAkB,GAA1B;QACE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,4BAAO,GAAd;QACE,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACH,iBAAC;AAAD,CAAC,AAnED,IAmEC"}
|