@opentelemetry/api 1.0.0-rc.3 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +53 -6
  3. package/build/esm/api/context.d.ts +41 -0
  4. package/build/esm/api/context.js +90 -0
  5. package/build/esm/api/context.js.map +1 -0
  6. package/build/esm/api/diag.d.ts +38 -0
  7. package/build/esm/api/diag.js +89 -0
  8. package/build/esm/api/diag.js.map +1 -0
  9. package/build/esm/api/propagation.d.ts +48 -0
  10. package/build/esm/api/propagation.js +88 -0
  11. package/build/esm/api/propagation.js.map +1 -0
  12. package/build/esm/api/trace.d.ts +39 -0
  13. package/build/esm/api/trace.js +76 -0
  14. package/build/esm/api/trace.js.map +1 -0
  15. package/build/esm/baggage/context-helpers.d.ts +23 -0
  16. package/build/esm/baggage/context-helpers.js +47 -0
  17. package/build/esm/baggage/context-helpers.js.map +1 -0
  18. package/build/{src/baggage/internal/baggage.d.ts → esm/baggage/internal/baggage-impl.d.ts} +2 -3
  19. package/build/esm/baggage/internal/baggage-impl.js +61 -0
  20. package/build/esm/baggage/internal/baggage-impl.js.map +1 -0
  21. package/build/esm/baggage/internal/symbol.d.ts +5 -0
  22. package/build/esm/baggage/internal/symbol.js +20 -0
  23. package/build/esm/baggage/internal/symbol.js.map +1 -0
  24. package/build/{src/baggage/Baggage.d.ts → esm/baggage/types.d.ts} +20 -2
  25. package/build/{src/trace/Event.js → esm/baggage/types.js} +2 -3
  26. package/build/esm/baggage/types.js.map +1 -0
  27. package/build/{src/baggage/index.d.ts → esm/baggage/utils.d.ts} +2 -5
  28. package/build/esm/baggage/utils.js +47 -0
  29. package/build/esm/baggage/utils.js.map +1 -0
  30. package/build/esm/common/Exception.d.ts +26 -0
  31. package/build/{src/baggage/Baggage.js → esm/common/Exception.js} +2 -3
  32. package/build/esm/common/Exception.js.map +1 -0
  33. package/build/esm/common/Time.d.ts +8 -0
  34. package/build/esm/common/Time.js +2 -0
  35. package/build/esm/common/Time.js.map +1 -0
  36. package/build/esm/context/NoopContextManager.d.ts +9 -0
  37. package/build/esm/context/NoopContextManager.js +47 -0
  38. package/build/esm/context/NoopContextManager.js.map +1 -0
  39. package/build/esm/context/context.d.ts +6 -0
  40. package/build/esm/context/context.js +52 -0
  41. package/build/esm/context/context.js.map +1 -0
  42. package/build/esm/context/types.d.ts +52 -0
  43. package/build/{src/trace/TimedEvent.js → esm/context/types.js} +2 -3
  44. package/build/esm/context/types.js.map +1 -0
  45. package/build/esm/diag/ComponentLogger.d.ts +20 -0
  46. package/build/esm/diag/ComponentLogger.js +77 -0
  47. package/build/esm/diag/ComponentLogger.js.map +1 -0
  48. package/build/esm/diag/consoleLogger.d.ts +38 -0
  49. package/build/esm/diag/consoleLogger.js +54 -0
  50. package/build/esm/diag/consoleLogger.js.map +1 -0
  51. package/build/esm/diag/index.d.ts +3 -0
  52. package/build/esm/diag/index.js +18 -0
  53. package/build/esm/diag/index.js.map +1 -0
  54. package/build/esm/diag/internal/logLevelLogger.d.ts +3 -0
  55. package/build/esm/diag/internal/logLevelLogger.js +41 -0
  56. package/build/esm/diag/internal/logLevelLogger.js.map +1 -0
  57. package/build/esm/diag/internal/noopLogger.d.ts +8 -0
  58. package/build/esm/diag/internal/noopLogger.js +31 -0
  59. package/build/esm/diag/internal/noopLogger.js.map +1 -0
  60. package/build/esm/diag/types.d.ts +70 -0
  61. package/build/esm/diag/types.js +41 -0
  62. package/build/esm/diag/types.js.map +1 -0
  63. package/build/esm/index.d.ts +54 -0
  64. package/build/esm/index.js +64 -0
  65. package/build/esm/index.js.map +1 -0
  66. package/build/esm/internal/global-utils.d.ts +16 -0
  67. package/build/esm/internal/global-utils.js +59 -0
  68. package/build/esm/internal/global-utils.js.map +1 -0
  69. package/build/esm/internal/semver.d.ts +34 -0
  70. package/build/esm/internal/semver.js +118 -0
  71. package/build/esm/internal/semver.js.map +1 -0
  72. package/build/esm/platform/browser/globalThis.d.ts +3 -0
  73. package/build/esm/platform/browser/globalThis.js +19 -0
  74. package/build/esm/platform/browser/globalThis.js.map +1 -0
  75. package/build/esm/platform/browser/index.d.ts +2 -0
  76. package/build/esm/platform/browser/index.js +17 -0
  77. package/build/esm/platform/browser/index.js.map +1 -0
  78. package/build/esm/platform/index.d.ts +2 -0
  79. package/build/esm/platform/index.js +17 -0
  80. package/build/esm/platform/index.js.map +1 -0
  81. package/build/esm/platform/node/globalThis.d.ts +3 -0
  82. package/build/esm/platform/node/globalThis.js +19 -0
  83. package/build/esm/platform/node/globalThis.js.map +1 -0
  84. package/build/esm/platform/node/index.d.ts +2 -0
  85. package/build/esm/platform/node/index.js +17 -0
  86. package/build/esm/platform/node/index.js.map +1 -0
  87. package/build/esm/propagation/NoopTextMapPropagator.d.ts +13 -0
  88. package/build/esm/propagation/NoopTextMapPropagator.js +34 -0
  89. package/build/esm/propagation/NoopTextMapPropagator.js.map +1 -0
  90. package/build/esm/propagation/TextMapPropagator.d.ts +84 -0
  91. package/build/esm/propagation/TextMapPropagator.js +38 -0
  92. package/build/esm/propagation/TextMapPropagator.js.map +1 -0
  93. package/build/{src/trace/NoopSpan.d.ts → esm/trace/NonRecordingSpan.d.ts} +4 -4
  94. package/build/{src/trace/NoopSpan.js → esm/trace/NonRecordingSpan.js} +18 -21
  95. package/build/esm/trace/NonRecordingSpan.js.map +1 -0
  96. package/build/esm/trace/NoopTracer.d.ts +14 -0
  97. package/build/esm/trace/NoopTracer.js +75 -0
  98. package/build/esm/trace/NoopTracer.js.map +1 -0
  99. package/build/esm/trace/NoopTracerProvider.d.ts +12 -0
  100. package/build/esm/trace/NoopTracerProvider.js +32 -0
  101. package/build/esm/trace/NoopTracerProvider.js.map +1 -0
  102. package/build/esm/trace/ProxyTracer.d.ts +25 -0
  103. package/build/esm/trace/ProxyTracer.js +52 -0
  104. package/build/esm/trace/ProxyTracer.js.map +1 -0
  105. package/build/esm/trace/ProxyTracerProvider.d.ts +24 -0
  106. package/build/esm/trace/ProxyTracerProvider.js +54 -0
  107. package/build/esm/trace/ProxyTracerProvider.js.map +1 -0
  108. package/build/esm/trace/Sampler.d.ts +30 -0
  109. package/build/esm/trace/Sampler.js +17 -0
  110. package/build/esm/trace/Sampler.js.map +1 -0
  111. package/build/esm/trace/SamplingResult.d.ts +39 -0
  112. package/build/esm/trace/SamplingResult.js +38 -0
  113. package/build/esm/trace/SamplingResult.js.map +1 -0
  114. package/build/esm/trace/SpanOptions.d.ts +23 -0
  115. package/build/esm/trace/SpanOptions.js +17 -0
  116. package/build/esm/trace/SpanOptions.js.map +1 -0
  117. package/build/esm/trace/attributes.d.ts +10 -0
  118. package/build/esm/trace/attributes.js +17 -0
  119. package/build/esm/trace/attributes.js.map +1 -0
  120. package/build/esm/trace/context-utils.d.ts +37 -0
  121. package/build/esm/trace/context-utils.js +66 -0
  122. package/build/esm/trace/context-utils.js.map +1 -0
  123. package/build/esm/trace/invalid-span-constants.d.ts +5 -0
  124. package/build/esm/trace/invalid-span-constants.js +24 -0
  125. package/build/esm/trace/invalid-span-constants.js.map +1 -0
  126. package/build/esm/trace/link.d.ts +24 -0
  127. package/build/esm/trace/link.js +17 -0
  128. package/build/esm/trace/link.js.map +1 -0
  129. package/build/esm/trace/span.d.ts +101 -0
  130. package/build/esm/trace/span.js +17 -0
  131. package/build/esm/trace/span.js.map +1 -0
  132. package/build/esm/trace/span_context.d.ts +53 -0
  133. package/build/esm/trace/span_context.js +17 -0
  134. package/build/esm/trace/span_context.js.map +1 -0
  135. package/build/esm/trace/span_kind.d.ts +27 -0
  136. package/build/esm/trace/span_kind.js +43 -0
  137. package/build/esm/trace/span_kind.js.map +1 -0
  138. package/build/esm/trace/spancontext-utils.d.ts +17 -0
  139. package/build/esm/trace/spancontext-utils.js +42 -0
  140. package/build/esm/trace/spancontext-utils.js.map +1 -0
  141. package/build/esm/trace/status.d.ts +25 -0
  142. package/build/esm/trace/status.js +20 -0
  143. package/build/esm/trace/status.js.map +1 -0
  144. package/build/esm/trace/trace_flags.d.ts +7 -0
  145. package/build/esm/trace/trace_flags.js +23 -0
  146. package/build/esm/trace/trace_flags.js.map +1 -0
  147. package/build/esm/trace/trace_state.d.ts +38 -0
  148. package/build/esm/trace/trace_state.js +17 -0
  149. package/build/esm/trace/trace_state.js.map +1 -0
  150. package/build/esm/trace/tracer.d.ts +71 -0
  151. package/build/esm/trace/tracer.js +17 -0
  152. package/build/esm/trace/tracer.js.map +1 -0
  153. package/build/esm/trace/tracer_provider.d.ts +19 -0
  154. package/build/esm/trace/tracer_provider.js +17 -0
  155. package/build/esm/trace/tracer_provider.js.map +1 -0
  156. package/build/esm/version.d.ts +2 -0
  157. package/build/esm/version.js +18 -0
  158. package/build/esm/version.js.map +1 -0
  159. package/build/src/api/context.d.ts +6 -4
  160. package/build/src/api/context.js +14 -15
  161. package/build/src/api/context.js.map +1 -1
  162. package/build/src/api/diag.d.ts +7 -3
  163. package/build/src/api/diag.js +16 -4
  164. package/build/src/api/diag.js.map +1 -1
  165. package/build/src/api/propagation.d.ts +10 -2
  166. package/build/src/api/propagation.js +15 -6
  167. package/build/src/api/propagation.js.map +1 -1
  168. package/build/src/api/trace.d.ts +12 -3
  169. package/build/src/api/trace.js +18 -6
  170. package/build/src/api/trace.js.map +1 -1
  171. package/build/src/baggage/context-helpers.d.ts +23 -0
  172. package/build/src/baggage/context-helpers.js +53 -0
  173. package/build/src/baggage/context-helpers.js.map +1 -0
  174. package/build/src/baggage/internal/baggage-impl.d.ts +12 -0
  175. package/build/src/baggage/internal/{baggage.js → baggage-impl.js} +1 -1
  176. package/build/src/baggage/internal/baggage-impl.js.map +1 -0
  177. package/build/src/baggage/types.d.ts +60 -0
  178. package/build/src/baggage/{Entry.js → types.js} +1 -1
  179. package/build/src/baggage/types.js.map +1 -0
  180. package/build/src/baggage/utils.d.ts +15 -0
  181. package/build/src/baggage/{index.js → utils.js} +6 -16
  182. package/build/src/baggage/utils.js.map +1 -0
  183. package/build/src/context/NoopContextManager.d.ts +1 -1
  184. package/build/src/context/NoopContextManager.js +6 -8
  185. package/build/src/context/NoopContextManager.js.map +1 -1
  186. package/build/src/context/context.d.ts +0 -59
  187. package/build/src/context/context.js +7 -101
  188. package/build/src/context/context.js.map +1 -1
  189. package/build/src/context/types.d.ts +2 -2
  190. package/build/src/diag/ComponentLogger.d.ts +20 -0
  191. package/build/src/diag/ComponentLogger.js +80 -0
  192. package/build/src/diag/ComponentLogger.js.map +1 -0
  193. package/build/src/diag/types.d.ts +6 -0
  194. package/build/src/index.d.ts +4 -9
  195. package/build/src/index.js +8 -12
  196. package/build/src/index.js.map +1 -1
  197. package/build/src/internal/global-utils.d.ts +2 -2
  198. package/build/src/internal/global-utils.js +12 -11
  199. package/build/src/internal/global-utils.js.map +1 -1
  200. package/build/src/internal/semver.js +13 -1
  201. package/build/src/internal/semver.js.map +1 -1
  202. package/build/src/propagation/NoopTextMapPropagator.d.ts +0 -1
  203. package/build/src/propagation/NoopTextMapPropagator.js +1 -2
  204. package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
  205. package/build/src/trace/NonRecordingSpan.d.ts +25 -0
  206. package/build/src/trace/NonRecordingSpan.js +65 -0
  207. package/build/src/trace/NonRecordingSpan.js.map +1 -0
  208. package/build/src/trace/NoopTracer.d.ts +3 -1
  209. package/build/src/trace/NoopTracer.js +33 -8
  210. package/build/src/trace/NoopTracer.js.map +1 -1
  211. package/build/src/trace/NoopTracerProvider.d.ts +0 -1
  212. package/build/src/trace/NoopTracerProvider.js +2 -3
  213. package/build/src/trace/NoopTracerProvider.js.map +1 -1
  214. package/build/src/trace/ProxyTracer.d.ts +5 -2
  215. package/build/src/trace/ProxyTracer.js +6 -1
  216. package/build/src/trace/ProxyTracer.js.map +1 -1
  217. package/build/src/trace/ProxyTracerProvider.js +2 -1
  218. package/build/src/trace/ProxyTracerProvider.js.map +1 -1
  219. package/build/src/trace/context-utils.d.ts +37 -0
  220. package/build/src/trace/context-utils.js +74 -0
  221. package/build/src/trace/context-utils.js.map +1 -0
  222. package/build/src/trace/invalid-span-constants.d.ts +5 -0
  223. package/build/src/trace/invalid-span-constants.js +27 -0
  224. package/build/src/trace/invalid-span-constants.js.map +1 -0
  225. package/build/src/trace/link.d.ts +3 -3
  226. package/build/src/trace/span.d.ts +1 -1
  227. package/build/src/trace/spancontext-utils.d.ts +8 -3
  228. package/build/src/trace/spancontext-utils.js +30 -11
  229. package/build/src/trace/spancontext-utils.js.map +1 -1
  230. package/build/src/trace/tracer.d.ts +47 -0
  231. package/build/src/version.d.ts +1 -1
  232. package/build/src/version.js +1 -1
  233. package/build/src/version.js.map +1 -1
  234. package/package.json +27 -19
  235. package/build/src/baggage/Baggage.js.map +0 -1
  236. package/build/src/baggage/Entry.d.ts +0 -20
  237. package/build/src/baggage/Entry.js.map +0 -1
  238. package/build/src/baggage/index.js.map +0 -1
  239. package/build/src/baggage/internal/baggage.js.map +0 -1
  240. package/build/src/trace/Event.d.ts +0 -9
  241. package/build/src/trace/Event.js.map +0 -1
  242. package/build/src/trace/NoopSpan.js.map +0 -1
  243. package/build/src/trace/TimedEvent.d.ts +0 -10
  244. package/build/src/trace/TimedEvent.js.map +0 -1
  245. package/build/src/trace/link_context.d.ts +0 -6
  246. package/build/src/trace/link_context.js +0 -18
  247. package/build/src/trace/link_context.js.map +0 -1
@@ -0,0 +1,52 @@
1
+ export interface Context {
2
+ /**
3
+ * Get a value from the context.
4
+ *
5
+ * @param key key which identifies a context value
6
+ */
7
+ getValue(key: symbol): unknown;
8
+ /**
9
+ * Create a new context which inherits from this context and has
10
+ * the given key set to the given value.
11
+ *
12
+ * @param key context key for which to set the value
13
+ * @param value value to set for the given key
14
+ */
15
+ setValue(key: symbol, value: unknown): Context;
16
+ /**
17
+ * Return a new context which inherits from this context but does
18
+ * not contain a value for the given key.
19
+ *
20
+ * @param key context key for which to clear a value
21
+ */
22
+ deleteValue(key: symbol): Context;
23
+ }
24
+ export interface ContextManager {
25
+ /**
26
+ * Get the current active context
27
+ */
28
+ active(): Context;
29
+ /**
30
+ * Run the fn callback with object set as the current active context
31
+ * @param context Any object to set as the current active context
32
+ * @param fn A callback to be immediately run within a specific context
33
+ * @param thisArg optional receiver to be used for calling fn
34
+ * @param args optional arguments forwarded to fn
35
+ */
36
+ with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
37
+ /**
38
+ * Bind an object as the current context (or a specific one)
39
+ * @param [context] Optionally specify the context which you want to assign
40
+ * @param target Any object to which a context need to be set
41
+ */
42
+ bind<T>(context: Context, target: T): T;
43
+ /**
44
+ * Enable context management
45
+ */
46
+ enable(): this;
47
+ /**
48
+ * Disable context management
49
+ */
50
+ disable(): this;
51
+ }
52
+ //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright The OpenTelemetry Authors
4
3
  *
@@ -14,5 +13,5 @@
14
13
  * See the License for the specific language governing permissions and
15
14
  * limitations under the License.
16
15
  */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=TimedEvent.js.map
16
+ export {};
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,20 @@
1
+ import { ComponentLoggerOptions, DiagLogger } from './types';
2
+ /**
3
+ * Component Logger which is meant to be used as part of any component which
4
+ * will add automatically additional namespace in front of the log message.
5
+ * It will then forward all message to global diag logger
6
+ * @example
7
+ * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
8
+ * cLogger.debug('test');
9
+ * // @opentelemetry/instrumentation-http test
10
+ */
11
+ export declare class DiagComponentLogger implements DiagLogger {
12
+ private _namespace;
13
+ constructor(props: ComponentLoggerOptions);
14
+ debug(...args: any[]): void;
15
+ error(...args: any[]): void;
16
+ info(...args: any[]): void;
17
+ warn(...args: any[]): void;
18
+ verbose(...args: any[]): void;
19
+ }
20
+ //# sourceMappingURL=ComponentLogger.d.ts.map
@@ -0,0 +1,77 @@
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 } from '../internal/global-utils';
17
+ /**
18
+ * Component Logger which is meant to be used as part of any component which
19
+ * will add automatically additional namespace in front of the log message.
20
+ * It will then forward all message to global diag logger
21
+ * @example
22
+ * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
23
+ * cLogger.debug('test');
24
+ * // @opentelemetry/instrumentation-http test
25
+ */
26
+ var DiagComponentLogger = /** @class */ (function () {
27
+ function DiagComponentLogger(props) {
28
+ this._namespace = props.namespace || 'DiagComponentLogger';
29
+ }
30
+ DiagComponentLogger.prototype.debug = function () {
31
+ var args = [];
32
+ for (var _i = 0; _i < arguments.length; _i++) {
33
+ args[_i] = arguments[_i];
34
+ }
35
+ return logProxy('debug', this._namespace, args);
36
+ };
37
+ DiagComponentLogger.prototype.error = function () {
38
+ var args = [];
39
+ for (var _i = 0; _i < arguments.length; _i++) {
40
+ args[_i] = arguments[_i];
41
+ }
42
+ return logProxy('error', this._namespace, args);
43
+ };
44
+ DiagComponentLogger.prototype.info = function () {
45
+ var args = [];
46
+ for (var _i = 0; _i < arguments.length; _i++) {
47
+ args[_i] = arguments[_i];
48
+ }
49
+ return logProxy('info', this._namespace, args);
50
+ };
51
+ DiagComponentLogger.prototype.warn = function () {
52
+ var args = [];
53
+ for (var _i = 0; _i < arguments.length; _i++) {
54
+ args[_i] = arguments[_i];
55
+ }
56
+ return logProxy('warn', this._namespace, args);
57
+ };
58
+ DiagComponentLogger.prototype.verbose = function () {
59
+ var args = [];
60
+ for (var _i = 0; _i < arguments.length; _i++) {
61
+ args[_i] = arguments[_i];
62
+ }
63
+ return logProxy('verbose', this._namespace, args);
64
+ };
65
+ return DiagComponentLogger;
66
+ }());
67
+ export { DiagComponentLogger };
68
+ function logProxy(funcName, namespace, args) {
69
+ var logger = getGlobal('diag');
70
+ // shortcut if logger not set
71
+ if (!logger) {
72
+ return;
73
+ }
74
+ args.unshift(namespace);
75
+ return logger[funcName].apply(logger, args);
76
+ }
77
+ //# sourceMappingURL=ComponentLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentLogger.js","sourceRoot":"","sources":["../../../src/diag/ComponentLogger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD;;;;;;;;GAQG;AACH;IAGE,6BAAY,KAA6B;QACvC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,IAAI,qBAAqB,CAAC;IAC7D,CAAC;IAEM,mCAAK,GAAZ;QAAa,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACzB,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,mCAAK,GAAZ;QAAa,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACzB,OAAO,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAEM,kCAAI,GAAX;QAAY,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACxB,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,kCAAI,GAAX;QAAY,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACxB,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,qCAAO,GAAd;QAAe,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QAC3B,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IACH,0BAAC;AAAD,CAAC,AA1BD,IA0BC;;AAED,SAAS,QAAQ,CACf,QAA0B,EAC1B,SAAiB,EACjB,IAAS;IAET,IAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,6BAA6B;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO;KACR;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { DiagLogger, DiagLogFunction } from './types';
2
+ /**
3
+ * A simple Immutable Console based diagnostic logger which will output any messages to the Console.
4
+ * If you want to limit the amount of logging to a specific level or lower use the
5
+ * {@link createLogLevelDiagLogger}
6
+ */
7
+ export declare class DiagConsoleLogger implements DiagLogger {
8
+ constructor();
9
+ /** Log an error scenario that was not expected and caused the requested operation to fail. */
10
+ error: DiagLogFunction;
11
+ /**
12
+ * Log a warning scenario to inform the developer of an issues that should be investigated.
13
+ * The requested operation may or may not have succeeded or completed.
14
+ */
15
+ warn: DiagLogFunction;
16
+ /**
17
+ * Log a general informational message, this should not affect functionality.
18
+ * This is also the default logging level so this should NOT be used for logging
19
+ * debugging level information.
20
+ */
21
+ info: DiagLogFunction;
22
+ /**
23
+ * Log a general debug message that can be useful for identifying a failure.
24
+ * Information logged at this level may include diagnostic details that would
25
+ * help identify a failure scenario. Useful scenarios would be to log the execution
26
+ * order of async operations
27
+ */
28
+ debug: DiagLogFunction;
29
+ /**
30
+ * Log a detailed (verbose) trace level logging that can be used to identify failures
31
+ * where debug level logging would be insufficient, this level of tracing can include
32
+ * input and output parameters and as such may include PII information passing through
33
+ * the API. As such it is recommended that this level of tracing should not be enabled
34
+ * in a production environment.
35
+ */
36
+ verbose: DiagLogFunction;
37
+ }
38
+ //# sourceMappingURL=consoleLogger.d.ts.map
@@ -0,0 +1,54 @@
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 consoleMap = [
17
+ { n: 'error', c: 'error' },
18
+ { n: 'warn', c: 'warn' },
19
+ { n: 'info', c: 'info' },
20
+ { n: 'debug', c: 'debug' },
21
+ { n: 'verbose', c: 'trace' },
22
+ ];
23
+ /**
24
+ * A simple Immutable Console based diagnostic logger which will output any messages to the Console.
25
+ * If you want to limit the amount of logging to a specific level or lower use the
26
+ * {@link createLogLevelDiagLogger}
27
+ */
28
+ var DiagConsoleLogger = /** @class */ (function () {
29
+ function DiagConsoleLogger() {
30
+ function _consoleFunc(funcName) {
31
+ return function () {
32
+ var orgArguments = arguments;
33
+ if (console) {
34
+ // Some environments only expose the console when the F12 developer console is open
35
+ var theFunc = console[funcName];
36
+ if (typeof theFunc !== 'function') {
37
+ // Not all environments support all functions
38
+ theFunc = console.log;
39
+ }
40
+ // One last final check
41
+ if (typeof theFunc === 'function') {
42
+ return theFunc.apply(console, orgArguments);
43
+ }
44
+ }
45
+ };
46
+ }
47
+ for (var i = 0; i < consoleMap.length; i++) {
48
+ this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
49
+ }
50
+ }
51
+ return DiagConsoleLogger;
52
+ }());
53
+ export { DiagConsoleLogger };
54
+ //# sourceMappingURL=consoleLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consoleLogger.js","sourceRoot":"","sources":["../../../src/diag/consoleLogger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,IAAM,UAAU,GAAgD;IAC9D,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE;CAC7B,CAAC;AAEF;;;;GAIG;AACH;IACE;QACE,SAAS,YAAY,CAAC,QAAuB;YAC3C,OAAO;gBACL,IAAM,YAAY,GAAG,SAAS,CAAC;gBAC/B,IAAI,OAAO,EAAE;oBACX,mFAAmF;oBACnF,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAChC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,6CAA6C;wBAC7C,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;qBACvB;oBAED,uBAAuB;oBACvB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;qBAC7C;iBACF;YACH,CAAC,CAAC;QACJ,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;IACH,CAAC;IAkCH,wBAAC;AAAD,CAAC,AA1DD,IA0DC"}
@@ -0,0 +1,3 @@
1
+ export * from './consoleLogger';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
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 './consoleLogger';
17
+ export * from './types';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/diag/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DiagLogger, DiagLogLevel } from '../types';
2
+ export declare function createLogLevelDiagLogger(maxLevel: DiagLogLevel, logger: DiagLogger): DiagLogger;
3
+ //# sourceMappingURL=logLevelLogger.d.ts.map
@@ -0,0 +1,41 @@
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 { DiagLogLevel } from '../types';
17
+ export function createLogLevelDiagLogger(maxLevel, logger) {
18
+ if (maxLevel < DiagLogLevel.NONE) {
19
+ maxLevel = DiagLogLevel.NONE;
20
+ }
21
+ else if (maxLevel > DiagLogLevel.ALL) {
22
+ maxLevel = DiagLogLevel.ALL;
23
+ }
24
+ // In case the logger is null or undefined
25
+ logger = logger || {};
26
+ function _filterFunc(funcName, theLevel) {
27
+ var theFunc = logger[funcName];
28
+ if (typeof theFunc === 'function' && maxLevel >= theLevel) {
29
+ return theFunc.bind(logger);
30
+ }
31
+ return function () { };
32
+ }
33
+ return {
34
+ error: _filterFunc('error', DiagLogLevel.ERROR),
35
+ warn: _filterFunc('warn', DiagLogLevel.WARN),
36
+ info: _filterFunc('info', DiagLogLevel.INFO),
37
+ debug: _filterFunc('debug', DiagLogLevel.DEBUG),
38
+ verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),
39
+ };
40
+ }
41
+ //# sourceMappingURL=logLevelLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logLevelLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/logLevelLogger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA+B,YAAY,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,UAAU,wBAAwB,CACtC,QAAsB,EACtB,MAAkB;IAElB,IAAI,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE;QAChC,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC;KAC9B;SAAM,IAAI,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE;QACtC,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC;KAC7B;IAED,0CAA0C;IAC1C,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAEtB,SAAS,WAAW,CAClB,QAA0B,EAC1B,QAAsB;QAEtB,IAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEjC,IAAI,OAAO,OAAO,KAAK,UAAU,IAAI,QAAQ,IAAI,QAAQ,EAAE;YACzD,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QACD,OAAO,cAAa,CAAC,CAAC;IACxB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC;QAC5C,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { DiagLogger } from '../types';
2
+ /**
3
+ * Returns a No-Op Diagnostic logger where all messages do nothing.
4
+ * @implements {@link DiagLogger}
5
+ * @returns {DiagLogger}
6
+ */
7
+ export declare function createNoopDiagLogger(): DiagLogger;
8
+ //# sourceMappingURL=noopLogger.d.ts.map
@@ -0,0 +1,31 @@
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
+ function noopLogFunction() { }
17
+ /**
18
+ * Returns a No-Op Diagnostic logger where all messages do nothing.
19
+ * @implements {@link DiagLogger}
20
+ * @returns {DiagLogger}
21
+ */
22
+ export function createNoopDiagLogger() {
23
+ return {
24
+ verbose: noopLogFunction,
25
+ debug: noopLogFunction,
26
+ info: noopLogFunction,
27
+ warn: noopLogFunction,
28
+ error: noopLogFunction,
29
+ };
30
+ }
31
+ //# sourceMappingURL=noopLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noopLogger.js","sourceRoot":"","sources":["../../../../src/diag/internal/noopLogger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,SAAS,eAAe,KAAI,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,eAAe;KACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,70 @@
1
+ export declare type DiagLogFunction = (message: string, ...args: unknown[]) => void;
2
+ /**
3
+ * Defines an internal diagnostic logger interface which is used to log internal diagnostic
4
+ * messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.
5
+ * API provided implementations include :-
6
+ * - a No-Op {@link createNoopDiagLogger}
7
+ * - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}
8
+ * - a general Console {@link DiagConsoleLogger} version.
9
+ */
10
+ export interface DiagLogger {
11
+ /** Log an error scenario that was not expected and caused the requested operation to fail. */
12
+ error: DiagLogFunction;
13
+ /**
14
+ * Log a warning scenario to inform the developer of an issues that should be investigated.
15
+ * The requested operation may or may not have succeeded or completed.
16
+ */
17
+ warn: DiagLogFunction;
18
+ /**
19
+ * Log a general informational message, this should not affect functionality.
20
+ * This is also the default logging level so this should NOT be used for logging
21
+ * debugging level information.
22
+ */
23
+ info: DiagLogFunction;
24
+ /**
25
+ * Log a general debug message that can be useful for identifying a failure.
26
+ * Information logged at this level may include diagnostic details that would
27
+ * help identify a failure scenario.
28
+ * For example: Logging the order of execution of async operations.
29
+ */
30
+ debug: DiagLogFunction;
31
+ /**
32
+ * Log a detailed (verbose) trace level logging that can be used to identify failures
33
+ * where debug level logging would be insufficient, this level of tracing can include
34
+ * input and output parameters and as such may include PII information passing through
35
+ * the API. As such it is recommended that this level of tracing should not be enabled
36
+ * in a production environment.
37
+ */
38
+ verbose: DiagLogFunction;
39
+ }
40
+ /**
41
+ * Defines the available internal logging levels for the diagnostic logger, the numeric values
42
+ * of the levels are defined to match the original values from the initial LogLevel to avoid
43
+ * compatibility/migration issues for any implementation that assume the numeric ordering.
44
+ */
45
+ export declare enum DiagLogLevel {
46
+ /** Diagnostic Logging level setting to disable all logging (except and forced logs) */
47
+ NONE = 0,
48
+ /** Identifies an error scenario */
49
+ ERROR = 30,
50
+ /** Identifies a warning scenario */
51
+ WARN = 50,
52
+ /** General informational log message */
53
+ INFO = 60,
54
+ /** General debug log message */
55
+ DEBUG = 70,
56
+ /**
57
+ * Detailed trace level logging should only be used for development, should only be set
58
+ * in a development environment.
59
+ */
60
+ VERBOSE = 80,
61
+ /** Used to set the logging level to include all logging */
62
+ ALL = 9999
63
+ }
64
+ /**
65
+ * Defines options for ComponentLogger
66
+ */
67
+ export interface ComponentLoggerOptions {
68
+ namespace: string;
69
+ }
70
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,41 @@
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
+ * Defines the available internal logging levels for the diagnostic logger, the numeric values
18
+ * of the levels are defined to match the original values from the initial LogLevel to avoid
19
+ * compatibility/migration issues for any implementation that assume the numeric ordering.
20
+ */
21
+ export var DiagLogLevel;
22
+ (function (DiagLogLevel) {
23
+ /** Diagnostic Logging level setting to disable all logging (except and forced logs) */
24
+ DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
25
+ /** Identifies an error scenario */
26
+ DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
27
+ /** Identifies a warning scenario */
28
+ DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";
29
+ /** General informational log message */
30
+ DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO";
31
+ /** General debug log message */
32
+ DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG";
33
+ /**
34
+ * Detailed trace level logging should only be used for development, should only be set
35
+ * in a development environment.
36
+ */
37
+ DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE";
38
+ /** Used to set the logging level to include all logging */
39
+ DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL";
40
+ })(DiagLogLevel || (DiagLogLevel = {}));
41
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/diag/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA+CH;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAwBX;AAxBD,WAAY,YAAY;IACtB,uFAAuF;IACvF,+CAAQ,CAAA;IAER,mCAAmC;IACnC,kDAAU,CAAA;IAEV,oCAAoC;IACpC,gDAAS,CAAA;IAET,wCAAwC;IACxC,gDAAS,CAAA;IAET,gCAAgC;IAChC,kDAAU,CAAA;IAEV;;;OAGG;IACH,sDAAY,CAAA;IAEZ,2DAA2D;IAC3D,gDAAU,CAAA;AACZ,CAAC,EAxBW,YAAY,KAAZ,YAAY,QAwBvB"}
@@ -0,0 +1,54 @@
1
+ export * from './baggage/types';
2
+ export { baggageEntryMetadataFromString } from './baggage/utils';
3
+ export * from './common/Exception';
4
+ export * from './common/Time';
5
+ export * from './diag';
6
+ export * from './propagation/TextMapPropagator';
7
+ export * from './trace/attributes';
8
+ export * from './trace/link';
9
+ export * from './trace/ProxyTracer';
10
+ export * from './trace/ProxyTracerProvider';
11
+ export * from './trace/Sampler';
12
+ export * from './trace/SamplingResult';
13
+ export * from './trace/span_context';
14
+ export * from './trace/span_kind';
15
+ export * from './trace/span';
16
+ export * from './trace/SpanOptions';
17
+ export * from './trace/status';
18
+ export * from './trace/trace_flags';
19
+ export * from './trace/trace_state';
20
+ export * from './trace/tracer_provider';
21
+ export * from './trace/tracer';
22
+ export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
23
+ export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';
24
+ export * from './context/context';
25
+ export * from './context/types';
26
+ import { ContextAPI } from './api/context';
27
+ export type { ContextAPI } from './api/context';
28
+ /** Entrypoint for context API */
29
+ export declare const context: ContextAPI;
30
+ import { TraceAPI } from './api/trace';
31
+ export type { TraceAPI } from './api/trace';
32
+ /** Entrypoint for trace API */
33
+ export declare const trace: TraceAPI;
34
+ import { PropagationAPI } from './api/propagation';
35
+ export type { PropagationAPI } from './api/propagation';
36
+ /** Entrypoint for propagation API */
37
+ export declare const propagation: PropagationAPI;
38
+ import { DiagAPI } from './api/diag';
39
+ export type { DiagAPI } from './api/diag';
40
+ /**
41
+ * Entrypoint for Diag API.
42
+ * Defines Diagnostic handler used for internal diagnostic logging operations.
43
+ * The default provides a Noop DiagLogger implementation which may be changed via the
44
+ * diag.setLogger(logger: DiagLogger) function.
45
+ */
46
+ export declare const diag: DiagAPI;
47
+ declare const _default: {
48
+ trace: TraceAPI;
49
+ context: ContextAPI;
50
+ propagation: PropagationAPI;
51
+ diag: DiagAPI;
52
+ };
53
+ export default _default;
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,64 @@
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 './baggage/types';
17
+ export { baggageEntryMetadataFromString } from './baggage/utils';
18
+ export * from './common/Exception';
19
+ export * from './common/Time';
20
+ export * from './diag';
21
+ export * from './propagation/TextMapPropagator';
22
+ export * from './trace/attributes';
23
+ export * from './trace/link';
24
+ export * from './trace/ProxyTracer';
25
+ export * from './trace/ProxyTracerProvider';
26
+ export * from './trace/Sampler';
27
+ export * from './trace/SamplingResult';
28
+ export * from './trace/span_context';
29
+ export * from './trace/span_kind';
30
+ export * from './trace/span';
31
+ export * from './trace/SpanOptions';
32
+ export * from './trace/status';
33
+ export * from './trace/trace_flags';
34
+ export * from './trace/trace_state';
35
+ export * from './trace/tracer_provider';
36
+ export * from './trace/tracer';
37
+ export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
38
+ export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';
39
+ export * from './context/context';
40
+ export * from './context/types';
41
+ import { ContextAPI } from './api/context';
42
+ /** Entrypoint for context API */
43
+ export var context = ContextAPI.getInstance();
44
+ import { TraceAPI } from './api/trace';
45
+ /** Entrypoint for trace API */
46
+ export var trace = TraceAPI.getInstance();
47
+ import { PropagationAPI } from './api/propagation';
48
+ /** Entrypoint for propagation API */
49
+ export var propagation = PropagationAPI.getInstance();
50
+ import { DiagAPI } from './api/diag';
51
+ /**
52
+ * Entrypoint for Diag API.
53
+ * Defines Diagnostic handler used for internal diagnostic logging operations.
54
+ * The default provides a Noop DiagLogger implementation which may be changed via the
55
+ * diag.setLogger(logger: DiagLogger) function.
56
+ */
57
+ export var diag = DiagAPI.instance();
58
+ export default {
59
+ trace: trace,
60
+ context: context,
61
+ propagation: propagation,
62
+ diag: diag,
63
+ };
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,iCAAiC;AACjC,MAAM,CAAC,IAAM,OAAO,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,+BAA+B;AAC/B,MAAM,CAAC,IAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qCAAqC;AACrC,MAAM,CAAC,IAAM,WAAW,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;;;;;GAKG;AACH,MAAM,CAAC,IAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEvC,eAAe;IACb,KAAK,OAAA;IACL,OAAO,SAAA;IACP,WAAW,aAAA;IACX,IAAI,MAAA;CACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { ContextManager } from '../context/types';
2
+ import { DiagLogger } from '../diag';
3
+ import { TextMapPropagator } from '../propagation/TextMapPropagator';
4
+ import type { TracerProvider } from '../trace/tracer_provider';
5
+ export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagLogger, allowOverride?: boolean): boolean;
6
+ export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
7
+ export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger): void;
8
+ declare type OTelGlobalAPI = {
9
+ version: string;
10
+ diag?: DiagLogger;
11
+ trace?: TracerProvider;
12
+ context?: ContextManager;
13
+ propagation?: TextMapPropagator;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=global-utils.d.ts.map