@opentelemetry/api 1.0.0-rc.3 → 1.0.3
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 +130 -0
- package/README.md +53 -6
- package/build/esm/api/context.d.ts +41 -0
- package/build/esm/api/context.js +90 -0
- package/build/esm/api/context.js.map +1 -0
- package/build/esm/api/diag.d.ts +38 -0
- package/build/esm/api/diag.js +89 -0
- package/build/esm/api/diag.js.map +1 -0
- package/build/esm/api/propagation.d.ts +48 -0
- package/build/esm/api/propagation.js +88 -0
- package/build/esm/api/propagation.js.map +1 -0
- package/build/esm/api/trace.d.ts +39 -0
- package/build/esm/api/trace.js +76 -0
- package/build/esm/api/trace.js.map +1 -0
- package/build/esm/baggage/context-helpers.d.ts +23 -0
- package/build/esm/baggage/context-helpers.js +47 -0
- package/build/esm/baggage/context-helpers.js.map +1 -0
- package/build/{src/baggage/internal/baggage.d.ts → esm/baggage/internal/baggage-impl.d.ts} +2 -3
- package/build/esm/baggage/internal/baggage-impl.js +61 -0
- package/build/esm/baggage/internal/baggage-impl.js.map +1 -0
- package/build/esm/baggage/internal/symbol.d.ts +5 -0
- package/build/esm/baggage/internal/symbol.js +20 -0
- package/build/esm/baggage/internal/symbol.js.map +1 -0
- package/build/{src/baggage/Baggage.d.ts → esm/baggage/types.d.ts} +20 -2
- package/build/{src/trace/Event.js → esm/baggage/types.js} +2 -3
- package/build/esm/baggage/types.js.map +1 -0
- package/build/{src/baggage/index.d.ts → esm/baggage/utils.d.ts} +2 -5
- package/build/esm/baggage/utils.js +47 -0
- package/build/esm/baggage/utils.js.map +1 -0
- package/build/esm/common/Exception.d.ts +26 -0
- package/build/{src/baggage/Baggage.js → esm/common/Exception.js} +2 -3
- package/build/esm/common/Exception.js.map +1 -0
- package/build/esm/common/Time.d.ts +8 -0
- package/build/esm/common/Time.js +2 -0
- package/build/esm/common/Time.js.map +1 -0
- package/build/esm/context/NoopContextManager.d.ts +9 -0
- package/build/esm/context/NoopContextManager.js +47 -0
- package/build/esm/context/NoopContextManager.js.map +1 -0
- package/build/esm/context/context.d.ts +6 -0
- package/build/esm/context/context.js +52 -0
- package/build/esm/context/context.js.map +1 -0
- package/build/esm/context/types.d.ts +52 -0
- package/build/{src/trace/TimedEvent.js → esm/context/types.js} +2 -3
- package/build/esm/context/types.js.map +1 -0
- package/build/esm/diag/ComponentLogger.d.ts +20 -0
- package/build/esm/diag/ComponentLogger.js +77 -0
- package/build/esm/diag/ComponentLogger.js.map +1 -0
- package/build/esm/diag/consoleLogger.d.ts +38 -0
- package/build/esm/diag/consoleLogger.js +54 -0
- package/build/esm/diag/consoleLogger.js.map +1 -0
- package/build/esm/diag/index.d.ts +3 -0
- package/build/esm/diag/index.js +18 -0
- package/build/esm/diag/index.js.map +1 -0
- package/build/esm/diag/internal/logLevelLogger.d.ts +3 -0
- package/build/esm/diag/internal/logLevelLogger.js +41 -0
- package/build/esm/diag/internal/logLevelLogger.js.map +1 -0
- package/build/esm/diag/internal/noopLogger.d.ts +8 -0
- package/build/esm/diag/internal/noopLogger.js +31 -0
- package/build/esm/diag/internal/noopLogger.js.map +1 -0
- package/build/esm/diag/types.d.ts +70 -0
- package/build/esm/diag/types.js +41 -0
- package/build/esm/diag/types.js.map +1 -0
- package/build/esm/index.d.ts +54 -0
- package/build/esm/index.js +64 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/internal/global-utils.d.ts +16 -0
- package/build/esm/internal/global-utils.js +59 -0
- package/build/esm/internal/global-utils.js.map +1 -0
- package/build/esm/internal/semver.d.ts +34 -0
- package/build/esm/internal/semver.js +118 -0
- package/build/esm/internal/semver.js.map +1 -0
- package/build/esm/platform/browser/globalThis.d.ts +3 -0
- package/build/esm/platform/browser/globalThis.js +19 -0
- package/build/esm/platform/browser/globalThis.js.map +1 -0
- package/build/esm/platform/browser/index.d.ts +2 -0
- package/build/esm/platform/browser/index.js +17 -0
- package/build/esm/platform/browser/index.js.map +1 -0
- package/build/esm/platform/index.d.ts +2 -0
- package/build/esm/platform/index.js +17 -0
- package/build/esm/platform/index.js.map +1 -0
- package/build/esm/platform/node/globalThis.d.ts +3 -0
- package/build/esm/platform/node/globalThis.js +19 -0
- package/build/esm/platform/node/globalThis.js.map +1 -0
- package/build/esm/platform/node/index.d.ts +2 -0
- package/build/esm/platform/node/index.js +17 -0
- package/build/esm/platform/node/index.js.map +1 -0
- package/build/esm/propagation/NoopTextMapPropagator.d.ts +13 -0
- package/build/esm/propagation/NoopTextMapPropagator.js +34 -0
- package/build/esm/propagation/NoopTextMapPropagator.js.map +1 -0
- package/build/esm/propagation/TextMapPropagator.d.ts +84 -0
- package/build/esm/propagation/TextMapPropagator.js +38 -0
- package/build/esm/propagation/TextMapPropagator.js.map +1 -0
- package/build/{src/trace/NoopSpan.d.ts → esm/trace/NonRecordingSpan.d.ts} +4 -4
- package/build/{src/trace/NoopSpan.js → esm/trace/NonRecordingSpan.js} +18 -21
- package/build/esm/trace/NonRecordingSpan.js.map +1 -0
- package/build/esm/trace/NoopTracer.d.ts +14 -0
- package/build/esm/trace/NoopTracer.js +75 -0
- package/build/esm/trace/NoopTracer.js.map +1 -0
- package/build/esm/trace/NoopTracerProvider.d.ts +12 -0
- package/build/esm/trace/NoopTracerProvider.js +32 -0
- package/build/esm/trace/NoopTracerProvider.js.map +1 -0
- package/build/esm/trace/ProxyTracer.d.ts +25 -0
- package/build/esm/trace/ProxyTracer.js +52 -0
- package/build/esm/trace/ProxyTracer.js.map +1 -0
- package/build/esm/trace/ProxyTracerProvider.d.ts +24 -0
- package/build/esm/trace/ProxyTracerProvider.js +54 -0
- package/build/esm/trace/ProxyTracerProvider.js.map +1 -0
- package/build/esm/trace/Sampler.d.ts +30 -0
- package/build/esm/trace/Sampler.js +17 -0
- package/build/esm/trace/Sampler.js.map +1 -0
- package/build/esm/trace/SamplingResult.d.ts +39 -0
- package/build/esm/trace/SamplingResult.js +38 -0
- package/build/esm/trace/SamplingResult.js.map +1 -0
- package/build/esm/trace/SpanOptions.d.ts +23 -0
- package/build/esm/trace/SpanOptions.js +17 -0
- package/build/esm/trace/SpanOptions.js.map +1 -0
- package/build/esm/trace/attributes.d.ts +10 -0
- package/build/esm/trace/attributes.js +17 -0
- package/build/esm/trace/attributes.js.map +1 -0
- package/build/esm/trace/context-utils.d.ts +37 -0
- package/build/esm/trace/context-utils.js +66 -0
- package/build/esm/trace/context-utils.js.map +1 -0
- package/build/esm/trace/invalid-span-constants.d.ts +5 -0
- package/build/esm/trace/invalid-span-constants.js +24 -0
- package/build/esm/trace/invalid-span-constants.js.map +1 -0
- package/build/esm/trace/link.d.ts +24 -0
- package/build/esm/trace/link.js +17 -0
- package/build/esm/trace/link.js.map +1 -0
- package/build/esm/trace/span.d.ts +101 -0
- package/build/esm/trace/span.js +17 -0
- package/build/esm/trace/span.js.map +1 -0
- package/build/esm/trace/span_context.d.ts +53 -0
- package/build/esm/trace/span_context.js +17 -0
- package/build/esm/trace/span_context.js.map +1 -0
- package/build/esm/trace/span_kind.d.ts +27 -0
- package/build/esm/trace/span_kind.js +43 -0
- package/build/esm/trace/span_kind.js.map +1 -0
- package/build/esm/trace/spancontext-utils.d.ts +17 -0
- package/build/esm/trace/spancontext-utils.js +42 -0
- package/build/esm/trace/spancontext-utils.js.map +1 -0
- package/build/esm/trace/status.d.ts +25 -0
- package/build/esm/trace/status.js +20 -0
- package/build/esm/trace/status.js.map +1 -0
- package/build/esm/trace/trace_flags.d.ts +7 -0
- package/build/esm/trace/trace_flags.js +23 -0
- package/build/esm/trace/trace_flags.js.map +1 -0
- package/build/esm/trace/trace_state.d.ts +38 -0
- package/build/esm/trace/trace_state.js +17 -0
- package/build/esm/trace/trace_state.js.map +1 -0
- package/build/esm/trace/tracer.d.ts +71 -0
- package/build/esm/trace/tracer.js +17 -0
- package/build/esm/trace/tracer.js.map +1 -0
- package/build/esm/trace/tracer_provider.d.ts +19 -0
- package/build/esm/trace/tracer_provider.js +17 -0
- package/build/esm/trace/tracer_provider.js.map +1 -0
- package/build/esm/version.d.ts +2 -0
- package/build/esm/version.js +18 -0
- package/build/esm/version.js.map +1 -0
- package/build/src/api/context.d.ts +6 -4
- package/build/src/api/context.js +14 -15
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +7 -3
- package/build/src/api/diag.js +16 -4
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/propagation.d.ts +10 -2
- package/build/src/api/propagation.js +15 -6
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +12 -3
- package/build/src/api/trace.js +18 -6
- package/build/src/api/trace.js.map +1 -1
- package/build/src/baggage/context-helpers.d.ts +23 -0
- package/build/src/baggage/context-helpers.js +53 -0
- package/build/src/baggage/context-helpers.js.map +1 -0
- package/build/src/baggage/internal/baggage-impl.d.ts +12 -0
- package/build/src/baggage/internal/{baggage.js → baggage-impl.js} +1 -1
- package/build/src/baggage/internal/baggage-impl.js.map +1 -0
- package/build/src/baggage/types.d.ts +60 -0
- package/build/src/baggage/{Entry.js → types.js} +1 -1
- package/build/src/baggage/types.js.map +1 -0
- package/build/src/baggage/utils.d.ts +15 -0
- package/build/src/baggage/{index.js → utils.js} +6 -16
- package/build/src/baggage/utils.js.map +1 -0
- package/build/src/context/NoopContextManager.d.ts +1 -1
- package/build/src/context/NoopContextManager.js +6 -8
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.d.ts +0 -59
- package/build/src/context/context.js +7 -101
- package/build/src/context/context.js.map +1 -1
- package/build/src/context/types.d.ts +2 -2
- package/build/src/diag/ComponentLogger.d.ts +20 -0
- package/build/src/diag/ComponentLogger.js +80 -0
- package/build/src/diag/ComponentLogger.js.map +1 -0
- package/build/src/diag/types.d.ts +6 -0
- package/build/src/index.d.ts +4 -9
- package/build/src/index.js +8 -12
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +2 -2
- package/build/src/internal/global-utils.js +12 -11
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/internal/semver.js +13 -1
- package/build/src/internal/semver.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.d.ts +0 -1
- package/build/src/propagation/NoopTextMapPropagator.js +1 -2
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/trace/NonRecordingSpan.d.ts +25 -0
- package/build/src/trace/NonRecordingSpan.js +65 -0
- package/build/src/trace/NonRecordingSpan.js.map +1 -0
- package/build/src/trace/NoopTracer.d.ts +3 -1
- package/build/src/trace/NoopTracer.js +33 -8
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.d.ts +0 -1
- package/build/src/trace/NoopTracerProvider.js +2 -3
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.d.ts +5 -2
- package/build/src/trace/ProxyTracer.js +6 -1
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.js +2 -1
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/context-utils.d.ts +37 -0
- package/build/src/trace/context-utils.js +74 -0
- package/build/src/trace/context-utils.js.map +1 -0
- package/build/src/trace/invalid-span-constants.d.ts +5 -0
- package/build/src/trace/invalid-span-constants.js +27 -0
- package/build/src/trace/invalid-span-constants.js.map +1 -0
- package/build/src/trace/link.d.ts +3 -3
- package/build/src/trace/span.d.ts +1 -1
- package/build/src/trace/spancontext-utils.d.ts +8 -3
- package/build/src/trace/spancontext-utils.js +30 -11
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace/tracer.d.ts +47 -0
- 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 +27 -19
- package/build/src/baggage/Baggage.js.map +0 -1
- package/build/src/baggage/Entry.d.ts +0 -20
- package/build/src/baggage/Entry.js.map +0 -1
- package/build/src/baggage/index.js.map +0 -1
- package/build/src/baggage/internal/baggage.js.map +0 -1
- package/build/src/trace/Event.d.ts +0 -9
- package/build/src/trace/Event.js.map +0 -1
- package/build/src/trace/NoopSpan.js.map +0 -1
- package/build/src/trace/TimedEvent.d.ts +0 -10
- package/build/src/trace/TimedEvent.js.map +0 -1
- package/build/src/trace/link_context.d.ts +0 -6
- package/build/src/trace/link_context.js +0 -18
- package/build/src/trace/link_context.js.map +0 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.isCompatible = exports._makeCompatibilityCheck = void 0;
|
|
19
19
|
var version_1 = require("../version");
|
|
20
|
-
var re = /^(\d+)\.(\d+)\.(\d+)(
|
|
20
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
21
21
|
/**
|
|
22
22
|
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
|
23
23
|
*
|
|
@@ -46,7 +46,14 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
46
46
|
major: +myVersionMatch[1],
|
|
47
47
|
minor: +myVersionMatch[2],
|
|
48
48
|
patch: +myVersionMatch[3],
|
|
49
|
+
prerelease: myVersionMatch[4],
|
|
49
50
|
};
|
|
51
|
+
// if ownVersion has a prerelease tag, versions must match exactly
|
|
52
|
+
if (ownVersionParsed.prerelease != null) {
|
|
53
|
+
return function isExactmatch(globalVersion) {
|
|
54
|
+
return globalVersion === ownVersion;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
50
57
|
function _reject(v) {
|
|
51
58
|
rejectedVersions.add(v);
|
|
52
59
|
return false;
|
|
@@ -72,7 +79,12 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
72
79
|
major: +globalVersionMatch[1],
|
|
73
80
|
minor: +globalVersionMatch[2],
|
|
74
81
|
patch: +globalVersionMatch[3],
|
|
82
|
+
prerelease: globalVersionMatch[4],
|
|
75
83
|
};
|
|
84
|
+
// if globalVersion has a prerelease tag, versions must match exactly
|
|
85
|
+
if (globalVersionParsed.prerelease != null) {
|
|
86
|
+
return _reject(globalVersion);
|
|
87
|
+
}
|
|
76
88
|
// major versions must match
|
|
77
89
|
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
78
90
|
return _reject(globalVersion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/internal/semver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sCAAqC;AAErC,IAAM,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/internal/semver.ts"],"names":[],"mappings":"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"}
|
|
@@ -10,5 +10,4 @@ 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;
|
|
14
13
|
//# 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.
|
|
18
|
+
exports.NoopTextMapPropagator = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* No-op implementations of {@link TextMapPropagator}.
|
|
21
21
|
*/
|
|
@@ -34,5 +34,4 @@ var NoopTextMapPropagator = /** @class */ (function () {
|
|
|
34
34
|
return NoopTextMapPropagator;
|
|
35
35
|
}());
|
|
36
36
|
exports.NoopTextMapPropagator = NoopTextMapPropagator;
|
|
37
|
-
exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
38
37
|
//# 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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Exception } from '../common/Exception';
|
|
2
|
+
import { TimeInput } from '../common/Time';
|
|
3
|
+
import { SpanAttributes } from './attributes';
|
|
4
|
+
import { Span } from './span';
|
|
5
|
+
import { SpanContext } from './span_context';
|
|
6
|
+
import { SpanStatus } from './status';
|
|
7
|
+
/**
|
|
8
|
+
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
|
9
|
+
* implementation is available. All operations are no-op including context
|
|
10
|
+
* propagation.
|
|
11
|
+
*/
|
|
12
|
+
export declare class NonRecordingSpan implements Span {
|
|
13
|
+
private readonly _spanContext;
|
|
14
|
+
constructor(_spanContext?: SpanContext);
|
|
15
|
+
spanContext(): SpanContext;
|
|
16
|
+
setAttribute(_key: string, _value: unknown): this;
|
|
17
|
+
setAttributes(_attributes: SpanAttributes): this;
|
|
18
|
+
addEvent(_name: string, _attributes?: SpanAttributes): this;
|
|
19
|
+
setStatus(_status: SpanStatus): this;
|
|
20
|
+
updateName(_name: string): this;
|
|
21
|
+
end(_endTime?: TimeInput): void;
|
|
22
|
+
isRecording(): boolean;
|
|
23
|
+
recordException(_exception: Exception, _time?: TimeInput): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=NonRecordingSpan.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
exports.NonRecordingSpan = void 0;
|
|
19
|
+
var invalid_span_constants_1 = require("./invalid-span-constants");
|
|
20
|
+
/**
|
|
21
|
+
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
|
22
|
+
* implementation is available. All operations are no-op including context
|
|
23
|
+
* propagation.
|
|
24
|
+
*/
|
|
25
|
+
var NonRecordingSpan = /** @class */ (function () {
|
|
26
|
+
function NonRecordingSpan(_spanContext) {
|
|
27
|
+
if (_spanContext === void 0) { _spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT; }
|
|
28
|
+
this._spanContext = _spanContext;
|
|
29
|
+
}
|
|
30
|
+
// Returns a SpanContext.
|
|
31
|
+
NonRecordingSpan.prototype.spanContext = function () {
|
|
32
|
+
return this._spanContext;
|
|
33
|
+
};
|
|
34
|
+
// By default does nothing
|
|
35
|
+
NonRecordingSpan.prototype.setAttribute = function (_key, _value) {
|
|
36
|
+
return this;
|
|
37
|
+
};
|
|
38
|
+
// By default does nothing
|
|
39
|
+
NonRecordingSpan.prototype.setAttributes = function (_attributes) {
|
|
40
|
+
return this;
|
|
41
|
+
};
|
|
42
|
+
// By default does nothing
|
|
43
|
+
NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {
|
|
44
|
+
return this;
|
|
45
|
+
};
|
|
46
|
+
// By default does nothing
|
|
47
|
+
NonRecordingSpan.prototype.setStatus = function (_status) {
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
// By default does nothing
|
|
51
|
+
NonRecordingSpan.prototype.updateName = function (_name) {
|
|
52
|
+
return this;
|
|
53
|
+
};
|
|
54
|
+
// By default does nothing
|
|
55
|
+
NonRecordingSpan.prototype.end = function (_endTime) { };
|
|
56
|
+
// isRecording always returns false for NonRecordingSpan.
|
|
57
|
+
NonRecordingSpan.prototype.isRecording = function () {
|
|
58
|
+
return false;
|
|
59
|
+
};
|
|
60
|
+
// By default does nothing
|
|
61
|
+
NonRecordingSpan.prototype.recordException = function (_exception, _time) { };
|
|
62
|
+
return NonRecordingSpan;
|
|
63
|
+
}());
|
|
64
|
+
exports.NonRecordingSpan = NonRecordingSpan;
|
|
65
|
+
//# sourceMappingURL=NonRecordingSpan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonRecordingSpan.js","sourceRoot":"","sources":["../../../src/trace/NonRecordingSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,mEAAgE;AAKhE;;;;GAIG;AACH;IACE,0BACmB,YAAgD;QAAhD,6BAAA,EAAA,eAA4B,6CAAoB;QAAhD,iBAAY,GAAZ,YAAY,CAAoC;IAChE,CAAC;IAEJ,yBAAyB;IACzB,sCAAW,GAAX;QACE,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,0BAA0B;IAC1B,uCAAY,GAAZ,UAAa,IAAY,EAAE,MAAe;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,wCAAa,GAAb,UAAc,WAA2B;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,mCAAQ,GAAR,UAAS,KAAa,EAAE,WAA4B;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,oCAAS,GAAT,UAAU,OAAmB;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,qCAAU,GAAV,UAAW,KAAa;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,8BAAG,GAAH,UAAI,QAAoB,IAAS,CAAC;IAElC,yDAAyD;IACzD,sCAAW,GAAX;QACE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,0CAAe,GAAf,UAAgB,UAAqB,EAAE,KAAiB,IAAS,CAAC;IACpE,uBAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,4CAAgB"}
|
|
@@ -7,6 +7,8 @@ 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>;
|
|
10
13
|
}
|
|
11
|
-
export declare const NOOP_TRACER: NoopTracer;
|
|
12
14
|
//# sourceMappingURL=NoopTracer.d.ts.map
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
var context_1 = require("../
|
|
20
|
-
var
|
|
18
|
+
exports.NoopTracer = void 0;
|
|
19
|
+
var context_1 = require("../api/context");
|
|
20
|
+
var context_utils_1 = require("../trace/context-utils");
|
|
21
|
+
var NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
21
22
|
var spancontext_utils_1 = require("./spancontext-utils");
|
|
23
|
+
var context = context_1.ContextAPI.getInstance();
|
|
22
24
|
/**
|
|
23
25
|
* No-op implementations of {@link Tracer}.
|
|
24
26
|
*/
|
|
@@ -29,17 +31,41 @@ var NoopTracer = /** @class */ (function () {
|
|
|
29
31
|
NoopTracer.prototype.startSpan = function (name, options, context) {
|
|
30
32
|
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
31
33
|
if (root) {
|
|
32
|
-
return new
|
|
34
|
+
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
33
35
|
}
|
|
34
|
-
var parentFromContext = context &&
|
|
36
|
+
var parentFromContext = context && context_utils_1.getSpanContext(context);
|
|
35
37
|
if (isSpanContext(parentFromContext) &&
|
|
36
38
|
spancontext_utils_1.isSpanContextValid(parentFromContext)) {
|
|
37
|
-
return new
|
|
39
|
+
return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);
|
|
38
40
|
}
|
|
39
41
|
else {
|
|
40
|
-
return new
|
|
42
|
+
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
41
43
|
}
|
|
42
44
|
};
|
|
45
|
+
NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {
|
|
46
|
+
var opts;
|
|
47
|
+
var ctx;
|
|
48
|
+
var fn;
|
|
49
|
+
if (arguments.length < 2) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
else if (arguments.length === 2) {
|
|
53
|
+
fn = arg2;
|
|
54
|
+
}
|
|
55
|
+
else if (arguments.length === 3) {
|
|
56
|
+
opts = arg2;
|
|
57
|
+
fn = arg3;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
opts = arg2;
|
|
61
|
+
ctx = arg3;
|
|
62
|
+
fn = arg4;
|
|
63
|
+
}
|
|
64
|
+
var parentContext = ctx !== null && ctx !== void 0 ? ctx : context.active();
|
|
65
|
+
var span = this.startSpan(name, opts, parentContext);
|
|
66
|
+
var contextWithSpanSet = context_utils_1.setSpan(parentContext, span);
|
|
67
|
+
return context.with(contextWithSpanSet, fn, undefined, span);
|
|
68
|
+
};
|
|
43
69
|
return NoopTracer;
|
|
44
70
|
}());
|
|
45
71
|
exports.NoopTracer = NoopTracer;
|
|
@@ -49,5 +75,4 @@ function isSpanContext(spanContext) {
|
|
|
49
75
|
typeof spanContext['traceId'] === 'string' &&
|
|
50
76
|
typeof spanContext['traceFlags'] === 'number');
|
|
51
77
|
}
|
|
52
|
-
exports.NOOP_TRACER = new NoopTracer();
|
|
53
78
|
//# 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,0CAA4C;AAE5C,wDAAiE;AACjE,uDAAsD;AAEtD,yDAAyD;AAKzD,IAAM,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEzC;;GAEG;AACH;IAAA;IAgEA,CAAC;IA/DC,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,mCAAgB,EAAE,CAAC;SAC/B;QAED,IAAM,iBAAiB,GAAG,OAAO,IAAI,8BAAc,CAAC,OAAO,CAAC,CAAC;QAE7D,IACE,aAAa,CAAC,iBAAiB,CAAC;YAChC,sCAAkB,CAAC,iBAAiB,CAAC,EACrC;YACA,OAAO,IAAI,mCAAgB,CAAC,iBAAiB,CAAC,CAAC;SAChD;aAAM;YACL,OAAO,IAAI,mCAAgB,EAAE,CAAC;SAC/B;IACH,CAAC;IAiBD,oCAAe,GAAf,UACE,IAAY,EACZ,IAAsB,EACtB,IAAkB,EAClB,IAAQ;QAER,IAAI,IAA6B,CAAC;QAClC,IAAI,GAAwB,CAAC;QAC7B,IAAI,EAAK,CAAC;QAEV,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO;SACR;aAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,EAAE,GAAG,IAAS,CAAC;SAChB;aAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,IAAI,GAAG,IAA+B,CAAC;YACvC,EAAE,GAAG,IAAS,CAAC;SAChB;aAAM;YACL,IAAI,GAAG,IAA+B,CAAC;YACvC,GAAG,GAAG,IAA2B,CAAC;YAClC,EAAE,GAAG,IAAS,CAAC;SAChB;QAED,IAAM,aAAa,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACvD,IAAM,kBAAkB,GAAG,uBAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAExD,OAAO,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IACH,iBAAC;AAAD,CAAC,AAhED,IAgEC;AAhEY,gCAAU;AAkEvB,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"}
|
|
@@ -9,5 +9,4 @@ 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;
|
|
13
12
|
//# 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.
|
|
18
|
+
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,10 +27,9 @@ var NoopTracerProvider = /** @class */ (function () {
|
|
|
27
27
|
function NoopTracerProvider() {
|
|
28
28
|
}
|
|
29
29
|
NoopTracerProvider.prototype.getTracer = function (_name, _version) {
|
|
30
|
-
return NoopTracer_1.
|
|
30
|
+
return new NoopTracer_1.NoopTracer();
|
|
31
31
|
};
|
|
32
32
|
return NoopTracerProvider;
|
|
33
33
|
}());
|
|
34
34
|
exports.NoopTracerProvider = NoopTracerProvider;
|
|
35
|
-
exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
36
35
|
//# 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,2CAA0C;AAI1C;;;;;GAKG;AACH;IAAA;IAIA,CAAC;IAHC,sCAAS,GAAT,UAAU,KAAc,EAAE,QAAiB;QACzC,OAAO,IAAI,uBAAU,EAAE,CAAC;IAC1B,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,IAIC;AAJY,gDAAkB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Context } from '../context/types';
|
|
2
|
-
import { ProxyTracerProvider } from './ProxyTracerProvider';
|
|
3
2
|
import { Span } from './span';
|
|
4
3
|
import { SpanOptions } from './SpanOptions';
|
|
5
4
|
import { Tracer } from './tracer';
|
|
@@ -11,12 +10,16 @@ export declare class ProxyTracer implements Tracer {
|
|
|
11
10
|
readonly name: string;
|
|
12
11
|
readonly version?: string | undefined;
|
|
13
12
|
private _delegate?;
|
|
14
|
-
constructor(_provider:
|
|
13
|
+
constructor(_provider: TracerDelegator, name: string, version?: string | undefined);
|
|
15
14
|
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
|
15
|
+
startActiveSpan<F extends (span: Span) => unknown>(_name: string, _options: F | SpanOptions, _context?: F | Context, _fn?: F): ReturnType<F>;
|
|
16
16
|
/**
|
|
17
17
|
* Try to get a tracer from the proxy tracer provider.
|
|
18
18
|
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
19
19
|
*/
|
|
20
20
|
private _getTracer;
|
|
21
21
|
}
|
|
22
|
+
export interface TracerDelegator {
|
|
23
|
+
getDelegateTracer(name: string, version?: string): Tracer | undefined;
|
|
24
|
+
}
|
|
22
25
|
//# sourceMappingURL=ProxyTracer.d.ts.map
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.ProxyTracer = void 0;
|
|
19
19
|
var NoopTracer_1 = require("./NoopTracer");
|
|
20
|
+
var NOOP_TRACER = new NoopTracer_1.NoopTracer();
|
|
20
21
|
/**
|
|
21
22
|
* Proxy tracer provided by the proxy tracer provider
|
|
22
23
|
*/
|
|
@@ -29,6 +30,10 @@ var ProxyTracer = /** @class */ (function () {
|
|
|
29
30
|
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
|
30
31
|
return this._getTracer().startSpan(name, options, context);
|
|
31
32
|
};
|
|
33
|
+
ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {
|
|
34
|
+
var tracer = this._getTracer();
|
|
35
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
36
|
+
};
|
|
32
37
|
/**
|
|
33
38
|
* Try to get a tracer from the proxy tracer provider.
|
|
34
39
|
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
@@ -39,7 +44,7 @@ var ProxyTracer = /** @class */ (function () {
|
|
|
39
44
|
}
|
|
40
45
|
var tracer = this._provider.getDelegateTracer(this.name, this.version);
|
|
41
46
|
if (!tracer) {
|
|
42
|
-
return
|
|
47
|
+
return NOOP_TRACER;
|
|
43
48
|
}
|
|
44
49
|
this._delegate = tracer;
|
|
45
50
|
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,2CAA0C;AAK1C,IAAM,WAAW,GAAG,IAAI,uBAAU,EAAE,CAAC;AAErC;;GAEG;AACH;IAIE,qBACU,SAA0B,EAClB,IAAY,EACZ,OAAgB;QAFxB,cAAS,GAAT,SAAS,CAAiB;QAClB,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,qCAAe,GAAf,UACE,KAAa,EACb,QAAyB,EACzB,QAAsB,EACtB,GAAO;QAEP,IAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAClE,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,WAAW,CAAC;SACpB;QAED,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACH,kBAAC;AAAD,CAAC,AA1CD,IA0CC;AA1CY,kCAAW"}
|
|
@@ -18,6 +18,7 @@ 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();
|
|
21
22
|
/**
|
|
22
23
|
* Tracer provider which provides {@link ProxyTracer}s.
|
|
23
24
|
*
|
|
@@ -38,7 +39,7 @@ var ProxyTracerProvider = /** @class */ (function () {
|
|
|
38
39
|
};
|
|
39
40
|
ProxyTracerProvider.prototype.getDelegate = function () {
|
|
40
41
|
var _a;
|
|
41
|
-
return (_a = this._delegate) !== null && _a !== void 0 ? _a :
|
|
42
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
42
43
|
};
|
|
43
44
|
/**
|
|
44
45
|
* 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,2DAA0D;AAE1D,IAAM,oBAAoB,GAAG,IAAI,uCAAkB,EAAE,CAAC;AAEtD;;;;;;;GAOG;AACH;IAAA;IA2BA,CAAC;IAxBC;;OAEG;IACH,uCAAS,GAAT,UAAU,IAAY,EAAE,OAAgB;;QACtC,OAAO,CACL,MAAA,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,OAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,oBAAoB,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,OAAO,MAAA,IAAI,CAAC,SAAS,0CAAE,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IACH,0BAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,kDAAmB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
import { Span } from './span';
|
|
3
|
+
import { SpanContext } from './span_context';
|
|
4
|
+
/**
|
|
5
|
+
* Return the span if one exists
|
|
6
|
+
*
|
|
7
|
+
* @param context context to get span from
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSpan(context: Context): Span | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Set the span on a context
|
|
12
|
+
*
|
|
13
|
+
* @param context context to use as parent
|
|
14
|
+
* @param span span to set active
|
|
15
|
+
*/
|
|
16
|
+
export declare function setSpan(context: Context, span: Span): Context;
|
|
17
|
+
/**
|
|
18
|
+
* Remove current span stored in the context
|
|
19
|
+
*
|
|
20
|
+
* @param context context to delete span from
|
|
21
|
+
*/
|
|
22
|
+
export declare function deleteSpan(context: Context): Context;
|
|
23
|
+
/**
|
|
24
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
25
|
+
* context
|
|
26
|
+
*
|
|
27
|
+
* @param context context to set active span on
|
|
28
|
+
* @param spanContext span context to be wrapped
|
|
29
|
+
*/
|
|
30
|
+
export declare function setSpanContext(context: Context, spanContext: SpanContext): Context;
|
|
31
|
+
/**
|
|
32
|
+
* Get the span context of the span if it exists.
|
|
33
|
+
*
|
|
34
|
+
* @param context context to get values from
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSpanContext(context: Context): SpanContext | undefined;
|
|
37
|
+
//# sourceMappingURL=context-utils.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
exports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getSpan = void 0;
|
|
19
|
+
var context_1 = require("../context/context");
|
|
20
|
+
var NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
21
|
+
/**
|
|
22
|
+
* span key
|
|
23
|
+
*/
|
|
24
|
+
var SPAN_KEY = context_1.createContextKey('OpenTelemetry Context Key SPAN');
|
|
25
|
+
/**
|
|
26
|
+
* Return the span if one exists
|
|
27
|
+
*
|
|
28
|
+
* @param context context to get span from
|
|
29
|
+
*/
|
|
30
|
+
function getSpan(context) {
|
|
31
|
+
return context.getValue(SPAN_KEY) || undefined;
|
|
32
|
+
}
|
|
33
|
+
exports.getSpan = getSpan;
|
|
34
|
+
/**
|
|
35
|
+
* Set the span on a context
|
|
36
|
+
*
|
|
37
|
+
* @param context context to use as parent
|
|
38
|
+
* @param span span to set active
|
|
39
|
+
*/
|
|
40
|
+
function setSpan(context, span) {
|
|
41
|
+
return context.setValue(SPAN_KEY, span);
|
|
42
|
+
}
|
|
43
|
+
exports.setSpan = setSpan;
|
|
44
|
+
/**
|
|
45
|
+
* Remove current span stored in the context
|
|
46
|
+
*
|
|
47
|
+
* @param context context to delete span from
|
|
48
|
+
*/
|
|
49
|
+
function deleteSpan(context) {
|
|
50
|
+
return context.deleteValue(SPAN_KEY);
|
|
51
|
+
}
|
|
52
|
+
exports.deleteSpan = deleteSpan;
|
|
53
|
+
/**
|
|
54
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
55
|
+
* context
|
|
56
|
+
*
|
|
57
|
+
* @param context context to set active span on
|
|
58
|
+
* @param spanContext span context to be wrapped
|
|
59
|
+
*/
|
|
60
|
+
function setSpanContext(context, spanContext) {
|
|
61
|
+
return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext));
|
|
62
|
+
}
|
|
63
|
+
exports.setSpanContext = setSpanContext;
|
|
64
|
+
/**
|
|
65
|
+
* Get the span context of the span if it exists.
|
|
66
|
+
*
|
|
67
|
+
* @param context context to get values from
|
|
68
|
+
*/
|
|
69
|
+
function getSpanContext(context) {
|
|
70
|
+
var _a;
|
|
71
|
+
return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();
|
|
72
|
+
}
|
|
73
|
+
exports.getSpanContext = getSpanContext;
|
|
74
|
+
//# sourceMappingURL=context-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-utils.js","sourceRoot":"","sources":["../../../src/trace/context-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAAsD;AAItD,uDAAsD;AAEtD;;GAEG;AACH,IAAM,QAAQ,GAAG,0BAAgB,CAAC,gCAAgC,CAAC,CAAC;AAEpE;;;;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;;;;GAIG;AACH,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAFD,gCAEC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,OAAgB,EAChB,WAAwB;IAExB,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,mCAAgB,CAAC,WAAW,CAAC,CAAC,CAAC;AAC7D,CAAC;AALD,wCAKC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;;IAC7C,OAAO,MAAA,OAAO,CAAC,OAAO,CAAC,0CAAE,WAAW,EAAE,CAAC;AACzC,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SpanContext } from './span_context';
|
|
2
|
+
export declare const INVALID_SPANID = "0000000000000000";
|
|
3
|
+
export declare const INVALID_TRACEID = "00000000000000000000000000000000";
|
|
4
|
+
export declare const INVALID_SPAN_CONTEXT: SpanContext;
|
|
5
|
+
//# sourceMappingURL=invalid-span-constants.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;
|
|
19
|
+
var trace_flags_1 = require("./trace_flags");
|
|
20
|
+
exports.INVALID_SPANID = '0000000000000000';
|
|
21
|
+
exports.INVALID_TRACEID = '00000000000000000000000000000000';
|
|
22
|
+
exports.INVALID_SPAN_CONTEXT = {
|
|
23
|
+
traceId: exports.INVALID_TRACEID,
|
|
24
|
+
spanId: exports.INVALID_SPANID,
|
|
25
|
+
traceFlags: trace_flags_1.TraceFlags.NONE,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=invalid-span-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-span-constants.js","sourceRoot":"","sources":["../../../src/trace/invalid-span-constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,6CAA2C;AAE9B,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanAttributes } from './attributes';
|
|
2
|
-
import {
|
|
2
|
+
import { SpanContext } from './span_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 { LinkContext } from './link_context';
|
|
|
16
16
|
* Service Provider) can be correlated.
|
|
17
17
|
*/
|
|
18
18
|
export interface Link {
|
|
19
|
-
/** The {@link
|
|
20
|
-
context:
|
|
19
|
+
/** The {@link SpanContext} of a linked span. */
|
|
20
|
+
context: SpanContext;
|
|
21
21
|
/** A set of {@link SpanAttributes} on the link. */
|
|
22
22
|
attributes?: SpanAttributes;
|
|
23
23
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { Span } from './span';
|
|
1
2
|
import { SpanContext } from './span_context';
|
|
2
|
-
export declare const INVALID_SPANID = "0000000000000000";
|
|
3
|
-
export declare const INVALID_TRACEID = "00000000000000000000000000000000";
|
|
4
|
-
export declare const INVALID_SPAN_CONTEXT: SpanContext;
|
|
5
3
|
export declare function isValidTraceId(traceId: string): boolean;
|
|
6
4
|
export declare function isValidSpanId(spanId: string): boolean;
|
|
7
5
|
/**
|
|
@@ -9,4 +7,11 @@ export declare function isValidSpanId(spanId: string): boolean;
|
|
|
9
7
|
* @return true if this {@link SpanContext} is valid.
|
|
10
8
|
*/
|
|
11
9
|
export declare function isSpanContextValid(spanContext: SpanContext): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
|
|
12
|
+
*
|
|
13
|
+
* @param spanContext span context to be wrapped
|
|
14
|
+
* @returns a new non-recording {@link Span} with the provided context
|
|
15
|
+
*/
|
|
16
|
+
export declare function wrapSpanContext(spanContext: SpanContext): Span;
|
|
12
17
|
//# sourceMappingURL=spancontext-utils.d.ts.map
|