@opentelemetry/api 0.21.0 → 1.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -73
- package/README.md +5 -46
- package/build/src/api/context.d.ts +4 -6
- package/build/src/api/context.js +14 -12
- package/build/src/api/context.js.map +1 -1
- package/build/src/api/diag.d.ts +3 -7
- package/build/src/api/diag.js +3 -15
- package/build/src/api/diag.js.map +1 -1
- package/build/src/api/propagation.d.ts +2 -10
- package/build/src/api/propagation.js +5 -13
- package/build/src/api/propagation.js.map +1 -1
- package/build/src/api/trace.d.ts +3 -12
- package/build/src/api/trace.js +4 -12
- package/build/src/api/trace.js.map +1 -1
- package/build/{esm/baggage/types.d.ts → src/baggage/Baggage.d.ts} +2 -20
- package/build/{esm/baggage/types.js → src/baggage/Baggage.js} +3 -2
- package/build/src/baggage/Baggage.js.map +1 -0
- package/build/src/baggage/Entry.d.ts +20 -0
- package/build/src/baggage/{types.js → Entry.js} +1 -1
- package/build/src/baggage/Entry.js.map +1 -0
- package/build/src/baggage/{utils.d.ts → index.d.ts} +5 -2
- package/build/src/baggage/{utils.js → index.js} +16 -5
- package/build/src/baggage/index.js.map +1 -0
- package/build/{esm/baggage/internal/baggage-impl.d.ts → src/baggage/internal/baggage.d.ts} +3 -2
- package/build/src/baggage/internal/{baggage-impl.js → baggage.js} +1 -1
- package/build/src/baggage/internal/baggage.js.map +1 -0
- package/build/src/context/NoopContextManager.d.ts +1 -1
- package/build/src/context/NoopContextManager.js +8 -6
- package/build/src/context/NoopContextManager.js.map +1 -1
- package/build/src/context/context.d.ts +59 -0
- package/build/src/context/context.js +101 -7
- package/build/src/context/context.js.map +1 -1
- package/build/src/context/types.d.ts +2 -2
- package/build/src/diag/types.d.ts +0 -6
- package/build/src/index.d.ts +8 -2
- package/build/src/index.js +9 -4
- package/build/src/index.js.map +1 -1
- package/build/src/internal/global-utils.d.ts +1 -1
- package/build/src/internal/global-utils.js +5 -7
- package/build/src/internal/global-utils.js.map +1 -1
- package/build/src/propagation/NoopTextMapPropagator.d.ts +1 -0
- package/build/src/propagation/NoopTextMapPropagator.js +2 -1
- package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
- package/build/src/trace/Event.d.ts +9 -0
- package/build/{esm/diag/index.js → src/trace/Event.js} +3 -3
- package/build/src/trace/Event.js.map +1 -0
- package/build/{esm/trace/NonRecordingSpan.d.ts → src/trace/NoopSpan.d.ts} +4 -4
- package/build/src/trace/{NonRecordingSpan.js → NoopSpan.js} +17 -17
- package/build/src/trace/NoopSpan.js.map +1 -0
- package/build/src/trace/NoopTracer.d.ts +1 -3
- package/build/src/trace/NoopTracer.js +8 -32
- package/build/src/trace/NoopTracer.js.map +1 -1
- package/build/src/trace/NoopTracerProvider.d.ts +1 -0
- package/build/src/trace/NoopTracerProvider.js +3 -2
- package/build/src/trace/NoopTracerProvider.js.map +1 -1
- package/build/src/trace/ProxyTracer.d.ts +0 -1
- package/build/src/trace/ProxyTracer.js +1 -5
- package/build/src/trace/ProxyTracer.js.map +1 -1
- package/build/src/trace/ProxyTracerProvider.js +1 -2
- package/build/src/trace/ProxyTracerProvider.js.map +1 -1
- package/build/src/trace/TimedEvent.d.ts +10 -0
- package/build/{esm/context/types.js → src/trace/TimedEvent.js} +3 -2
- package/build/src/trace/TimedEvent.js.map +1 -0
- package/build/src/trace/link.d.ts +3 -3
- package/build/src/trace/link_context.d.ts +6 -0
- package/build/src/trace/link_context.js +18 -0
- package/build/src/trace/link_context.js.map +1 -0
- package/build/src/trace/span.d.ts +1 -1
- package/build/src/trace/spancontext-utils.d.ts +0 -8
- package/build/src/trace/spancontext-utils.js +1 -27
- package/build/src/trace/spancontext-utils.js.map +1 -1
- package/build/src/trace/tracer.d.ts +0 -46
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +15 -20
- package/build/esm/api/context.d.ts +0 -41
- package/build/esm/api/context.js +0 -89
- package/build/esm/api/context.js.map +0 -1
- package/build/esm/api/diag.d.ts +0 -38
- package/build/esm/api/diag.js +0 -89
- package/build/esm/api/diag.js.map +0 -1
- package/build/esm/api/propagation.d.ts +0 -48
- package/build/esm/api/propagation.js +0 -87
- package/build/esm/api/propagation.js.map +0 -1
- package/build/esm/api/trace.d.ts +0 -39
- package/build/esm/api/trace.js +0 -72
- package/build/esm/api/trace.js.map +0 -1
- package/build/esm/baggage/context-helpers.d.ts +0 -23
- package/build/esm/baggage/context-helpers.js +0 -47
- package/build/esm/baggage/context-helpers.js.map +0 -1
- package/build/esm/baggage/internal/baggage-impl.js +0 -61
- package/build/esm/baggage/internal/baggage-impl.js.map +0 -1
- package/build/esm/baggage/internal/symbol.d.ts +0 -5
- package/build/esm/baggage/internal/symbol.js +0 -20
- package/build/esm/baggage/internal/symbol.js.map +0 -1
- package/build/esm/baggage/types.js.map +0 -1
- package/build/esm/baggage/utils.d.ts +0 -15
- package/build/esm/baggage/utils.js +0 -46
- package/build/esm/baggage/utils.js.map +0 -1
- package/build/esm/common/Exception.d.ts +0 -26
- package/build/esm/common/Exception.js +0 -17
- package/build/esm/common/Exception.js.map +0 -1
- package/build/esm/common/Time.d.ts +0 -8
- package/build/esm/common/Time.js +0 -2
- package/build/esm/common/Time.js.map +0 -1
- package/build/esm/context/NoopContextManager.d.ts +0 -9
- package/build/esm/context/NoopContextManager.js +0 -47
- package/build/esm/context/NoopContextManager.js.map +0 -1
- package/build/esm/context/context.d.ts +0 -6
- package/build/esm/context/context.js +0 -52
- package/build/esm/context/context.js.map +0 -1
- package/build/esm/context/types.d.ts +0 -52
- package/build/esm/context/types.js.map +0 -1
- package/build/esm/diag/ComponentLogger.d.ts +0 -20
- package/build/esm/diag/ComponentLogger.js +0 -77
- package/build/esm/diag/ComponentLogger.js.map +0 -1
- package/build/esm/diag/consoleLogger.d.ts +0 -38
- package/build/esm/diag/consoleLogger.js +0 -54
- package/build/esm/diag/consoleLogger.js.map +0 -1
- package/build/esm/diag/index.d.ts +0 -3
- package/build/esm/diag/index.js.map +0 -1
- package/build/esm/diag/internal/logLevelLogger.d.ts +0 -3
- package/build/esm/diag/internal/logLevelLogger.js +0 -41
- package/build/esm/diag/internal/logLevelLogger.js.map +0 -1
- package/build/esm/diag/internal/noopLogger.d.ts +0 -8
- package/build/esm/diag/internal/noopLogger.js +0 -31
- package/build/esm/diag/internal/noopLogger.js.map +0 -1
- package/build/esm/diag/types.d.ts +0 -70
- package/build/esm/diag/types.js +0 -41
- package/build/esm/diag/types.js.map +0 -1
- package/build/esm/index.d.ts +0 -53
- package/build/esm/index.js +0 -63
- package/build/esm/index.js.map +0 -1
- package/build/esm/internal/global-utils.d.ts +0 -16
- package/build/esm/internal/global-utils.js +0 -60
- package/build/esm/internal/global-utils.js.map +0 -1
- package/build/esm/internal/semver.d.ts +0 -34
- package/build/esm/internal/semver.js +0 -106
- package/build/esm/internal/semver.js.map +0 -1
- package/build/esm/platform/browser/globalThis.d.ts +0 -3
- package/build/esm/platform/browser/globalThis.js +0 -19
- package/build/esm/platform/browser/globalThis.js.map +0 -1
- package/build/esm/platform/browser/index.d.ts +0 -2
- package/build/esm/platform/browser/index.js +0 -17
- package/build/esm/platform/browser/index.js.map +0 -1
- package/build/esm/platform/index.d.ts +0 -2
- package/build/esm/platform/index.js +0 -17
- package/build/esm/platform/index.js.map +0 -1
- package/build/esm/platform/node/globalThis.d.ts +0 -3
- package/build/esm/platform/node/globalThis.js +0 -19
- package/build/esm/platform/node/globalThis.js.map +0 -1
- package/build/esm/platform/node/index.d.ts +0 -2
- package/build/esm/platform/node/index.js +0 -17
- package/build/esm/platform/node/index.js.map +0 -1
- package/build/esm/propagation/NoopTextMapPropagator.d.ts +0 -13
- package/build/esm/propagation/NoopTextMapPropagator.js +0 -34
- package/build/esm/propagation/NoopTextMapPropagator.js.map +0 -1
- package/build/esm/propagation/TextMapPropagator.d.ts +0 -84
- package/build/esm/propagation/TextMapPropagator.js +0 -38
- package/build/esm/propagation/TextMapPropagator.js.map +0 -1
- package/build/esm/trace/NonRecordingSpan.js +0 -62
- package/build/esm/trace/NonRecordingSpan.js.map +0 -1
- package/build/esm/trace/NoopTracer.d.ts +0 -14
- package/build/esm/trace/NoopTracer.js +0 -74
- package/build/esm/trace/NoopTracer.js.map +0 -1
- package/build/esm/trace/NoopTracerProvider.d.ts +0 -12
- package/build/esm/trace/NoopTracerProvider.js +0 -32
- package/build/esm/trace/NoopTracerProvider.js.map +0 -1
- package/build/esm/trace/ProxyTracer.d.ts +0 -23
- package/build/esm/trace/ProxyTracer.js +0 -51
- package/build/esm/trace/ProxyTracer.js.map +0 -1
- package/build/esm/trace/ProxyTracerProvider.d.ts +0 -24
- package/build/esm/trace/ProxyTracerProvider.js +0 -54
- package/build/esm/trace/ProxyTracerProvider.js.map +0 -1
- package/build/esm/trace/Sampler.d.ts +0 -30
- package/build/esm/trace/Sampler.js +0 -17
- package/build/esm/trace/Sampler.js.map +0 -1
- package/build/esm/trace/SamplingResult.d.ts +0 -39
- package/build/esm/trace/SamplingResult.js +0 -38
- package/build/esm/trace/SamplingResult.js.map +0 -1
- package/build/esm/trace/SpanOptions.d.ts +0 -23
- package/build/esm/trace/SpanOptions.js +0 -17
- package/build/esm/trace/SpanOptions.js.map +0 -1
- package/build/esm/trace/attributes.d.ts +0 -10
- package/build/esm/trace/attributes.js +0 -17
- package/build/esm/trace/attributes.js.map +0 -1
- package/build/esm/trace/context-utils.d.ts +0 -37
- package/build/esm/trace/context-utils.js +0 -66
- package/build/esm/trace/context-utils.js.map +0 -1
- package/build/esm/trace/link.d.ts +0 -24
- package/build/esm/trace/link.js +0 -17
- package/build/esm/trace/link.js.map +0 -1
- package/build/esm/trace/span.d.ts +0 -101
- package/build/esm/trace/span.js +0 -17
- package/build/esm/trace/span.js.map +0 -1
- package/build/esm/trace/span_context.d.ts +0 -53
- package/build/esm/trace/span_context.js +0 -17
- package/build/esm/trace/span_context.js.map +0 -1
- package/build/esm/trace/span_kind.d.ts +0 -27
- package/build/esm/trace/span_kind.js +0 -43
- package/build/esm/trace/span_kind.js.map +0 -1
- package/build/esm/trace/spancontext-utils.d.ts +0 -20
- package/build/esm/trace/spancontext-utils.js +0 -49
- package/build/esm/trace/spancontext-utils.js.map +0 -1
- package/build/esm/trace/status.d.ts +0 -25
- package/build/esm/trace/status.js +0 -20
- package/build/esm/trace/status.js.map +0 -1
- package/build/esm/trace/trace_flags.d.ts +0 -7
- package/build/esm/trace/trace_flags.js +0 -23
- package/build/esm/trace/trace_flags.js.map +0 -1
- package/build/esm/trace/trace_state.d.ts +0 -38
- package/build/esm/trace/trace_state.js +0 -17
- package/build/esm/trace/trace_state.js.map +0 -1
- package/build/esm/trace/tracer.d.ts +0 -70
- package/build/esm/trace/tracer.js +0 -17
- package/build/esm/trace/tracer.js.map +0 -1
- package/build/esm/trace/tracer_provider.d.ts +0 -19
- package/build/esm/trace/tracer_provider.js +0 -17
- package/build/esm/trace/tracer_provider.js.map +0 -1
- package/build/esm/version.d.ts +0 -2
- package/build/esm/version.js +0 -18
- package/build/esm/version.js.map +0 -1
- package/build/src/baggage/context-helpers.d.ts +0 -23
- package/build/src/baggage/context-helpers.js +0 -53
- package/build/src/baggage/context-helpers.js.map +0 -1
- package/build/src/baggage/internal/baggage-impl.d.ts +0 -12
- package/build/src/baggage/internal/baggage-impl.js.map +0 -1
- package/build/src/baggage/types.d.ts +0 -60
- package/build/src/baggage/types.js.map +0 -1
- package/build/src/baggage/utils.js.map +0 -1
- package/build/src/diag/ComponentLogger.d.ts +0 -20
- package/build/src/diag/ComponentLogger.js +0 -80
- package/build/src/diag/ComponentLogger.js.map +0 -1
- package/build/src/trace/NonRecordingSpan.d.ts +0 -25
- package/build/src/trace/NonRecordingSpan.js.map +0 -1
- package/build/src/trace/context-utils.d.ts +0 -37
- package/build/src/trace/context-utils.js +0 -74
- package/build/src/trace/context-utils.js.map +0 -1
package/build/esm/api/diag.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLogLevel } from '../diag/types';
|
|
2
|
-
/**
|
|
3
|
-
* Singleton object which represents the entry point to the OpenTelemetry internal
|
|
4
|
-
* diagnostic API
|
|
5
|
-
*/
|
|
6
|
-
export declare class DiagAPI implements DiagLogger {
|
|
7
|
-
private static _instance?;
|
|
8
|
-
/** Get the singleton instance of the DiagAPI API */
|
|
9
|
-
static instance(): DiagAPI;
|
|
10
|
-
/**
|
|
11
|
-
* Private internal constructor
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
private constructor();
|
|
15
|
-
/**
|
|
16
|
-
* Set the global DiagLogger and DiagLogLevel.
|
|
17
|
-
* If a global diag logger is already set, this will override it.
|
|
18
|
-
*
|
|
19
|
-
* @param logger - [Optional] The DiagLogger instance to set as the default logger.
|
|
20
|
-
* @param logLevel - [Optional] The DiagLogLevel used to filter logs sent to the logger. If not provided it will default to INFO.
|
|
21
|
-
* @returns true if the logger was successfully registered, else false
|
|
22
|
-
*/
|
|
23
|
-
setLogger: (logger: DiagLogger, logLevel?: DiagLogLevel) => boolean;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
createComponentLogger: (options: ComponentLoggerOptions) => DiagLogger;
|
|
28
|
-
verbose: DiagLogFunction;
|
|
29
|
-
debug: DiagLogFunction;
|
|
30
|
-
info: DiagLogFunction;
|
|
31
|
-
warn: DiagLogFunction;
|
|
32
|
-
error: DiagLogFunction;
|
|
33
|
-
/**
|
|
34
|
-
* Unregister the global logger and return to Noop
|
|
35
|
-
*/
|
|
36
|
-
disable: () => void;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=diag.d.ts.map
|
package/build/esm/api/diag.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { DiagComponentLogger } from '../diag/ComponentLogger';
|
|
17
|
-
import { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';
|
|
18
|
-
import { DiagLogLevel, } from '../diag/types';
|
|
19
|
-
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
|
20
|
-
var API_NAME = 'diag';
|
|
21
|
-
/**
|
|
22
|
-
* Singleton object which represents the entry point to the OpenTelemetry internal
|
|
23
|
-
* diagnostic API
|
|
24
|
-
*/
|
|
25
|
-
var DiagAPI = /** @class */ (function () {
|
|
26
|
-
/**
|
|
27
|
-
* Private internal constructor
|
|
28
|
-
* @private
|
|
29
|
-
*/
|
|
30
|
-
function DiagAPI() {
|
|
31
|
-
function _logProxy(funcName) {
|
|
32
|
-
return function () {
|
|
33
|
-
var logger = getGlobal('diag');
|
|
34
|
-
// shortcut if logger not set
|
|
35
|
-
if (!logger)
|
|
36
|
-
return;
|
|
37
|
-
return logger[funcName].apply(logger,
|
|
38
|
-
// work around Function.prototype.apply types
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
-
arguments);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
// Using self local variable for minification purposes as 'this' cannot be minified
|
|
44
|
-
var self = this;
|
|
45
|
-
// DiagAPI specific functions
|
|
46
|
-
self.setLogger = function (logger, logLevel) {
|
|
47
|
-
var _a, _b;
|
|
48
|
-
if (logLevel === void 0) { logLevel = DiagLogLevel.INFO; }
|
|
49
|
-
if (logger === self) {
|
|
50
|
-
// There isn't much we can do here.
|
|
51
|
-
// Logging to the console might break the user application.
|
|
52
|
-
// Try to log to self. If a logger was previously registered it will receive the log.
|
|
53
|
-
var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');
|
|
54
|
-
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
var oldLogger = getGlobal('diag');
|
|
58
|
-
var newLogger = createLogLevelDiagLogger(logLevel, logger);
|
|
59
|
-
// There already is an logger registered. We'll let it know before overwriting it.
|
|
60
|
-
if (oldLogger) {
|
|
61
|
-
var stack = (_b = new Error().stack) !== null && _b !== void 0 ? _b : '<failed to generate stacktrace>';
|
|
62
|
-
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
63
|
-
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
64
|
-
}
|
|
65
|
-
return registerGlobal('diag', newLogger, true);
|
|
66
|
-
};
|
|
67
|
-
self.disable = function () {
|
|
68
|
-
unregisterGlobal(API_NAME);
|
|
69
|
-
};
|
|
70
|
-
self.createComponentLogger = function (options) {
|
|
71
|
-
return new DiagComponentLogger(options);
|
|
72
|
-
};
|
|
73
|
-
self.verbose = _logProxy('verbose');
|
|
74
|
-
self.debug = _logProxy('debug');
|
|
75
|
-
self.info = _logProxy('info');
|
|
76
|
-
self.warn = _logProxy('warn');
|
|
77
|
-
self.error = _logProxy('error');
|
|
78
|
-
}
|
|
79
|
-
/** Get the singleton instance of the DiagAPI API */
|
|
80
|
-
DiagAPI.instance = function () {
|
|
81
|
-
if (!this._instance) {
|
|
82
|
-
this._instance = new DiagAPI();
|
|
83
|
-
}
|
|
84
|
-
return this._instance;
|
|
85
|
-
};
|
|
86
|
-
return DiagAPI;
|
|
87
|
-
}());
|
|
88
|
-
export { DiagAPI };
|
|
89
|
-
//# sourceMappingURL=diag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diag.js","sourceRoot":"","sources":["../../../src/api/diag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAIL,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,IAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;GAGG;AACH;IAYE;;;OAGG;IACH;QACE,SAAS,SAAS,CAAC,QAA0B;YAC3C,OAAO;gBACL,IAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjC,6BAA6B;gBAC7B,IAAI,CAAC,MAAM;oBAAE,OAAO;gBACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAC3B,MAAM;gBACN,6CAA6C;gBAC7C,8DAA8D;gBAC9D,SAAgB,CACjB,CAAC;YACJ,CAAC,CAAC;QACJ,CAAC;QAED,mFAAmF;QACnF,IAAM,IAAI,GAAG,IAAI,CAAC;QAElB,6BAA6B;QAE7B,IAAI,CAAC,SAAS,GAAG,UACf,MAAkB,EAClB,QAA0C;;YAA1C,yBAAA,EAAA,WAAyB,YAAY,CAAC,IAAI;YAE1C,IAAI,MAAM,KAAK,IAAI,EAAE;gBACnB,mCAAmC;gBACnC,2DAA2D;gBAC3D,qFAAqF;gBACrF,IAAM,GAAG,GAAG,IAAI,KAAK,CACnB,oIAAoI,CACrI,CAAC;gBACF,IAAI,CAAC,KAAK,CAAC,MAAA,GAAG,CAAC,KAAK,mCAAI,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrC,OAAO,KAAK,CAAC;aACd;YAED,IAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;YACpC,IAAM,SAAS,GAAG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7D,kFAAkF;YAClF,IAAI,SAAS,EAAE;gBACb,IAAM,KAAK,GAAG,MAAA,IAAI,KAAK,EAAE,CAAC,KAAK,mCAAI,iCAAiC,CAAC;gBACrE,SAAS,CAAC,IAAI,CAAC,6CAA2C,KAAO,CAAC,CAAC;gBACnE,SAAS,CAAC,IAAI,CACZ,+DAA6D,KAAO,CACrE,CAAC;aACH;YAED,OAAO,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG;YACb,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC,CAAC;QAEF,IAAI,CAAC,qBAAqB,GAAG,UAAC,OAA+B;YAC3D,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IA3ED,oDAAoD;IACtC,gBAAQ,GAAtB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;SAChC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAiGH,cAAC;AAAD,CAAC,AA3GD,IA2GC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Context } from '../context/types';
|
|
2
|
-
import { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
|
|
3
|
-
import { getBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers';
|
|
4
|
-
import { createBaggage } from '../baggage/utils';
|
|
5
|
-
/**
|
|
6
|
-
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
7
|
-
*/
|
|
8
|
-
export declare class PropagationAPI {
|
|
9
|
-
private static _instance?;
|
|
10
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
11
|
-
private constructor();
|
|
12
|
-
/** Get the singleton instance of the Propagator API */
|
|
13
|
-
static getInstance(): PropagationAPI;
|
|
14
|
-
/**
|
|
15
|
-
* Set the current propagator.
|
|
16
|
-
*
|
|
17
|
-
* @returns true if the propagator was successfully registered, else false
|
|
18
|
-
*/
|
|
19
|
-
setGlobalPropagator(propagator: TextMapPropagator): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Inject context into a carrier to be propagated inter-process
|
|
22
|
-
*
|
|
23
|
-
* @param context Context carrying tracing data to inject
|
|
24
|
-
* @param carrier carrier to inject context into
|
|
25
|
-
* @param setter Function used to set values on the carrier
|
|
26
|
-
*/
|
|
27
|
-
inject<Carrier>(context: Context, carrier: Carrier, setter?: TextMapSetter<Carrier>): void;
|
|
28
|
-
/**
|
|
29
|
-
* Extract context from a carrier
|
|
30
|
-
*
|
|
31
|
-
* @param context Context which the newly created context will inherit from
|
|
32
|
-
* @param carrier Carrier to extract context from
|
|
33
|
-
* @param getter Function used to extract keys from a carrier
|
|
34
|
-
*/
|
|
35
|
-
extract<Carrier>(context: Context, carrier: Carrier, getter?: TextMapGetter<Carrier>): Context;
|
|
36
|
-
/**
|
|
37
|
-
* Return a list of all fields which may be used by the propagator.
|
|
38
|
-
*/
|
|
39
|
-
fields(): string[];
|
|
40
|
-
/** Remove the global propagator */
|
|
41
|
-
disable(): void;
|
|
42
|
-
createBaggage: typeof createBaggage;
|
|
43
|
-
getBaggage: typeof getBaggage;
|
|
44
|
-
setBaggage: typeof setBaggage;
|
|
45
|
-
deleteBaggage: typeof deleteBaggage;
|
|
46
|
-
private _getGlobalPropagator;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=propagation.d.ts.map
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
|
17
|
-
import { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';
|
|
18
|
-
import { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';
|
|
19
|
-
import { getBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';
|
|
20
|
-
import { createBaggage } from '../baggage/utils';
|
|
21
|
-
var API_NAME = 'propagation';
|
|
22
|
-
var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
23
|
-
/**
|
|
24
|
-
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
|
|
25
|
-
*/
|
|
26
|
-
var PropagationAPI = /** @class */ (function () {
|
|
27
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
28
|
-
function PropagationAPI() {
|
|
29
|
-
this.createBaggage = createBaggage;
|
|
30
|
-
this.getBaggage = getBaggage;
|
|
31
|
-
this.setBaggage = setBaggage;
|
|
32
|
-
this.deleteBaggage = deleteBaggage;
|
|
33
|
-
}
|
|
34
|
-
/** Get the singleton instance of the Propagator API */
|
|
35
|
-
PropagationAPI.getInstance = function () {
|
|
36
|
-
if (!this._instance) {
|
|
37
|
-
this._instance = new PropagationAPI();
|
|
38
|
-
}
|
|
39
|
-
return this._instance;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Set the current propagator.
|
|
43
|
-
*
|
|
44
|
-
* @returns true if the propagator was successfully registered, else false
|
|
45
|
-
*/
|
|
46
|
-
PropagationAPI.prototype.setGlobalPropagator = function (propagator) {
|
|
47
|
-
return registerGlobal(API_NAME, propagator);
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Inject context into a carrier to be propagated inter-process
|
|
51
|
-
*
|
|
52
|
-
* @param context Context carrying tracing data to inject
|
|
53
|
-
* @param carrier carrier to inject context into
|
|
54
|
-
* @param setter Function used to set values on the carrier
|
|
55
|
-
*/
|
|
56
|
-
PropagationAPI.prototype.inject = function (context, carrier, setter) {
|
|
57
|
-
if (setter === void 0) { setter = defaultTextMapSetter; }
|
|
58
|
-
return this._getGlobalPropagator().inject(context, carrier, setter);
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Extract context from a carrier
|
|
62
|
-
*
|
|
63
|
-
* @param context Context which the newly created context will inherit from
|
|
64
|
-
* @param carrier Carrier to extract context from
|
|
65
|
-
* @param getter Function used to extract keys from a carrier
|
|
66
|
-
*/
|
|
67
|
-
PropagationAPI.prototype.extract = function (context, carrier, getter) {
|
|
68
|
-
if (getter === void 0) { getter = defaultTextMapGetter; }
|
|
69
|
-
return this._getGlobalPropagator().extract(context, carrier, getter);
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Return a list of all fields which may be used by the propagator.
|
|
73
|
-
*/
|
|
74
|
-
PropagationAPI.prototype.fields = function () {
|
|
75
|
-
return this._getGlobalPropagator().fields();
|
|
76
|
-
};
|
|
77
|
-
/** Remove the global propagator */
|
|
78
|
-
PropagationAPI.prototype.disable = function () {
|
|
79
|
-
unregisterGlobal(API_NAME);
|
|
80
|
-
};
|
|
81
|
-
PropagationAPI.prototype._getGlobalPropagator = function () {
|
|
82
|
-
return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
83
|
-
};
|
|
84
|
-
return PropagationAPI;
|
|
85
|
-
}());
|
|
86
|
-
export { PropagationAPI };
|
|
87
|
-
//# sourceMappingURL=propagation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAIrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,IAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,IAAM,wBAAwB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAE7D;;GAEG;AACH;IAGE,+FAA+F;IAC/F;QA8DO,kBAAa,GAAG,aAAa,CAAC;QAE9B,eAAU,GAAG,UAAU,CAAC;QAExB,eAAU,GAAG,UAAU,CAAC;QAExB,kBAAa,GAAG,aAAa,CAAC;IApEd,CAAC;IAExB,uDAAuD;IACzC,0BAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,4CAAmB,GAA1B,UAA2B,UAA6B;QACtD,OAAO,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACI,+BAAM,GAAb,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,6BAAqD;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,gCAAO,GAAd,UACE,OAAgB,EAChB,OAAgB,EAChB,MAAqD;QAArD,uBAAA,EAAA,6BAAqD;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,+BAAM,GAAb;QACE,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,mCAAmC;IAC5B,gCAAO,GAAd;QACE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAUO,6CAAoB,GAA5B;QACE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,wBAAwB,CAAC;IACzD,CAAC;IACH,qBAAC;AAAD,CAAC,AA7ED,IA6EC"}
|
package/build/esm/api/trace.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
|
|
2
|
-
import { Tracer } from '../trace/tracer';
|
|
3
|
-
import { TracerProvider } from '../trace/tracer_provider';
|
|
4
|
-
import { deleteSpan, getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils';
|
|
5
|
-
/**
|
|
6
|
-
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
|
7
|
-
*/
|
|
8
|
-
export declare class TraceAPI {
|
|
9
|
-
private static _instance?;
|
|
10
|
-
private _proxyTracerProvider;
|
|
11
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
12
|
-
private constructor();
|
|
13
|
-
/** Get the singleton instance of the Trace API */
|
|
14
|
-
static getInstance(): TraceAPI;
|
|
15
|
-
/**
|
|
16
|
-
* Set the current global tracer.
|
|
17
|
-
*
|
|
18
|
-
* @returns true if the tracer provider was successfully registered, else false
|
|
19
|
-
*/
|
|
20
|
-
setGlobalTracerProvider(provider: TracerProvider): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the global tracer provider.
|
|
23
|
-
*/
|
|
24
|
-
getTracerProvider(): TracerProvider;
|
|
25
|
-
/**
|
|
26
|
-
* Returns a tracer from the global tracer provider.
|
|
27
|
-
*/
|
|
28
|
-
getTracer(name: string, version?: string): Tracer;
|
|
29
|
-
/** Remove the global tracer provider */
|
|
30
|
-
disable(): void;
|
|
31
|
-
wrapSpanContext: typeof wrapSpanContext;
|
|
32
|
-
isSpanContextValid: typeof isSpanContextValid;
|
|
33
|
-
deleteSpan: typeof deleteSpan;
|
|
34
|
-
getSpan: typeof getSpan;
|
|
35
|
-
getSpanContext: typeof getSpanContext;
|
|
36
|
-
setSpan: typeof setSpan;
|
|
37
|
-
setSpanContext: typeof setSpanContext;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=trace.d.ts.map
|
package/build/esm/api/trace.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
|
|
17
|
-
import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
|
|
18
|
-
import { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';
|
|
19
|
-
import { deleteSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';
|
|
20
|
-
var API_NAME = 'trace';
|
|
21
|
-
/**
|
|
22
|
-
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
|
|
23
|
-
*/
|
|
24
|
-
var TraceAPI = /** @class */ (function () {
|
|
25
|
-
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
26
|
-
function TraceAPI() {
|
|
27
|
-
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
28
|
-
this.wrapSpanContext = wrapSpanContext;
|
|
29
|
-
this.isSpanContextValid = isSpanContextValid;
|
|
30
|
-
this.deleteSpan = deleteSpan;
|
|
31
|
-
this.getSpan = getSpan;
|
|
32
|
-
this.getSpanContext = getSpanContext;
|
|
33
|
-
this.setSpan = setSpan;
|
|
34
|
-
this.setSpanContext = setSpanContext;
|
|
35
|
-
}
|
|
36
|
-
/** Get the singleton instance of the Trace API */
|
|
37
|
-
TraceAPI.getInstance = function () {
|
|
38
|
-
if (!this._instance) {
|
|
39
|
-
this._instance = new TraceAPI();
|
|
40
|
-
}
|
|
41
|
-
return this._instance;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Set the current global tracer.
|
|
45
|
-
*
|
|
46
|
-
* @returns true if the tracer provider was successfully registered, else false
|
|
47
|
-
*/
|
|
48
|
-
TraceAPI.prototype.setGlobalTracerProvider = function (provider) {
|
|
49
|
-
this._proxyTracerProvider.setDelegate(provider);
|
|
50
|
-
return registerGlobal(API_NAME, this._proxyTracerProvider);
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Returns the global tracer provider.
|
|
54
|
-
*/
|
|
55
|
-
TraceAPI.prototype.getTracerProvider = function () {
|
|
56
|
-
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Returns a tracer from the global tracer provider.
|
|
60
|
-
*/
|
|
61
|
-
TraceAPI.prototype.getTracer = function (name, version) {
|
|
62
|
-
return this.getTracerProvider().getTracer(name, version);
|
|
63
|
-
};
|
|
64
|
-
/** Remove the global tracer provider */
|
|
65
|
-
TraceAPI.prototype.disable = function () {
|
|
66
|
-
unregisterGlobal(API_NAME);
|
|
67
|
-
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
68
|
-
};
|
|
69
|
-
return TraceAPI;
|
|
70
|
-
}());
|
|
71
|
-
export { TraceAPI };
|
|
72
|
-
//# sourceMappingURL=trace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,wBAAwB,CAAC;AAEhC,IAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;GAEG;AACH;IAKE,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QA4ClD,oBAAe,GAAG,eAAe,CAAC;QAElC,uBAAkB,GAAG,kBAAkB,CAAC;QAExC,eAAU,GAAG,UAAU,CAAC;QAExB,YAAO,GAAG,OAAO,CAAC;QAElB,mBAAc,GAAG,cAAc,CAAC;QAEhC,YAAO,GAAG,OAAO,CAAC;QAElB,mBAAc,GAAG,cAAc,CAAC;IArDhB,CAAC;IAExB,kDAAkD;IACpC,oBAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,0CAAuB,GAA9B,UAA+B,QAAwB;QACrD,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACI,oCAAiB,GAAxB;QACE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,4BAAS,GAAhB,UAAiB,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,0BAAO,GAAd;QACE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,CAAC,oBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACxD,CAAC;IAeH,eAAC;AAAD,CAAC,AA5DD,IA4DC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Context } from '../context/types';
|
|
2
|
-
import { Baggage } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Retrieve the current baggage from the given context
|
|
5
|
-
*
|
|
6
|
-
* @param {Context} Context that manage all context values
|
|
7
|
-
* @returns {Baggage} Extracted baggage from the context
|
|
8
|
-
*/
|
|
9
|
-
export declare function getBaggage(context: Context): Baggage | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Store a baggage in the given context
|
|
12
|
-
*
|
|
13
|
-
* @param {Context} Context that manage all context values
|
|
14
|
-
* @param {Baggage} baggage that will be set in the actual context
|
|
15
|
-
*/
|
|
16
|
-
export declare function setBaggage(context: Context, baggage: Baggage): Context;
|
|
17
|
-
/**
|
|
18
|
-
* Delete the baggage stored in the given context
|
|
19
|
-
*
|
|
20
|
-
* @param {Context} Context that manage all context values
|
|
21
|
-
*/
|
|
22
|
-
export declare function deleteBaggage(context: Context): Context;
|
|
23
|
-
//# sourceMappingURL=context-helpers.d.ts.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { createContextKey } from '../context/context';
|
|
17
|
-
/**
|
|
18
|
-
* Baggage key
|
|
19
|
-
*/
|
|
20
|
-
var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
|
|
21
|
-
/**
|
|
22
|
-
* Retrieve the current baggage from the given context
|
|
23
|
-
*
|
|
24
|
-
* @param {Context} Context that manage all context values
|
|
25
|
-
* @returns {Baggage} Extracted baggage from the context
|
|
26
|
-
*/
|
|
27
|
-
export function getBaggage(context) {
|
|
28
|
-
return context.getValue(BAGGAGE_KEY) || undefined;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Store a baggage in the given context
|
|
32
|
-
*
|
|
33
|
-
* @param {Context} Context that manage all context values
|
|
34
|
-
* @param {Baggage} baggage that will be set in the actual context
|
|
35
|
-
*/
|
|
36
|
-
export function setBaggage(context, baggage) {
|
|
37
|
-
return context.setValue(BAGGAGE_KEY, baggage);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Delete the baggage stored in the given context
|
|
41
|
-
*
|
|
42
|
-
* @param {Context} Context that manage all context values
|
|
43
|
-
*/
|
|
44
|
-
export function deleteBaggage(context) {
|
|
45
|
-
return context.deleteValue(BAGGAGE_KEY);
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=context-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;GAEG;AACH,IAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var BaggageImpl = /** @class */ (function () {
|
|
17
|
-
function BaggageImpl(entries) {
|
|
18
|
-
this._entries = entries ? new Map(entries) : new Map();
|
|
19
|
-
}
|
|
20
|
-
BaggageImpl.prototype.getEntry = function (key) {
|
|
21
|
-
var entry = this._entries.get(key);
|
|
22
|
-
if (!entry) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
return Object.assign({}, entry);
|
|
26
|
-
};
|
|
27
|
-
BaggageImpl.prototype.getAllEntries = function () {
|
|
28
|
-
return Array.from(this._entries.entries()).map(function (_a) {
|
|
29
|
-
var k = _a[0], v = _a[1];
|
|
30
|
-
return [k, v];
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
BaggageImpl.prototype.setEntry = function (key, entry) {
|
|
34
|
-
var newBaggage = new BaggageImpl(this._entries);
|
|
35
|
-
newBaggage._entries.set(key, entry);
|
|
36
|
-
return newBaggage;
|
|
37
|
-
};
|
|
38
|
-
BaggageImpl.prototype.removeEntry = function (key) {
|
|
39
|
-
var newBaggage = new BaggageImpl(this._entries);
|
|
40
|
-
newBaggage._entries.delete(key);
|
|
41
|
-
return newBaggage;
|
|
42
|
-
};
|
|
43
|
-
BaggageImpl.prototype.removeEntries = function () {
|
|
44
|
-
var keys = [];
|
|
45
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
46
|
-
keys[_i] = arguments[_i];
|
|
47
|
-
}
|
|
48
|
-
var newBaggage = new BaggageImpl(this._entries);
|
|
49
|
-
for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {
|
|
50
|
-
var key = keys_1[_a];
|
|
51
|
-
newBaggage._entries.delete(key);
|
|
52
|
-
}
|
|
53
|
-
return newBaggage;
|
|
54
|
-
};
|
|
55
|
-
BaggageImpl.prototype.clear = function () {
|
|
56
|
-
return new BaggageImpl();
|
|
57
|
-
};
|
|
58
|
-
return BaggageImpl;
|
|
59
|
-
}());
|
|
60
|
-
export { BaggageImpl };
|
|
61
|
-
//# sourceMappingURL=baggage-impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;IAGE,qBAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,8BAAQ,GAAR,UAAS,GAAW;QAClB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,mCAAa,GAAb;QACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,EAAM;gBAAL,CAAC,QAAA,EAAE,CAAC,QAAA;YAAM,OAAA,CAAC,CAAC,EAAE,CAAC,CAAC;QAAN,CAAM,CAAC,CAAC;IACrE,CAAC;IAED,8BAAQ,GAAR,UAAS,GAAW,EAAE,KAAmB;QACvC,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,iCAAW,GAAX,UAAY,GAAW;QACrB,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,mCAAa,GAAb;QAAc,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,yBAAiB;;QAC7B,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAkB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAAnB,IAAM,GAAG,aAAA;YACZ,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,2BAAK,GAAL;QACE,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACH,kBAAC;AAAD,CAAC,AA3CD,IA2CC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Symbol used to make BaggageEntryMetadata an opaque type
|
|
18
|
-
*/
|
|
19
|
-
export var baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');
|
|
20
|
-
//# sourceMappingURL=symbol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,0BAA0B,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/baggage/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Create a new Baggage with optional entries
|
|
4
|
-
*
|
|
5
|
-
* @param entries An array of baggage entries the new baggage should contain
|
|
6
|
-
*/
|
|
7
|
-
export declare function createBaggage(entries?: Record<string, BaggageEntry>): Baggage;
|
|
8
|
-
/**
|
|
9
|
-
* Create a serializable BaggageEntryMetadata object from a string.
|
|
10
|
-
*
|
|
11
|
-
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
|
|
15
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { diag } from '..';
|
|
17
|
-
import { BaggageImpl } from './internal/baggage-impl';
|
|
18
|
-
import { baggageEntryMetadataSymbol } from './internal/symbol';
|
|
19
|
-
/**
|
|
20
|
-
* Create a new Baggage with optional entries
|
|
21
|
-
*
|
|
22
|
-
* @param entries An array of baggage entries the new baggage should contain
|
|
23
|
-
*/
|
|
24
|
-
export function createBaggage(entries) {
|
|
25
|
-
if (entries === void 0) { entries = {}; }
|
|
26
|
-
return new BaggageImpl(new Map(Object.entries(entries)));
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a serializable BaggageEntryMetadata object from a string.
|
|
30
|
-
*
|
|
31
|
-
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export function baggageEntryMetadataFromString(str) {
|
|
35
|
-
if (typeof str !== 'string') {
|
|
36
|
-
diag.error("Cannot create baggage metadata from unknown type: " + typeof str);
|
|
37
|
-
str = '';
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
__TYPE__: baggageEntryMetadataSymbol,
|
|
41
|
-
toString: function () {
|
|
42
|
-
return str;
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,OAA0C;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,uDAAqD,OAAO,GAAK,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,0BAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|