@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
|
@@ -14,11 +14,22 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
|
+
};
|
|
17
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
28
|
exports.baggageEntryMetadataFromString = exports.createBaggage = void 0;
|
|
19
|
-
var
|
|
20
|
-
var baggage_impl_1 = require("./internal/baggage-impl");
|
|
29
|
+
var baggage_1 = require("./internal/baggage");
|
|
21
30
|
var symbol_1 = require("./internal/symbol");
|
|
31
|
+
__exportStar(require("./Baggage"), exports);
|
|
32
|
+
__exportStar(require("./Entry"), exports);
|
|
22
33
|
/**
|
|
23
34
|
* Create a new Baggage with optional entries
|
|
24
35
|
*
|
|
@@ -26,7 +37,7 @@ var symbol_1 = require("./internal/symbol");
|
|
|
26
37
|
*/
|
|
27
38
|
function createBaggage(entries) {
|
|
28
39
|
if (entries === void 0) { entries = {}; }
|
|
29
|
-
return new
|
|
40
|
+
return new baggage_1.BaggageImpl(new Map(Object.entries(entries)));
|
|
30
41
|
}
|
|
31
42
|
exports.createBaggage = createBaggage;
|
|
32
43
|
/**
|
|
@@ -37,7 +48,7 @@ exports.createBaggage = createBaggage;
|
|
|
37
48
|
*/
|
|
38
49
|
function baggageEntryMetadataFromString(str) {
|
|
39
50
|
if (typeof str !== 'string') {
|
|
40
|
-
|
|
51
|
+
// @TODO log diagnostic
|
|
41
52
|
str = '';
|
|
42
53
|
}
|
|
43
54
|
return {
|
|
@@ -48,4 +59,4 @@ function baggageEntryMetadataFromString(str) {
|
|
|
48
59
|
};
|
|
49
60
|
}
|
|
50
61
|
exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString;
|
|
51
|
-
//# sourceMappingURL=
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/baggage/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAIH,8CAAiD;AACjD,4CAA+D;AAE/D,4CAA0B;AAC1B,0CAAwB;AAExB;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,OAA0C;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,OAAO,IAAI,qBAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAJD,sCAIC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,uBAAuB;QACvB,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,mCAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAdD,wEAcC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Baggage
|
|
1
|
+
import type { Baggage } from '../Baggage';
|
|
2
|
+
import type { BaggageEntry } from '../Entry';
|
|
2
3
|
export declare class BaggageImpl implements Baggage {
|
|
3
4
|
private _entries;
|
|
4
5
|
constructor(entries?: Map<string, BaggageEntry>);
|
|
@@ -9,4 +10,4 @@ export declare class BaggageImpl implements Baggage {
|
|
|
9
10
|
removeEntries(...keys: string[]): BaggageImpl;
|
|
10
11
|
clear(): BaggageImpl;
|
|
11
12
|
}
|
|
12
|
-
//# sourceMappingURL=ba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ChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,mCAAa,GAAb;QAAc,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,yBAAiB;;QAC7B,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAkB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAAnB,IAAM,GAAG,aAAA;YACZ,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,2BAAK,GAAL;QACE,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACH,kBAAC;AAAD,CAAC,AA3CD,IA2CC;AA3CY,kCAAW"}
|
|
@@ -2,7 +2,7 @@ import * as types from './types';
|
|
|
2
2
|
export declare class NoopContextManager implements types.ContextManager {
|
|
3
3
|
active(): types.Context;
|
|
4
4
|
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(_context: types.Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
5
|
-
bind<T>(
|
|
5
|
+
bind<T>(target: T, _context?: types.Context): T;
|
|
6
6
|
enable(): this;
|
|
7
7
|
disable(): this;
|
|
8
8
|
}
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
18
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
19
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
20
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
21
|
+
r[k] = a[j];
|
|
22
|
+
return r;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
25
|
exports.NoopContextManager = void 0;
|
|
@@ -33,9 +35,9 @@ var NoopContextManager = /** @class */ (function () {
|
|
|
33
35
|
for (var _i = 3; _i < arguments.length; _i++) {
|
|
34
36
|
args[_i - 3] = arguments[_i];
|
|
35
37
|
}
|
|
36
|
-
return fn.call.apply(fn,
|
|
38
|
+
return fn.call.apply(fn, __spreadArrays([thisArg], args));
|
|
37
39
|
};
|
|
38
|
-
NoopContextManager.prototype.bind = function (
|
|
40
|
+
NoopContextManager.prototype.bind = function (target, _context) {
|
|
39
41
|
return target;
|
|
40
42
|
};
|
|
41
43
|
NoopContextManager.prototype.enable = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;AAEH,qCAAyC;AAGzC;IAAA;IAyBA,CAAC;IAxBC,mCAAM,GAAN;QACE,OAAO,sBAAY,CAAC;IACtB,CAAC;IAED,iCAAI,GAAJ,UACE,QAAuB,EACvB,EAAK,EACL,OAA8B;QAC9B,cAAU;aAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;YAAV,6BAAU;;QAEV,OAAO,EAAE,CAAC,IAAI,OAAP,EAAE,kBAAM,OAAO,GAAK,IAAI,GAAE;IACnC,CAAC;IAED,iCAAI,GAAJ,UAAQ,MAAS,EAAE,QAAwB;QACzC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mCAAM,GAAN;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oCAAO,GAAP;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,yBAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,gDAAkB"}
|
|
@@ -1,4 +1,63 @@
|
|
|
1
1
|
import { Context } from './types';
|
|
2
|
+
import { Baggage, Span, SpanContext } from '../';
|
|
3
|
+
/**
|
|
4
|
+
* Return the span if one exists
|
|
5
|
+
*
|
|
6
|
+
* @param context context to get span from
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSpan(context: Context): Span | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Set the span on a context
|
|
11
|
+
*
|
|
12
|
+
* @param context context to use as parent
|
|
13
|
+
* @param span span to set active
|
|
14
|
+
*/
|
|
15
|
+
export declare function setSpan(context: Context, span: Span): Context;
|
|
16
|
+
/**
|
|
17
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
18
|
+
* context
|
|
19
|
+
*
|
|
20
|
+
* @param context context to set active span on
|
|
21
|
+
* @param spanContext span context to be wrapped
|
|
22
|
+
*/
|
|
23
|
+
export declare function setSpanContext(context: Context, spanContext: SpanContext): Context;
|
|
24
|
+
/**
|
|
25
|
+
* Get the span context of the span if it exists.
|
|
26
|
+
*
|
|
27
|
+
* @param context context to get values from
|
|
28
|
+
*/
|
|
29
|
+
export declare function getSpanContext(context: Context): SpanContext | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Sets value on context to indicate that instrumentation should
|
|
32
|
+
* be suppressed beyond this current scope.
|
|
33
|
+
*
|
|
34
|
+
* @param context context to set the suppress instrumentation value on.
|
|
35
|
+
*/
|
|
36
|
+
export declare function suppressInstrumentation(context: Context): Context;
|
|
37
|
+
/**
|
|
38
|
+
* Sets value on context to indicate that instrumentation should
|
|
39
|
+
* no-longer be suppressed beyond this current scope.
|
|
40
|
+
*
|
|
41
|
+
* @param context context to set the suppress instrumentation value on.
|
|
42
|
+
*/
|
|
43
|
+
export declare function unsuppressInstrumentation(context: Context): Context;
|
|
44
|
+
/**
|
|
45
|
+
* Return current suppress instrumentation value for the given context,
|
|
46
|
+
* if it exists.
|
|
47
|
+
*
|
|
48
|
+
* @param context context check for the suppress instrumentation value.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isInstrumentationSuppressed(context: Context): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @param {Context} Context that manage all context values
|
|
53
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
54
|
+
*/
|
|
55
|
+
export declare function getBaggage(context: Context): Baggage | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* @param {Context} Context that manage all context values
|
|
58
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
59
|
+
*/
|
|
60
|
+
export declare function setBaggage(context: Context, baggage: Baggage): Context;
|
|
2
61
|
/** Get a key to uniquely identify a context value */
|
|
3
62
|
export declare function createContextKey(description: string): symbol;
|
|
4
63
|
/** The root context is used as the default parent context when there is no active context */
|
|
@@ -15,15 +15,109 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ROOT_CONTEXT = exports.createContextKey = void 0;
|
|
18
|
+
exports.ROOT_CONTEXT = exports.createContextKey = exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getSpanContext = exports.setSpanContext = exports.setSpan = exports.getSpan = void 0;
|
|
19
|
+
var NoopSpan_1 = require("../trace/NoopSpan");
|
|
20
|
+
/**
|
|
21
|
+
* span key
|
|
22
|
+
*/
|
|
23
|
+
var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');
|
|
24
|
+
/**
|
|
25
|
+
* Shared key for indicating if instrumentation should be suppressed beyond
|
|
26
|
+
* this current scope.
|
|
27
|
+
*/
|
|
28
|
+
var SUPPRESS_INSTRUMENTATION_KEY = createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION');
|
|
29
|
+
/**
|
|
30
|
+
* Baggage key
|
|
31
|
+
*/
|
|
32
|
+
var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
|
|
33
|
+
/**
|
|
34
|
+
* Return the span if one exists
|
|
35
|
+
*
|
|
36
|
+
* @param context context to get span from
|
|
37
|
+
*/
|
|
38
|
+
function getSpan(context) {
|
|
39
|
+
return context.getValue(SPAN_KEY) || undefined;
|
|
40
|
+
}
|
|
41
|
+
exports.getSpan = getSpan;
|
|
42
|
+
/**
|
|
43
|
+
* Set the span on a context
|
|
44
|
+
*
|
|
45
|
+
* @param context context to use as parent
|
|
46
|
+
* @param span span to set active
|
|
47
|
+
*/
|
|
48
|
+
function setSpan(context, span) {
|
|
49
|
+
return context.setValue(SPAN_KEY, span);
|
|
50
|
+
}
|
|
51
|
+
exports.setSpan = setSpan;
|
|
52
|
+
/**
|
|
53
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
54
|
+
* context
|
|
55
|
+
*
|
|
56
|
+
* @param context context to set active span on
|
|
57
|
+
* @param spanContext span context to be wrapped
|
|
58
|
+
*/
|
|
59
|
+
function setSpanContext(context, spanContext) {
|
|
60
|
+
return setSpan(context, new NoopSpan_1.NoopSpan(spanContext));
|
|
61
|
+
}
|
|
62
|
+
exports.setSpanContext = setSpanContext;
|
|
63
|
+
/**
|
|
64
|
+
* Get the span context of the span if it exists.
|
|
65
|
+
*
|
|
66
|
+
* @param context context to get values from
|
|
67
|
+
*/
|
|
68
|
+
function getSpanContext(context) {
|
|
69
|
+
var _a;
|
|
70
|
+
return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.context();
|
|
71
|
+
}
|
|
72
|
+
exports.getSpanContext = getSpanContext;
|
|
73
|
+
/**
|
|
74
|
+
* Sets value on context to indicate that instrumentation should
|
|
75
|
+
* be suppressed beyond this current scope.
|
|
76
|
+
*
|
|
77
|
+
* @param context context to set the suppress instrumentation value on.
|
|
78
|
+
*/
|
|
79
|
+
function suppressInstrumentation(context) {
|
|
80
|
+
return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true);
|
|
81
|
+
}
|
|
82
|
+
exports.suppressInstrumentation = suppressInstrumentation;
|
|
83
|
+
/**
|
|
84
|
+
* Sets value on context to indicate that instrumentation should
|
|
85
|
+
* no-longer be suppressed beyond this current scope.
|
|
86
|
+
*
|
|
87
|
+
* @param context context to set the suppress instrumentation value on.
|
|
88
|
+
*/
|
|
89
|
+
function unsuppressInstrumentation(context) {
|
|
90
|
+
return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false);
|
|
91
|
+
}
|
|
92
|
+
exports.unsuppressInstrumentation = unsuppressInstrumentation;
|
|
93
|
+
/**
|
|
94
|
+
* Return current suppress instrumentation value for the given context,
|
|
95
|
+
* if it exists.
|
|
96
|
+
*
|
|
97
|
+
* @param context context check for the suppress instrumentation value.
|
|
98
|
+
*/
|
|
99
|
+
function isInstrumentationSuppressed(context) {
|
|
100
|
+
return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY));
|
|
101
|
+
}
|
|
102
|
+
exports.isInstrumentationSuppressed = isInstrumentationSuppressed;
|
|
103
|
+
/**
|
|
104
|
+
* @param {Context} Context that manage all context values
|
|
105
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
106
|
+
*/
|
|
107
|
+
function getBaggage(context) {
|
|
108
|
+
return context.getValue(BAGGAGE_KEY) || undefined;
|
|
109
|
+
}
|
|
110
|
+
exports.getBaggage = getBaggage;
|
|
111
|
+
/**
|
|
112
|
+
* @param {Context} Context that manage all context values
|
|
113
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
114
|
+
*/
|
|
115
|
+
function setBaggage(context, baggage) {
|
|
116
|
+
return context.setValue(BAGGAGE_KEY, baggage);
|
|
117
|
+
}
|
|
118
|
+
exports.setBaggage = setBaggage;
|
|
19
119
|
/** Get a key to uniquely identify a context value */
|
|
20
120
|
function createContextKey(description) {
|
|
21
|
-
// The specification states that for the same input, multiple calls should
|
|
22
|
-
// return different keys. Due to the nature of the JS dependency management
|
|
23
|
-
// system, this creates problems where multiple versions of some package
|
|
24
|
-
// could hold different keys for the same property.
|
|
25
|
-
//
|
|
26
|
-
// Therefore, we use Symbol.for which returns the same key for the same input.
|
|
27
121
|
return Symbol.for(description);
|
|
28
122
|
}
|
|
29
123
|
exports.createContextKey = createContextKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,8CAA6C;AAE7C;;GAEG;AACH,IAAM,QAAQ,GAAG,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;AAEpE;;;GAGG;AACH,IAAM,4BAA4B,GAAG,gBAAgB,CACnD,oDAAoD,CACrD,CAAC;AAEF;;GAEG;AACH,IAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;GAIG;AACH,SAAgB,OAAO,CAAC,OAAgB;IACtC,OAAQ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU,IAAI,SAAS,CAAC;AAC3D,CAAC;AAFD,0BAEC;AAED;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,OAAgB,EAAE,IAAU;IAClD,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAFD,0BAEC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,OAAgB,EAChB,WAAwB;IAExB,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,mBAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AACrD,CAAC;AALD,wCAKC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;;IAC7C,aAAO,OAAO,CAAC,OAAO,CAAC,0CAAE,OAAO,GAAG;AACrC,CAAC;AAFD,wCAEC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,OAAO,OAA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CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,UAAC,GAAW;YAC7B,IAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAyBH,kBAAC;AAAD,CAAC,AApDD,IAoDC;AAED,6FAA6F;AAChF,QAAA,YAAY,GAAY,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -36,10 +36,10 @@ export interface ContextManager {
|
|
|
36
36
|
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
|
|
37
37
|
/**
|
|
38
38
|
* Bind an object as the current context (or a specific one)
|
|
39
|
-
* @param [context] Optionally specify the context which you want to assign
|
|
40
39
|
* @param target Any object to which a context need to be set
|
|
40
|
+
* @param [context] Optionally specify the context which you want to assign
|
|
41
41
|
*/
|
|
42
|
-
bind<T>(
|
|
42
|
+
bind<T>(target: T, context?: Context): T;
|
|
43
43
|
/**
|
|
44
44
|
* Enable context management
|
|
45
45
|
*/
|
|
@@ -61,10 +61,4 @@ export declare enum DiagLogLevel {
|
|
|
61
61
|
/** Used to set the logging level to include all logging */
|
|
62
62
|
ALL = 9999
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Defines options for ComponentLogger
|
|
66
|
-
*/
|
|
67
|
-
export interface ComponentLoggerOptions {
|
|
68
|
-
namespace: string;
|
|
69
|
-
}
|
|
70
64
|
//# sourceMappingURL=types.d.ts.map
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export * from './baggage
|
|
2
|
-
export { baggageEntryMetadataFromString } from './baggage/utils';
|
|
1
|
+
export * from './baggage';
|
|
3
2
|
export * from './common/Exception';
|
|
4
3
|
export * from './common/Time';
|
|
5
4
|
export * from './diag';
|
|
5
|
+
export * from './propagation/NoopTextMapPropagator';
|
|
6
6
|
export * from './propagation/TextMapPropagator';
|
|
7
7
|
export * from './trace/attributes';
|
|
8
|
+
export * from './trace/Event';
|
|
9
|
+
export * from './trace/link_context';
|
|
8
10
|
export * from './trace/link';
|
|
11
|
+
export * from './trace/NoopTracer';
|
|
12
|
+
export * from './trace/NoopTracerProvider';
|
|
9
13
|
export * from './trace/ProxyTracer';
|
|
10
14
|
export * from './trace/ProxyTracerProvider';
|
|
11
15
|
export * from './trace/Sampler';
|
|
@@ -15,12 +19,14 @@ export * from './trace/span_kind';
|
|
|
15
19
|
export * from './trace/span';
|
|
16
20
|
export * from './trace/SpanOptions';
|
|
17
21
|
export * from './trace/status';
|
|
22
|
+
export * from './trace/TimedEvent';
|
|
18
23
|
export * from './trace/trace_flags';
|
|
19
24
|
export * from './trace/trace_state';
|
|
20
25
|
export * from './trace/tracer_provider';
|
|
21
26
|
export * from './trace/tracer';
|
|
22
27
|
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
|
|
23
28
|
export * from './context/context';
|
|
29
|
+
export * from './context/NoopContextManager';
|
|
24
30
|
export * from './context/types';
|
|
25
31
|
import { ContextAPI } from './api/context';
|
|
26
32
|
export type { ContextAPI } from './api/context';
|
package/build/src/index.js
CHANGED
|
@@ -25,16 +25,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
25
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID =
|
|
29
|
-
__exportStar(require("./baggage
|
|
30
|
-
var utils_1 = require("./baggage/utils");
|
|
31
|
-
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
|
|
28
|
+
exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;
|
|
29
|
+
__exportStar(require("./baggage"), exports);
|
|
32
30
|
__exportStar(require("./common/Exception"), exports);
|
|
33
31
|
__exportStar(require("./common/Time"), exports);
|
|
34
32
|
__exportStar(require("./diag"), exports);
|
|
33
|
+
__exportStar(require("./propagation/NoopTextMapPropagator"), exports);
|
|
35
34
|
__exportStar(require("./propagation/TextMapPropagator"), exports);
|
|
36
35
|
__exportStar(require("./trace/attributes"), exports);
|
|
36
|
+
__exportStar(require("./trace/Event"), exports);
|
|
37
|
+
__exportStar(require("./trace/link_context"), exports);
|
|
37
38
|
__exportStar(require("./trace/link"), exports);
|
|
39
|
+
__exportStar(require("./trace/NoopTracer"), exports);
|
|
40
|
+
__exportStar(require("./trace/NoopTracerProvider"), exports);
|
|
38
41
|
__exportStar(require("./trace/ProxyTracer"), exports);
|
|
39
42
|
__exportStar(require("./trace/ProxyTracerProvider"), exports);
|
|
40
43
|
__exportStar(require("./trace/Sampler"), exports);
|
|
@@ -44,6 +47,7 @@ __exportStar(require("./trace/span_kind"), exports);
|
|
|
44
47
|
__exportStar(require("./trace/span"), exports);
|
|
45
48
|
__exportStar(require("./trace/SpanOptions"), exports);
|
|
46
49
|
__exportStar(require("./trace/status"), exports);
|
|
50
|
+
__exportStar(require("./trace/TimedEvent"), exports);
|
|
47
51
|
__exportStar(require("./trace/trace_flags"), exports);
|
|
48
52
|
__exportStar(require("./trace/trace_state"), exports);
|
|
49
53
|
__exportStar(require("./trace/tracer_provider"), exports);
|
|
@@ -56,6 +60,7 @@ Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: fu
|
|
|
56
60
|
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
|
|
57
61
|
Object.defineProperty(exports, "isValidSpanId", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } });
|
|
58
62
|
__exportStar(require("./context/context"), exports);
|
|
63
|
+
__exportStar(require("./context/NoopContextManager"), exports);
|
|
59
64
|
__exportStar(require("./context/types"), exports);
|
|
60
65
|
var context_1 = require("./api/context");
|
|
61
66
|
/** Entrypoint for context API */
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,4CAA0B;AAC1B,qDAAmC;AACnC,gDAA8B;AAC9B,yCAAuB;AACvB,sEAAoD;AACpD,kEAAgD;AAChD,qDAAmC;AACnC,gDAA8B;AAC9B,uDAAqC;AACrC,+CAA6B;AAC7B,qDAAmC;AACnC,6DAA2C;AAC3C,sDAAoC;AACpC,8DAA4C;AAC5C,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,iDAA+B;AAE/B,+DAOmC;AANjC,mHAAA,cAAc,OAAA;AACd,oHAAA,eAAe,OAAA;AACf,yHAAA,oBAAoB,OAAA;AACpB,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAGf,oDAAkC;AAClC,+DAA6C;AAC7C,kDAAgC;AAEhC,yCAA2C;AAE3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,qCAAuC;AAEvC,+BAA+B;AAClB,QAAA,KAAK,GAAG,gBAAQ,CAAC,WAAW,EAAE,CAAC;AAE5C,iDAAmD;AAEnD,qCAAqC;AACxB,QAAA,WAAW,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC;AAExD,mCAAqC;AAGrC;;;;;GAKG;AACU,QAAA,IAAI,GAAG,cAAO,CAAC,QAAQ,EAAE,CAAC;AAEvC,kBAAe;IACb,KAAK,eAAA;IACL,OAAO,iBAAA;IACP,WAAW,qBAAA;IACX,IAAI,cAAA;CACL,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { ContextManager } from '../context/types';
|
|
|
2
2
|
import { DiagLogger } from '../diag';
|
|
3
3
|
import { TextMapPropagator } from '../propagation/TextMapPropagator';
|
|
4
4
|
import type { TracerProvider } from '../trace/tracer_provider';
|
|
5
|
-
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], allowOverride?: boolean):
|
|
5
|
+
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], allowOverride?: boolean): void;
|
|
6
6
|
export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
|
|
7
7
|
export declare function unregisterGlobal(type: keyof OTelGlobalAPI): void;
|
|
8
8
|
declare type OTelGlobalAPI = {
|
|
@@ -26,24 +26,23 @@ var _global = platform_1._globalThis;
|
|
|
26
26
|
function registerGlobal(type, instance, allowOverride) {
|
|
27
27
|
var _a;
|
|
28
28
|
if (allowOverride === void 0) { allowOverride = false; }
|
|
29
|
-
|
|
29
|
+
_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
30
30
|
version: version_1.VERSION,
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
32
33
|
if (!allowOverride && api[type]) {
|
|
33
34
|
// already registered an API of this type
|
|
34
35
|
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
35
36
|
__1.diag.error(err.stack || err.message);
|
|
36
|
-
return
|
|
37
|
+
return;
|
|
37
38
|
}
|
|
38
39
|
if (api.version !== version_1.VERSION) {
|
|
39
40
|
// All registered APIs must be of the same version exactly
|
|
40
41
|
var err = new Error('@opentelemetry/api: All API registration versions must match');
|
|
41
42
|
__1.diag.error(err.stack || err.message);
|
|
42
|
-
return
|
|
43
|
+
return;
|
|
43
44
|
}
|
|
44
45
|
api[type] = instance;
|
|
45
|
-
__1.diag.debug("@opentelemetry/api: Registered a global for " + type + " v" + version_1.VERSION + ".");
|
|
46
|
-
return true;
|
|
47
46
|
}
|
|
48
47
|
exports.registerGlobal = registerGlobal;
|
|
49
48
|
function getGlobal(type) {
|
|
@@ -56,7 +55,6 @@ function getGlobal(type) {
|
|
|
56
55
|
}
|
|
57
56
|
exports.getGlobal = getGlobal;
|
|
58
57
|
function unregisterGlobal(type) {
|
|
59
|
-
__1.diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + version_1.VERSION + ".");
|
|
60
58
|
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
61
59
|
if (api) {
|
|
62
60
|
delete api[type];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../src/internal/global-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,wBAA0B;AAG1B,wCAA0C;AAG1C,sCAAqC;AACrC,mCAAwC;AAExC,IAA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D,IAAM,GAAG,GAAG,IAAI,KAAK,CACnB,8DAA8D,CAC/D,CAAC;QACF,QAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO;KACR;IAED,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;AACvB,CAAC;AA/BD,wCA+BC;AAED,SAAgB,SAAS,CACvB,IAAU;;IAEV,IAAM,aAAa,SAAG,OAAO,CAAC,4BAA4B,CAAC,0CAAE,OAAO,CAAC;IACrE,IAAI,CAAC,aAAa,IAAI,CAAC,qBAAY,CAAC,aAAa,CAAC,EAAE;QAClD,OAAO;KACR;IACD,aAAO,OAAO,CAAC,4BAA4B,CAAC,0CAAG,IAAI,EAAE;AACvD,CAAC;AARD,8BAQC;AAED,SAAgB,gBAAgB,CAAC,IAAyB;IACxD,IAAM,GAAG,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAElD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;KAClB;AACH,CAAC;AAND,4CAMC"}
|
|
@@ -10,4 +10,5 @@ export declare class NoopTextMapPropagator implements TextMapPropagator {
|
|
|
10
10
|
extract(context: Context, _carrier: unknown): Context;
|
|
11
11
|
fields(): string[];
|
|
12
12
|
}
|
|
13
|
+
export declare const NOOP_TEXT_MAP_PROPAGATOR: NoopTextMapPropagator;
|
|
13
14
|
//# sourceMappingURL=NoopTextMapPropagator.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.NoopTextMapPropagator = void 0;
|
|
18
|
+
exports.NOOP_TEXT_MAP_PROPAGATOR = exports.NoopTextMapPropagator = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* No-op implementations of {@link TextMapPropagator}.
|
|
21
21
|
*/
|
|
@@ -34,4 +34,5 @@ var NoopTextMapPropagator = /** @class */ (function () {
|
|
|
34
34
|
return NoopTextMapPropagator;
|
|
35
35
|
}());
|
|
36
36
|
exports.NoopTextMapPropagator = NoopTextMapPropagator;
|
|
37
|
+
exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
37
38
|
//# sourceMappingURL=NoopTextMapPropagator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH;IAAA;IAUA,CAAC;IATC,wCAAwC;IACxC,sCAAM,GAAN,UAAO,QAAiB,EAAE,QAAiB,IAAS,CAAC;IACrD,uEAAuE;IACvE,uCAAO,GAAP,UAAQ,OAAgB,EAAE,QAAiB;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,sCAAM,GAAN;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sDAAqB"}
|
|
1
|
+
{"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH;;GAEG;AACH;IAAA;IAUA,CAAC;IATC,wCAAwC;IACxC,sCAAM,GAAN,UAAO,QAAiB,EAAE,QAAiB,IAAS,CAAC;IACrD,uEAAuE;IACvE,uCAAO,GAAP,UAAQ,OAAgB,EAAE,QAAiB;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,sCAAM,GAAN;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sDAAqB;AAYrB,QAAA,wBAAwB,GAAG,IAAI,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SpanAttributes } from './attributes';
|
|
2
|
+
/** A text annotation with a set of attributes. */
|
|
3
|
+
export interface Event {
|
|
4
|
+
/** The name of the event. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The attributes of the event. */
|
|
7
|
+
attributes?: SpanAttributes;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Event.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
* Copyright The OpenTelemetry Authors
|
|
3
4
|
*
|
|
@@ -13,6 +14,5 @@
|
|
|
13
14
|
* See the License for the specific language governing permissions and
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
//# sourceMappingURL=Event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../../src/trace/Event.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -5,14 +5,14 @@ import { Span } from './span';
|
|
|
5
5
|
import { SpanContext } from './span_context';
|
|
6
6
|
import { SpanStatus } from './status';
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The NoopSpan is the default {@link Span} that is used when no Span
|
|
9
9
|
* implementation is available. All operations are no-op including context
|
|
10
10
|
* propagation.
|
|
11
11
|
*/
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class NoopSpan implements Span {
|
|
13
13
|
private readonly _spanContext;
|
|
14
14
|
constructor(_spanContext?: SpanContext);
|
|
15
|
-
|
|
15
|
+
context(): SpanContext;
|
|
16
16
|
setAttribute(_key: string, _value: unknown): this;
|
|
17
17
|
setAttributes(_attributes: SpanAttributes): this;
|
|
18
18
|
addEvent(_name: string, _attributes?: SpanAttributes): this;
|
|
@@ -22,4 +22,4 @@ export declare class NonRecordingSpan implements Span {
|
|
|
22
22
|
isRecording(): boolean;
|
|
23
23
|
recordException(_exception: Exception, _time?: TimeInput): void;
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=NoopSpan.d.ts.map
|
|
@@ -15,51 +15,51 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.NoopSpan = void 0;
|
|
19
19
|
var spancontext_utils_1 = require("./spancontext-utils");
|
|
20
20
|
/**
|
|
21
|
-
* The
|
|
21
|
+
* The NoopSpan is the default {@link Span} that is used when no Span
|
|
22
22
|
* implementation is available. All operations are no-op including context
|
|
23
23
|
* propagation.
|
|
24
24
|
*/
|
|
25
|
-
var
|
|
26
|
-
function
|
|
25
|
+
var NoopSpan = /** @class */ (function () {
|
|
26
|
+
function NoopSpan(_spanContext) {
|
|
27
27
|
if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; }
|
|
28
28
|
this._spanContext = _spanContext;
|
|
29
29
|
}
|
|
30
30
|
// Returns a SpanContext.
|
|
31
|
-
|
|
31
|
+
NoopSpan.prototype.context = function () {
|
|
32
32
|
return this._spanContext;
|
|
33
33
|
};
|
|
34
34
|
// By default does nothing
|
|
35
|
-
|
|
35
|
+
NoopSpan.prototype.setAttribute = function (_key, _value) {
|
|
36
36
|
return this;
|
|
37
37
|
};
|
|
38
38
|
// By default does nothing
|
|
39
|
-
|
|
39
|
+
NoopSpan.prototype.setAttributes = function (_attributes) {
|
|
40
40
|
return this;
|
|
41
41
|
};
|
|
42
42
|
// By default does nothing
|
|
43
|
-
|
|
43
|
+
NoopSpan.prototype.addEvent = function (_name, _attributes) {
|
|
44
44
|
return this;
|
|
45
45
|
};
|
|
46
46
|
// By default does nothing
|
|
47
|
-
|
|
47
|
+
NoopSpan.prototype.setStatus = function (_status) {
|
|
48
48
|
return this;
|
|
49
49
|
};
|
|
50
50
|
// By default does nothing
|
|
51
|
-
|
|
51
|
+
NoopSpan.prototype.updateName = function (_name) {
|
|
52
52
|
return this;
|
|
53
53
|
};
|
|
54
54
|
// By default does nothing
|
|
55
|
-
|
|
56
|
-
// isRecording always returns false for
|
|
57
|
-
|
|
55
|
+
NoopSpan.prototype.end = function (_endTime) { };
|
|
56
|
+
// isRecording always returns false for noopSpan.
|
|
57
|
+
NoopSpan.prototype.isRecording = function () {
|
|
58
58
|
return false;
|
|
59
59
|
};
|
|
60
60
|
// By default does nothing
|
|
61
|
-
|
|
62
|
-
return
|
|
61
|
+
NoopSpan.prototype.recordException = function (_exception, _time) { };
|
|
62
|
+
return NoopSpan;
|
|
63
63
|
}());
|
|
64
|
-
exports.
|
|
65
|
-
//# sourceMappingURL=
|
|
64
|
+
exports.NoopSpan = NoopSpan;
|
|
65
|
+
//# sourceMappingURL=NoopSpan.js.map
|