@opentelemetry/api 1.0.0-rc.2 → 1.0.2
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 +123 -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/esm/baggage/internal/baggage-impl.d.ts +12 -0
- 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/esm/baggage/types.d.ts +60 -0
- package/build/esm/baggage/types.js +17 -0
- package/build/esm/baggage/types.js.map +1 -0
- package/build/esm/baggage/utils.d.ts +15 -0
- package/build/esm/baggage/utils.js +46 -0
- package/build/esm/baggage/utils.js.map +1 -0
- package/build/esm/common/Exception.d.ts +26 -0
- package/build/esm/common/Exception.js +17 -0
- 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/esm/context/types.js +17 -0
- 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 +53 -0
- package/build/esm/index.js +63 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/internal/global-utils.d.ts +17 -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/esm/trace/NonRecordingSpan.d.ts +25 -0
- package/build/esm/trace/NonRecordingSpan.js +62 -0
- package/build/esm/trace/NonRecordingSpan.js.map +1 -0
- package/build/esm/trace/NoopTracer.d.ts +14 -0
- package/build/esm/trace/NoopTracer.js +74 -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 +23 -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/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 +20 -0
- package/build/esm/trace/spancontext-utils.js +49 -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 +41 -0
- package/build/src/api/context.js +93 -0
- package/build/src/api/context.js.map +1 -0
- package/build/src/api/diag.d.ts +38 -0
- package/build/src/api/diag.js +92 -0
- package/build/src/api/diag.js.map +1 -0
- package/build/src/api/propagation.d.ts +48 -0
- package/build/src/api/propagation.js +91 -0
- package/build/src/api/propagation.js.map +1 -0
- package/build/src/api/trace.d.ts +39 -0
- package/build/src/api/trace.js +79 -0
- package/build/src/api/trace.js.map +1 -0
- 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-impl.js +64 -0
- package/build/src/baggage/internal/baggage-impl.js.map +1 -0
- package/build/src/baggage/internal/symbol.d.ts +5 -0
- package/build/src/baggage/internal/symbol.js +23 -0
- package/build/src/baggage/internal/symbol.js.map +1 -0
- package/build/src/baggage/types.d.ts +60 -0
- package/build/src/baggage/types.js +18 -0
- package/build/src/baggage/types.js.map +1 -0
- package/build/src/baggage/utils.d.ts +15 -0
- package/build/src/baggage/utils.js +51 -0
- package/build/src/baggage/utils.js.map +1 -0
- package/build/src/common/Exception.d.ts +26 -0
- package/build/src/common/Exception.js +18 -0
- package/build/src/common/Exception.js.map +1 -0
- package/build/src/common/Time.d.ts +8 -0
- package/build/src/common/Time.js +3 -0
- package/build/src/common/Time.js.map +1 -0
- package/build/src/context/NoopContextManager.d.ts +9 -0
- package/build/src/context/NoopContextManager.js +50 -0
- package/build/src/context/NoopContextManager.js.map +1 -0
- package/build/src/context/context.d.ts +6 -0
- package/build/src/context/context.js +56 -0
- package/build/src/context/context.js.map +1 -0
- package/build/src/context/types.d.ts +52 -0
- package/build/src/context/types.js +18 -0
- package/build/src/context/types.js.map +1 -0
- 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/consoleLogger.d.ts +38 -0
- package/build/src/diag/consoleLogger.js +57 -0
- package/build/src/diag/consoleLogger.js.map +1 -0
- package/build/src/diag/index.d.ts +3 -0
- package/build/src/diag/index.js +30 -0
- package/build/src/diag/index.js.map +1 -0
- package/build/src/diag/internal/logLevelLogger.d.ts +3 -0
- package/build/src/diag/internal/logLevelLogger.js +45 -0
- package/build/src/diag/internal/logLevelLogger.js.map +1 -0
- package/build/src/diag/internal/noopLogger.d.ts +8 -0
- package/build/src/diag/internal/noopLogger.js +35 -0
- package/build/src/diag/internal/noopLogger.js.map +1 -0
- package/build/src/diag/types.d.ts +70 -0
- package/build/src/diag/types.js +44 -0
- package/build/src/diag/types.js.map +1 -0
- package/build/src/index.d.ts +53 -0
- package/build/src/index.js +83 -0
- package/build/src/index.js.map +1 -0
- package/build/src/internal/global-utils.d.ts +17 -0
- package/build/src/internal/global-utils.js +65 -0
- package/build/src/internal/global-utils.js.map +1 -0
- package/build/src/internal/semver.d.ts +34 -0
- package/build/src/internal/semver.js +122 -0
- package/build/src/internal/semver.js.map +1 -0
- package/build/src/platform/browser/globalThis.d.ts +3 -0
- package/build/src/platform/browser/globalThis.js +22 -0
- package/build/src/platform/browser/globalThis.js.map +1 -0
- package/build/src/platform/browser/index.d.ts +2 -0
- package/build/src/platform/browser/index.js +29 -0
- package/build/src/platform/browser/index.js.map +1 -0
- package/build/src/platform/index.d.ts +2 -0
- package/build/src/platform/index.js +29 -0
- package/build/src/platform/index.js.map +1 -0
- package/build/src/platform/node/globalThis.d.ts +3 -0
- package/build/src/platform/node/globalThis.js +22 -0
- package/build/src/platform/node/globalThis.js.map +1 -0
- package/build/src/platform/node/index.d.ts +2 -0
- package/build/src/platform/node/index.js +29 -0
- package/build/src/platform/node/index.js.map +1 -0
- package/build/src/propagation/NoopTextMapPropagator.d.ts +13 -0
- package/build/src/propagation/NoopTextMapPropagator.js +37 -0
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -0
- package/build/src/propagation/TextMapPropagator.d.ts +84 -0
- package/build/src/propagation/TextMapPropagator.js +41 -0
- package/build/src/propagation/TextMapPropagator.js.map +1 -0
- 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 +14 -0
- package/build/src/trace/NoopTracer.js +77 -0
- package/build/src/trace/NoopTracer.js.map +1 -0
- package/build/src/trace/NoopTracerProvider.d.ts +12 -0
- package/build/src/trace/NoopTracerProvider.js +35 -0
- package/build/src/trace/NoopTracerProvider.js.map +1 -0
- package/build/src/trace/ProxyTracer.d.ts +23 -0
- package/build/src/trace/ProxyTracer.js +55 -0
- package/build/src/trace/ProxyTracer.js.map +1 -0
- package/build/src/trace/ProxyTracerProvider.d.ts +24 -0
- package/build/src/trace/ProxyTracerProvider.js +57 -0
- package/build/src/trace/ProxyTracerProvider.js.map +1 -0
- package/build/src/trace/Sampler.d.ts +30 -0
- package/build/src/trace/Sampler.js +18 -0
- package/build/src/trace/Sampler.js.map +1 -0
- package/build/src/trace/SamplingResult.d.ts +39 -0
- package/build/src/trace/SamplingResult.js +41 -0
- package/build/src/trace/SamplingResult.js.map +1 -0
- package/build/src/trace/SpanOptions.d.ts +23 -0
- package/build/src/trace/SpanOptions.js +18 -0
- package/build/src/trace/SpanOptions.js.map +1 -0
- package/build/src/trace/attributes.d.ts +10 -0
- package/build/src/trace/attributes.js +18 -0
- package/build/src/trace/attributes.js.map +1 -0
- 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/link.d.ts +24 -0
- package/build/src/trace/link.js +18 -0
- package/build/src/trace/link.js.map +1 -0
- package/build/src/trace/span.d.ts +101 -0
- package/build/src/trace/span.js +18 -0
- package/build/src/trace/span.js.map +1 -0
- package/build/src/trace/span_context.d.ts +53 -0
- package/build/src/trace/span_context.js +18 -0
- package/build/src/trace/span_context.js.map +1 -0
- package/build/src/trace/span_kind.d.ts +27 -0
- package/build/src/trace/span_kind.js +46 -0
- package/build/src/trace/span_kind.js.map +1 -0
- package/build/src/trace/spancontext-utils.d.ts +20 -0
- package/build/src/trace/spancontext-utils.js +56 -0
- package/build/src/trace/spancontext-utils.js.map +1 -0
- package/build/src/trace/status.d.ts +25 -0
- package/build/src/trace/status.js +23 -0
- package/build/src/trace/status.js.map +1 -0
- package/build/src/trace/trace_flags.d.ts +7 -0
- package/build/src/trace/trace_flags.js +26 -0
- package/build/src/trace/trace_flags.js.map +1 -0
- package/build/src/trace/trace_state.d.ts +38 -0
- package/build/src/trace/trace_state.js +18 -0
- package/build/src/trace/trace_state.js.map +1 -0
- package/build/src/trace/tracer.d.ts +71 -0
- package/build/src/trace/tracer.js +18 -0
- package/build/src/trace/tracer.js.map +1 -0
- package/build/src/trace/tracer_provider.d.ts +19 -0
- package/build/src/trace/tracer_provider.js +18 -0
- package/build/src/trace/tracer_provider.js.map +1 -0
- package/build/src/version.d.ts +2 -0
- package/build/src/version.js +21 -0
- package/build/src/version.js.map +1 -0
- package/package.json +23 -18
|
@@ -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 spancontext_utils_1 = require("./spancontext-utils");
|
|
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 = spancontext_utils_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;;;AAQH,yDAA2D;AAE3D;;;;GAIG;AACH;IACE,0BACmB,YAAgD;QAAhD,6BAAA,EAAA,eAA4B,wCAAoB;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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
import { Span } from './span';
|
|
3
|
+
import { SpanOptions } from './SpanOptions';
|
|
4
|
+
import { Tracer } from './tracer';
|
|
5
|
+
/**
|
|
6
|
+
* No-op implementations of {@link Tracer}.
|
|
7
|
+
*/
|
|
8
|
+
export declare class NoopTracer implements Tracer {
|
|
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
|
+
}
|
|
14
|
+
//# sourceMappingURL=NoopTracer.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
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.NoopTracer = void 0;
|
|
19
|
+
var __1 = require("../");
|
|
20
|
+
var context_utils_1 = require("../trace/context-utils");
|
|
21
|
+
var NonRecordingSpan_1 = require("./NonRecordingSpan");
|
|
22
|
+
var spancontext_utils_1 = require("./spancontext-utils");
|
|
23
|
+
/**
|
|
24
|
+
* No-op implementations of {@link Tracer}.
|
|
25
|
+
*/
|
|
26
|
+
var NoopTracer = /** @class */ (function () {
|
|
27
|
+
function NoopTracer() {
|
|
28
|
+
}
|
|
29
|
+
// startSpan starts a noop span.
|
|
30
|
+
NoopTracer.prototype.startSpan = function (name, options, context) {
|
|
31
|
+
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
32
|
+
if (root) {
|
|
33
|
+
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
34
|
+
}
|
|
35
|
+
var parentFromContext = context && context_utils_1.getSpanContext(context);
|
|
36
|
+
if (isSpanContext(parentFromContext) &&
|
|
37
|
+
spancontext_utils_1.isSpanContextValid(parentFromContext)) {
|
|
38
|
+
return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return new NonRecordingSpan_1.NonRecordingSpan();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
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
|
+
return NoopTracer;
|
|
69
|
+
}());
|
|
70
|
+
exports.NoopTracer = NoopTracer;
|
|
71
|
+
function isSpanContext(spanContext) {
|
|
72
|
+
return (typeof spanContext === 'object' &&
|
|
73
|
+
typeof spanContext['spanId'] === 'string' &&
|
|
74
|
+
typeof spanContext['traceId'] === 'string' &&
|
|
75
|
+
typeof spanContext['traceFlags'] === 'number');
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=NoopTracer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoopTracer.js","sourceRoot":"","sources":["../../../src/trace/NoopTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yBAA8B;AAE9B,wDAAiE;AACjE,uDAAsD;AAEtD,yDAAyD;AAKzD;;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,WAAO,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,WAAO,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Tracer } from './tracer';
|
|
2
|
+
import { TracerProvider } from './tracer_provider';
|
|
3
|
+
/**
|
|
4
|
+
* An implementation of the {@link TracerProvider} which returns an impotent
|
|
5
|
+
* Tracer for all calls to `getTracer`.
|
|
6
|
+
*
|
|
7
|
+
* All operations are no-op.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NoopTracerProvider implements TracerProvider {
|
|
10
|
+
getTracer(_name?: string, _version?: string): Tracer;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=NoopTracerProvider.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
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.NoopTracerProvider = void 0;
|
|
19
|
+
var NoopTracer_1 = require("./NoopTracer");
|
|
20
|
+
/**
|
|
21
|
+
* An implementation of the {@link TracerProvider} which returns an impotent
|
|
22
|
+
* Tracer for all calls to `getTracer`.
|
|
23
|
+
*
|
|
24
|
+
* All operations are no-op.
|
|
25
|
+
*/
|
|
26
|
+
var NoopTracerProvider = /** @class */ (function () {
|
|
27
|
+
function NoopTracerProvider() {
|
|
28
|
+
}
|
|
29
|
+
NoopTracerProvider.prototype.getTracer = function (_name, _version) {
|
|
30
|
+
return new NoopTracer_1.NoopTracer();
|
|
31
|
+
};
|
|
32
|
+
return NoopTracerProvider;
|
|
33
|
+
}());
|
|
34
|
+
exports.NoopTracerProvider = NoopTracerProvider;
|
|
35
|
+
//# sourceMappingURL=NoopTracerProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
import { ProxyTracerProvider } from './ProxyTracerProvider';
|
|
3
|
+
import { Span } from './span';
|
|
4
|
+
import { SpanOptions } from './SpanOptions';
|
|
5
|
+
import { Tracer } from './tracer';
|
|
6
|
+
/**
|
|
7
|
+
* Proxy tracer provided by the proxy tracer provider
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProxyTracer implements Tracer {
|
|
10
|
+
private _provider;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly version?: string | undefined;
|
|
13
|
+
private _delegate?;
|
|
14
|
+
constructor(_provider: ProxyTracerProvider, name: string, version?: string | undefined);
|
|
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
|
+
/**
|
|
18
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
19
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
20
|
+
*/
|
|
21
|
+
private _getTracer;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ProxyTracer.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
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.ProxyTracer = void 0;
|
|
19
|
+
var NoopTracer_1 = require("./NoopTracer");
|
|
20
|
+
var NOOP_TRACER = new NoopTracer_1.NoopTracer();
|
|
21
|
+
/**
|
|
22
|
+
* Proxy tracer provided by the proxy tracer provider
|
|
23
|
+
*/
|
|
24
|
+
var ProxyTracer = /** @class */ (function () {
|
|
25
|
+
function ProxyTracer(_provider, name, version) {
|
|
26
|
+
this._provider = _provider;
|
|
27
|
+
this.name = name;
|
|
28
|
+
this.version = version;
|
|
29
|
+
}
|
|
30
|
+
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
|
31
|
+
return this._getTracer().startSpan(name, options, context);
|
|
32
|
+
};
|
|
33
|
+
ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {
|
|
34
|
+
var tracer = this._getTracer();
|
|
35
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
39
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
40
|
+
*/
|
|
41
|
+
ProxyTracer.prototype._getTracer = function () {
|
|
42
|
+
if (this._delegate) {
|
|
43
|
+
return this._delegate;
|
|
44
|
+
}
|
|
45
|
+
var tracer = this._provider.getDelegateTracer(this.name, this.version);
|
|
46
|
+
if (!tracer) {
|
|
47
|
+
return NOOP_TRACER;
|
|
48
|
+
}
|
|
49
|
+
this._delegate = tracer;
|
|
50
|
+
return this._delegate;
|
|
51
|
+
};
|
|
52
|
+
return ProxyTracer;
|
|
53
|
+
}());
|
|
54
|
+
exports.ProxyTracer = ProxyTracer;
|
|
55
|
+
//# sourceMappingURL=ProxyTracer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProxyTracer.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,2CAA0C;AAM1C,IAAM,WAAW,GAAG,IAAI,uBAAU,EAAE,CAAC;AAErC;;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,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Tracer } from './tracer';
|
|
2
|
+
import { TracerProvider } from './tracer_provider';
|
|
3
|
+
/**
|
|
4
|
+
* Tracer provider which provides {@link ProxyTracer}s.
|
|
5
|
+
*
|
|
6
|
+
* Before a delegate is set, tracers provided are NoOp.
|
|
7
|
+
* When a delegate is set, traces are provided from the delegate.
|
|
8
|
+
* When a delegate is set after tracers have already been provided,
|
|
9
|
+
* all tracers already provided will use the provided delegate implementation.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProxyTracerProvider implements TracerProvider {
|
|
12
|
+
private _delegate?;
|
|
13
|
+
/**
|
|
14
|
+
* Get a {@link ProxyTracer}
|
|
15
|
+
*/
|
|
16
|
+
getTracer(name: string, version?: string): Tracer;
|
|
17
|
+
getDelegate(): TracerProvider;
|
|
18
|
+
/**
|
|
19
|
+
* Set the delegate tracer provider
|
|
20
|
+
*/
|
|
21
|
+
setDelegate(delegate: TracerProvider): void;
|
|
22
|
+
getDelegateTracer(name: string, version?: string): Tracer | undefined;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ProxyTracerProvider.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
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.ProxyTracerProvider = void 0;
|
|
19
|
+
var ProxyTracer_1 = require("./ProxyTracer");
|
|
20
|
+
var NoopTracerProvider_1 = require("./NoopTracerProvider");
|
|
21
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider();
|
|
22
|
+
/**
|
|
23
|
+
* Tracer provider which provides {@link ProxyTracer}s.
|
|
24
|
+
*
|
|
25
|
+
* Before a delegate is set, tracers provided are NoOp.
|
|
26
|
+
* When a delegate is set, traces are provided from the delegate.
|
|
27
|
+
* When a delegate is set after tracers have already been provided,
|
|
28
|
+
* all tracers already provided will use the provided delegate implementation.
|
|
29
|
+
*/
|
|
30
|
+
var ProxyTracerProvider = /** @class */ (function () {
|
|
31
|
+
function ProxyTracerProvider() {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get a {@link ProxyTracer}
|
|
35
|
+
*/
|
|
36
|
+
ProxyTracerProvider.prototype.getTracer = function (name, version) {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version));
|
|
39
|
+
};
|
|
40
|
+
ProxyTracerProvider.prototype.getDelegate = function () {
|
|
41
|
+
var _a;
|
|
42
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Set the delegate tracer provider
|
|
46
|
+
*/
|
|
47
|
+
ProxyTracerProvider.prototype.setDelegate = function (delegate) {
|
|
48
|
+
this._delegate = delegate;
|
|
49
|
+
};
|
|
50
|
+
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);
|
|
53
|
+
};
|
|
54
|
+
return ProxyTracerProvider;
|
|
55
|
+
}());
|
|
56
|
+
exports.ProxyTracerProvider = ProxyTracerProvider;
|
|
57
|
+
//# sourceMappingURL=ProxyTracerProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,30 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
import { SpanAttributes } from './attributes';
|
|
3
|
+
import { Link } from './link';
|
|
4
|
+
import { SamplingResult } from './SamplingResult';
|
|
5
|
+
import { SpanKind } from './span_kind';
|
|
6
|
+
/**
|
|
7
|
+
* This interface represent a sampler. Sampling is a mechanism to control the
|
|
8
|
+
* noise and overhead introduced by OpenTelemetry by reducing the number of
|
|
9
|
+
* samples of traces collected and sent to the backend.
|
|
10
|
+
*/
|
|
11
|
+
export interface Sampler {
|
|
12
|
+
/**
|
|
13
|
+
* Checks whether span needs to be created and tracked.
|
|
14
|
+
*
|
|
15
|
+
* @param context Parent Context which may contain a span.
|
|
16
|
+
* @param traceId of the span to be created. It can be different from the
|
|
17
|
+
* traceId in the {@link SpanContext}. Typically in situations when the
|
|
18
|
+
* span to be created starts a new trace.
|
|
19
|
+
* @param spanName of the span to be created.
|
|
20
|
+
* @param spanKind of the span to be created.
|
|
21
|
+
* @param attributes Initial set of SpanAttributes for the Span being constructed.
|
|
22
|
+
* @param links Collection of links that will be associated with the Span to
|
|
23
|
+
* be created. Typically useful for batch operations.
|
|
24
|
+
* @returns a {@link SamplingResult}.
|
|
25
|
+
*/
|
|
26
|
+
shouldSample(context: Context, traceId: string, spanName: string, spanKind: SpanKind, attributes: SpanAttributes, links: Link[]): SamplingResult;
|
|
27
|
+
/** Returns the sampler name or short description with the configuration. */
|
|
28
|
+
toString(): string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=Sampler.d.ts.map
|
|
@@ -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=Sampler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sampler.js","sourceRoot":"","sources":["../../../src/trace/Sampler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SpanAttributes } from './attributes';
|
|
2
|
+
/**
|
|
3
|
+
* A sampling decision that determines how a {@link Span} will be recorded
|
|
4
|
+
* and collected.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum SamplingDecision {
|
|
7
|
+
/**
|
|
8
|
+
* `Span.isRecording() === false`, span will not be recorded and all events
|
|
9
|
+
* and attributes will be dropped.
|
|
10
|
+
*/
|
|
11
|
+
NOT_RECORD = 0,
|
|
12
|
+
/**
|
|
13
|
+
* `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
|
|
14
|
+
* MUST NOT be set.
|
|
15
|
+
*/
|
|
16
|
+
RECORD = 1,
|
|
17
|
+
/**
|
|
18
|
+
* `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
|
|
19
|
+
* MUST be set.
|
|
20
|
+
*/
|
|
21
|
+
RECORD_AND_SAMPLED = 2
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A sampling result contains a decision for a {@link Span} and additional
|
|
25
|
+
* attributes the sampler would like to added to the Span.
|
|
26
|
+
*/
|
|
27
|
+
export interface SamplingResult {
|
|
28
|
+
/**
|
|
29
|
+
* A sampling decision, refer to {@link SamplingDecision} for details.
|
|
30
|
+
*/
|
|
31
|
+
decision: SamplingDecision;
|
|
32
|
+
/**
|
|
33
|
+
* The list of attributes returned by SamplingResult MUST be immutable.
|
|
34
|
+
* Caller may call {@link Sampler}.shouldSample any number of times and
|
|
35
|
+
* can safely cache the returned value.
|
|
36
|
+
*/
|
|
37
|
+
attributes?: Readonly<SpanAttributes>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=SamplingResult.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
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.SamplingDecision = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* A sampling decision that determines how a {@link Span} will be recorded
|
|
21
|
+
* and collected.
|
|
22
|
+
*/
|
|
23
|
+
var SamplingDecision;
|
|
24
|
+
(function (SamplingDecision) {
|
|
25
|
+
/**
|
|
26
|
+
* `Span.isRecording() === false`, span will not be recorded and all events
|
|
27
|
+
* and attributes will be dropped.
|
|
28
|
+
*/
|
|
29
|
+
SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD";
|
|
30
|
+
/**
|
|
31
|
+
* `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
|
|
32
|
+
* MUST NOT be set.
|
|
33
|
+
*/
|
|
34
|
+
SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD";
|
|
35
|
+
/**
|
|
36
|
+
* `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
|
|
37
|
+
* MUST be set.
|
|
38
|
+
*/
|
|
39
|
+
SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
|
|
40
|
+
})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {}));
|
|
41
|
+
//# sourceMappingURL=SamplingResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SamplingResult.js","sourceRoot":"","sources":["../../../src/trace/SamplingResult.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH;;;GAGG;AACH,IAAY,gBAgBX;AAhBD,WAAY,gBAAgB;IAC1B;;;OAGG;IACH,mEAAU,CAAA;IACV;;;OAGG;IACH,2DAAM,CAAA;IACN;;;OAGG;IACH,mFAAkB,CAAA;AACpB,CAAC,EAhBW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAgB3B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TimeInput } from '../common/Time';
|
|
2
|
+
import { SpanAttributes } from './attributes';
|
|
3
|
+
import { Link } from './link';
|
|
4
|
+
import { SpanKind } from './span_kind';
|
|
5
|
+
/**
|
|
6
|
+
* Options needed for span creation
|
|
7
|
+
*/
|
|
8
|
+
export interface SpanOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The SpanKind of a span
|
|
11
|
+
* @default {@link SpanKind.INTERNAL}
|
|
12
|
+
*/
|
|
13
|
+
kind?: SpanKind;
|
|
14
|
+
/** A span's attributes */
|
|
15
|
+
attributes?: SpanAttributes;
|
|
16
|
+
/** {@link Link}s span to other spans */
|
|
17
|
+
links?: Link[];
|
|
18
|
+
/** A manually specified start time for the created `Span` object. */
|
|
19
|
+
startTime?: TimeInput;
|
|
20
|
+
/** The new span should be a root span. (Ignore parent from context). */
|
|
21
|
+
root?: boolean;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SpanOptions.d.ts.map
|
|
@@ -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=SpanOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpanOptions.js","sourceRoot":"","sources":["../../../src/trace/SpanOptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SpanAttributes {
|
|
2
|
+
[attributeKey: string]: SpanAttributeValue | undefined;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Attribute values may be any non-nullish primitive value except an object.
|
|
6
|
+
*
|
|
7
|
+
* null or undefined attribute values are invalid and will result in undefined behavior.
|
|
8
|
+
*/
|
|
9
|
+
export declare type SpanAttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
|
10
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -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=attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../src/trace/attributes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -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
|