@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,17 @@
|
|
|
1
|
+
import type { DiagAPI } from '../api/diag';
|
|
2
|
+
import { ContextManager } from '../context/types';
|
|
3
|
+
import { DiagLogger } from '../diag';
|
|
4
|
+
import { TextMapPropagator } from '../propagation/TextMapPropagator';
|
|
5
|
+
import type { TracerProvider } from '../trace/tracer_provider';
|
|
6
|
+
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagAPI, allowOverride?: boolean): boolean;
|
|
7
|
+
export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
|
|
8
|
+
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagAPI): void;
|
|
9
|
+
declare type OTelGlobalAPI = {
|
|
10
|
+
version: string;
|
|
11
|
+
diag?: DiagLogger;
|
|
12
|
+
trace?: TracerProvider;
|
|
13
|
+
context?: ContextManager;
|
|
14
|
+
propagation?: TextMapPropagator;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=global-utils.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { _globalThis } from '../platform';
|
|
17
|
+
import { VERSION } from '../version';
|
|
18
|
+
import { isCompatible } from './semver';
|
|
19
|
+
var major = VERSION.split('.')[0];
|
|
20
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
|
|
21
|
+
var _global = _globalThis;
|
|
22
|
+
export function registerGlobal(type, instance, diag, allowOverride) {
|
|
23
|
+
var _a;
|
|
24
|
+
if (allowOverride === void 0) { allowOverride = false; }
|
|
25
|
+
var api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
26
|
+
version: VERSION,
|
|
27
|
+
});
|
|
28
|
+
if (!allowOverride && api[type]) {
|
|
29
|
+
// already registered an API of this type
|
|
30
|
+
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
31
|
+
diag.error(err.stack || err.message);
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
if (api.version !== VERSION) {
|
|
35
|
+
// All registered APIs must be of the same version exactly
|
|
36
|
+
var err = new Error('@opentelemetry/api: All API registration versions must match');
|
|
37
|
+
diag.error(err.stack || err.message);
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
api[type] = instance;
|
|
41
|
+
diag.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
export function getGlobal(type) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
47
|
+
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
51
|
+
}
|
|
52
|
+
export function unregisterGlobal(type, diag) {
|
|
53
|
+
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
|
|
54
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
55
|
+
if (api) {
|
|
56
|
+
delete api[type];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=global-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../src/internal/global-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,IAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAC7C,0BAAwB,KAAO,CAChC,CAAC;AAEF,IAAM,OAAO,GAAG,WAAyB,CAAC;AAE1C,MAAM,UAAU,cAAc,CAC5B,IAAU,EACV,QAA6B,EAC7B,IAAa,EACb,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;IACF,IAAM,GAAG,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAElD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;KAClB;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
|
3
|
+
*
|
|
4
|
+
* The returned function has the following semantics:
|
|
5
|
+
* - Exact match is always compatible
|
|
6
|
+
* - Major versions must match exactly
|
|
7
|
+
* - 1.x package cannot use global 2.x package
|
|
8
|
+
* - 2.x package cannot use global 1.x package
|
|
9
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
10
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
11
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
12
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
13
|
+
* - Patch and build tag differences are not considered at this time
|
|
14
|
+
*
|
|
15
|
+
* @param ownVersion version which should be checked against
|
|
16
|
+
*/
|
|
17
|
+
export declare function _makeCompatibilityCheck(ownVersion: string): (globalVersion: string) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Test an API version to see if it is compatible with this API.
|
|
20
|
+
*
|
|
21
|
+
* - Exact match is always compatible
|
|
22
|
+
* - Major versions must match exactly
|
|
23
|
+
* - 1.x package cannot use global 2.x package
|
|
24
|
+
* - 2.x package cannot use global 1.x package
|
|
25
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
26
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
27
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
28
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
29
|
+
* - Patch and build tag differences are not considered at this time
|
|
30
|
+
*
|
|
31
|
+
* @param version version of the API requesting an instance of the global API
|
|
32
|
+
*/
|
|
33
|
+
export declare const isCompatible: (globalVersion: string) => boolean;
|
|
34
|
+
//# sourceMappingURL=semver.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { VERSION } from '../version';
|
|
17
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
18
|
+
/**
|
|
19
|
+
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
|
20
|
+
*
|
|
21
|
+
* The returned function has the following semantics:
|
|
22
|
+
* - Exact match is always compatible
|
|
23
|
+
* - Major versions must match exactly
|
|
24
|
+
* - 1.x package cannot use global 2.x package
|
|
25
|
+
* - 2.x package cannot use global 1.x package
|
|
26
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
27
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
28
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
29
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
30
|
+
* - Patch and build tag differences are not considered at this time
|
|
31
|
+
*
|
|
32
|
+
* @param ownVersion version which should be checked against
|
|
33
|
+
*/
|
|
34
|
+
export function _makeCompatibilityCheck(ownVersion) {
|
|
35
|
+
var acceptedVersions = new Set([ownVersion]);
|
|
36
|
+
var rejectedVersions = new Set();
|
|
37
|
+
var myVersionMatch = ownVersion.match(re);
|
|
38
|
+
if (!myVersionMatch) {
|
|
39
|
+
// we cannot guarantee compatibility so we always return noop
|
|
40
|
+
return function () { return false; };
|
|
41
|
+
}
|
|
42
|
+
var ownVersionParsed = {
|
|
43
|
+
major: +myVersionMatch[1],
|
|
44
|
+
minor: +myVersionMatch[2],
|
|
45
|
+
patch: +myVersionMatch[3],
|
|
46
|
+
prerelease: myVersionMatch[4],
|
|
47
|
+
};
|
|
48
|
+
// if ownVersion has a prerelease tag, versions must match exactly
|
|
49
|
+
if (ownVersionParsed.prerelease != null) {
|
|
50
|
+
return function isExactmatch(globalVersion) {
|
|
51
|
+
return globalVersion === ownVersion;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function _reject(v) {
|
|
55
|
+
rejectedVersions.add(v);
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
function _accept(v) {
|
|
59
|
+
acceptedVersions.add(v);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return function isCompatible(globalVersion) {
|
|
63
|
+
if (acceptedVersions.has(globalVersion)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (rejectedVersions.has(globalVersion)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
var globalVersionMatch = globalVersion.match(re);
|
|
70
|
+
if (!globalVersionMatch) {
|
|
71
|
+
// cannot parse other version
|
|
72
|
+
// we cannot guarantee compatibility so we always noop
|
|
73
|
+
return _reject(globalVersion);
|
|
74
|
+
}
|
|
75
|
+
var globalVersionParsed = {
|
|
76
|
+
major: +globalVersionMatch[1],
|
|
77
|
+
minor: +globalVersionMatch[2],
|
|
78
|
+
patch: +globalVersionMatch[3],
|
|
79
|
+
prerelease: globalVersionMatch[4],
|
|
80
|
+
};
|
|
81
|
+
// if globalVersion has a prerelease tag, versions must match exactly
|
|
82
|
+
if (globalVersionParsed.prerelease != null) {
|
|
83
|
+
return _reject(globalVersion);
|
|
84
|
+
}
|
|
85
|
+
// major versions must match
|
|
86
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
87
|
+
return _reject(globalVersion);
|
|
88
|
+
}
|
|
89
|
+
if (ownVersionParsed.major === 0) {
|
|
90
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor &&
|
|
91
|
+
ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
92
|
+
return _accept(globalVersion);
|
|
93
|
+
}
|
|
94
|
+
return _reject(globalVersion);
|
|
95
|
+
}
|
|
96
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
97
|
+
return _accept(globalVersion);
|
|
98
|
+
}
|
|
99
|
+
return _reject(globalVersion);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Test an API version to see if it is compatible with this API.
|
|
104
|
+
*
|
|
105
|
+
* - Exact match is always compatible
|
|
106
|
+
* - Major versions must match exactly
|
|
107
|
+
* - 1.x package cannot use global 2.x package
|
|
108
|
+
* - 2.x package cannot use global 1.x package
|
|
109
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
110
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
111
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
112
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
113
|
+
* - Patch and build tag differences are not considered at this time
|
|
114
|
+
*
|
|
115
|
+
* @param version version of the API requesting an instance of the global API
|
|
116
|
+
*/
|
|
117
|
+
export var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
118
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/internal/semver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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C,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** only globals that common to node and browsers are allowed */
|
|
17
|
+
// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef
|
|
18
|
+
export var _globalThis = typeof globalThis === 'object' ? globalThis : window;
|
|
19
|
+
//# sourceMappingURL=globalThis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,gEAAgE;AAChE,8EAA8E;AAC9E,MAAM,CAAC,IAAM,WAAW,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './globalThis';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './node';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** only globals that common to node and browsers are allowed */
|
|
17
|
+
// eslint-disable-next-line node/no-unsupported-features/es-builtins
|
|
18
|
+
export var _globalThis = typeof globalThis === 'object' ? globalThis : global;
|
|
19
|
+
//# sourceMappingURL=globalThis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/node/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,gEAAgE;AAChE,oEAAoE;AACpE,MAAM,CAAC,IAAM,WAAW,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './globalThis';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
import { TextMapPropagator } from './TextMapPropagator';
|
|
3
|
+
/**
|
|
4
|
+
* No-op implementations of {@link TextMapPropagator}.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NoopTextMapPropagator implements TextMapPropagator {
|
|
7
|
+
/** Noop inject function does nothing */
|
|
8
|
+
inject(_context: Context, _carrier: unknown): void;
|
|
9
|
+
/** Noop extract function does nothing and returns the input context */
|
|
10
|
+
extract(context: Context, _carrier: unknown): Context;
|
|
11
|
+
fields(): string[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NoopTextMapPropagator.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* No-op implementations of {@link TextMapPropagator}.
|
|
18
|
+
*/
|
|
19
|
+
var NoopTextMapPropagator = /** @class */ (function () {
|
|
20
|
+
function NoopTextMapPropagator() {
|
|
21
|
+
}
|
|
22
|
+
/** Noop inject function does nothing */
|
|
23
|
+
NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };
|
|
24
|
+
/** Noop extract function does nothing and returns the input context */
|
|
25
|
+
NoopTextMapPropagator.prototype.extract = function (context, _carrier) {
|
|
26
|
+
return context;
|
|
27
|
+
};
|
|
28
|
+
NoopTextMapPropagator.prototype.fields = function () {
|
|
29
|
+
return [];
|
|
30
|
+
};
|
|
31
|
+
return NoopTextMapPropagator;
|
|
32
|
+
}());
|
|
33
|
+
export { NoopTextMapPropagator };
|
|
34
|
+
//# sourceMappingURL=NoopTextMapPropagator.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Context } from '../context/types';
|
|
2
|
+
/**
|
|
3
|
+
* Injects `Context` into and extracts it from carriers that travel
|
|
4
|
+
* in-band across process boundaries. Encoding is expected to conform to the
|
|
5
|
+
* HTTP Header Field semantics. Values are often encoded as RPC/HTTP request
|
|
6
|
+
* headers.
|
|
7
|
+
*
|
|
8
|
+
* The carrier of propagated data on both the client (injector) and server
|
|
9
|
+
* (extractor) side is usually an object such as http headers. Propagation is
|
|
10
|
+
* usually implemented via library-specific request interceptors, where the
|
|
11
|
+
* client-side injects values and the server-side extracts them.
|
|
12
|
+
*/
|
|
13
|
+
export interface TextMapPropagator<Carrier = any> {
|
|
14
|
+
/**
|
|
15
|
+
* Injects values from a given `Context` into a carrier.
|
|
16
|
+
*
|
|
17
|
+
* OpenTelemetry defines a common set of format values (TextMapPropagator),
|
|
18
|
+
* and each has an expected `carrier` type.
|
|
19
|
+
*
|
|
20
|
+
* @param context the Context from which to extract values to transmit over
|
|
21
|
+
* the wire.
|
|
22
|
+
* @param carrier the carrier of propagation fields, such as http request
|
|
23
|
+
* headers.
|
|
24
|
+
* @param setter an optional {@link TextMapSetter}. If undefined, values will be
|
|
25
|
+
* set by direct object assignment.
|
|
26
|
+
*/
|
|
27
|
+
inject(context: Context, carrier: Carrier, setter: TextMapSetter<Carrier>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Given a `Context` and a carrier, extract context values from a
|
|
30
|
+
* carrier and return a new context, created from the old context, with the
|
|
31
|
+
* extracted values.
|
|
32
|
+
*
|
|
33
|
+
* @param context the Context from which to extract values to transmit over
|
|
34
|
+
* the wire.
|
|
35
|
+
* @param carrier the carrier of propagation fields, such as http request
|
|
36
|
+
* headers.
|
|
37
|
+
* @param getter an optional {@link TextMapGetter}. If undefined, keys will be all
|
|
38
|
+
* own properties, and keys will be accessed by direct object access.
|
|
39
|
+
*/
|
|
40
|
+
extract(context: Context, carrier: Carrier, getter: TextMapGetter<Carrier>): Context;
|
|
41
|
+
/**
|
|
42
|
+
* Return a list of all fields which may be used by the propagator.
|
|
43
|
+
*/
|
|
44
|
+
fields(): string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A setter is specified by the caller to define a specific method
|
|
48
|
+
* to set key/value pairs on the carrier within a propagator.
|
|
49
|
+
*/
|
|
50
|
+
export interface TextMapSetter<Carrier = any> {
|
|
51
|
+
/**
|
|
52
|
+
* Callback used to set a key/value pair on an object.
|
|
53
|
+
*
|
|
54
|
+
* Should be called by the propagator each time a key/value pair
|
|
55
|
+
* should be set, and should set that key/value pair on the propagator.
|
|
56
|
+
*
|
|
57
|
+
* @param carrier object or class which carries key/value pairs
|
|
58
|
+
* @param key string key to modify
|
|
59
|
+
* @param value value to be set to the key on the carrier
|
|
60
|
+
*/
|
|
61
|
+
set(carrier: Carrier, key: string, value: string): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A getter is specified by the caller to define a specific method
|
|
65
|
+
* to get the value of a key from a carrier.
|
|
66
|
+
*/
|
|
67
|
+
export interface TextMapGetter<Carrier = any> {
|
|
68
|
+
/**
|
|
69
|
+
* Get a list of all keys available on the carrier.
|
|
70
|
+
*
|
|
71
|
+
* @param carrier
|
|
72
|
+
*/
|
|
73
|
+
keys(carrier: Carrier): string[];
|
|
74
|
+
/**
|
|
75
|
+
* Get the value of a specific key from the carrier.
|
|
76
|
+
*
|
|
77
|
+
* @param carrier
|
|
78
|
+
* @param key
|
|
79
|
+
*/
|
|
80
|
+
get(carrier: Carrier, key: string): undefined | string | string[];
|
|
81
|
+
}
|
|
82
|
+
export declare const defaultTextMapGetter: TextMapGetter;
|
|
83
|
+
export declare const defaultTextMapSetter: TextMapSetter;
|
|
84
|
+
//# sourceMappingURL=TextMapPropagator.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export var defaultTextMapGetter = {
|
|
17
|
+
get: function (carrier, key) {
|
|
18
|
+
if (carrier == null) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return carrier[key];
|
|
22
|
+
},
|
|
23
|
+
keys: function (carrier) {
|
|
24
|
+
if (carrier == null) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
return Object.keys(carrier);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export var defaultTextMapSetter = {
|
|
31
|
+
set: function (carrier, key, value) {
|
|
32
|
+
if (carrier == null) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
carrier[key] = value;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=TextMapPropagator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/TextMapPropagator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkGH,MAAM,CAAC,IAAM,oBAAoB,GAAkB;IACjD,GAAG,YAAC,OAAO,EAAE,GAAG;QACd,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,YAAC,OAAO;QACV,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,oBAAoB,GAAkB;IACjD,GAAG,YAAC,OAAO,EAAE,GAAG,EAAE,KAAK;QACrB,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACvB,CAAC;CACF,CAAC"}
|
|
@@ -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,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { INVALID_SPAN_CONTEXT } from './spancontext-utils';
|
|
17
|
+
/**
|
|
18
|
+
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
|
19
|
+
* implementation is available. All operations are no-op including context
|
|
20
|
+
* propagation.
|
|
21
|
+
*/
|
|
22
|
+
var NonRecordingSpan = /** @class */ (function () {
|
|
23
|
+
function NonRecordingSpan(_spanContext) {
|
|
24
|
+
if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }
|
|
25
|
+
this._spanContext = _spanContext;
|
|
26
|
+
}
|
|
27
|
+
// Returns a SpanContext.
|
|
28
|
+
NonRecordingSpan.prototype.spanContext = function () {
|
|
29
|
+
return this._spanContext;
|
|
30
|
+
};
|
|
31
|
+
// By default does nothing
|
|
32
|
+
NonRecordingSpan.prototype.setAttribute = function (_key, _value) {
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
// By default does nothing
|
|
36
|
+
NonRecordingSpan.prototype.setAttributes = function (_attributes) {
|
|
37
|
+
return this;
|
|
38
|
+
};
|
|
39
|
+
// By default does nothing
|
|
40
|
+
NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {
|
|
41
|
+
return this;
|
|
42
|
+
};
|
|
43
|
+
// By default does nothing
|
|
44
|
+
NonRecordingSpan.prototype.setStatus = function (_status) {
|
|
45
|
+
return this;
|
|
46
|
+
};
|
|
47
|
+
// By default does nothing
|
|
48
|
+
NonRecordingSpan.prototype.updateName = function (_name) {
|
|
49
|
+
return this;
|
|
50
|
+
};
|
|
51
|
+
// By default does nothing
|
|
52
|
+
NonRecordingSpan.prototype.end = function (_endTime) { };
|
|
53
|
+
// isRecording always returns false for NonRecordingSpan.
|
|
54
|
+
NonRecordingSpan.prototype.isRecording = function () {
|
|
55
|
+
return false;
|
|
56
|
+
};
|
|
57
|
+
// By default does nothing
|
|
58
|
+
NonRecordingSpan.prototype.recordException = function (_exception, _time) { };
|
|
59
|
+
return NonRecordingSpan;
|
|
60
|
+
}());
|
|
61
|
+
export { NonRecordingSpan };
|
|
62
|
+
//# sourceMappingURL=NonRecordingSpan.js.map
|