@opentelemetry/api 1.0.0-rc.2 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/CHANGELOG.md +123 -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/esm/baggage/internal/baggage-impl.d.ts +12 -0
  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/esm/baggage/types.d.ts +60 -0
  25. package/build/esm/baggage/types.js +17 -0
  26. package/build/esm/baggage/types.js.map +1 -0
  27. package/build/esm/baggage/utils.d.ts +15 -0
  28. package/build/esm/baggage/utils.js +46 -0
  29. package/build/esm/baggage/utils.js.map +1 -0
  30. package/build/esm/common/Exception.d.ts +26 -0
  31. package/build/esm/common/Exception.js +17 -0
  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/esm/context/types.js +17 -0
  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 +53 -0
  64. package/build/esm/index.js +63 -0
  65. package/build/esm/index.js.map +1 -0
  66. package/build/esm/internal/global-utils.d.ts +17 -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/esm/trace/NonRecordingSpan.d.ts +25 -0
  94. package/build/esm/trace/NonRecordingSpan.js +62 -0
  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 +74 -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 +23 -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/link.d.ts +24 -0
  124. package/build/esm/trace/link.js +17 -0
  125. package/build/esm/trace/link.js.map +1 -0
  126. package/build/esm/trace/span.d.ts +101 -0
  127. package/build/esm/trace/span.js +17 -0
  128. package/build/esm/trace/span.js.map +1 -0
  129. package/build/esm/trace/span_context.d.ts +53 -0
  130. package/build/esm/trace/span_context.js +17 -0
  131. package/build/esm/trace/span_context.js.map +1 -0
  132. package/build/esm/trace/span_kind.d.ts +27 -0
  133. package/build/esm/trace/span_kind.js +43 -0
  134. package/build/esm/trace/span_kind.js.map +1 -0
  135. package/build/esm/trace/spancontext-utils.d.ts +20 -0
  136. package/build/esm/trace/spancontext-utils.js +49 -0
  137. package/build/esm/trace/spancontext-utils.js.map +1 -0
  138. package/build/esm/trace/status.d.ts +25 -0
  139. package/build/esm/trace/status.js +20 -0
  140. package/build/esm/trace/status.js.map +1 -0
  141. package/build/esm/trace/trace_flags.d.ts +7 -0
  142. package/build/esm/trace/trace_flags.js +23 -0
  143. package/build/esm/trace/trace_flags.js.map +1 -0
  144. package/build/esm/trace/trace_state.d.ts +38 -0
  145. package/build/esm/trace/trace_state.js +17 -0
  146. package/build/esm/trace/trace_state.js.map +1 -0
  147. package/build/esm/trace/tracer.d.ts +71 -0
  148. package/build/esm/trace/tracer.js +17 -0
  149. package/build/esm/trace/tracer.js.map +1 -0
  150. package/build/esm/trace/tracer_provider.d.ts +19 -0
  151. package/build/esm/trace/tracer_provider.js +17 -0
  152. package/build/esm/trace/tracer_provider.js.map +1 -0
  153. package/build/esm/version.d.ts +2 -0
  154. package/build/esm/version.js +18 -0
  155. package/build/esm/version.js.map +1 -0
  156. package/build/src/api/context.d.ts +41 -0
  157. package/build/src/api/context.js +93 -0
  158. package/build/src/api/context.js.map +1 -0
  159. package/build/src/api/diag.d.ts +38 -0
  160. package/build/src/api/diag.js +92 -0
  161. package/build/src/api/diag.js.map +1 -0
  162. package/build/src/api/propagation.d.ts +48 -0
  163. package/build/src/api/propagation.js +91 -0
  164. package/build/src/api/propagation.js.map +1 -0
  165. package/build/src/api/trace.d.ts +39 -0
  166. package/build/src/api/trace.js +79 -0
  167. package/build/src/api/trace.js.map +1 -0
  168. package/build/src/baggage/context-helpers.d.ts +23 -0
  169. package/build/src/baggage/context-helpers.js +53 -0
  170. package/build/src/baggage/context-helpers.js.map +1 -0
  171. package/build/src/baggage/internal/baggage-impl.d.ts +12 -0
  172. package/build/src/baggage/internal/baggage-impl.js +64 -0
  173. package/build/src/baggage/internal/baggage-impl.js.map +1 -0
  174. package/build/src/baggage/internal/symbol.d.ts +5 -0
  175. package/build/src/baggage/internal/symbol.js +23 -0
  176. package/build/src/baggage/internal/symbol.js.map +1 -0
  177. package/build/src/baggage/types.d.ts +60 -0
  178. package/build/src/baggage/types.js +18 -0
  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/utils.js +51 -0
  182. package/build/src/baggage/utils.js.map +1 -0
  183. package/build/src/common/Exception.d.ts +26 -0
  184. package/build/src/common/Exception.js +18 -0
  185. package/build/src/common/Exception.js.map +1 -0
  186. package/build/src/common/Time.d.ts +8 -0
  187. package/build/src/common/Time.js +3 -0
  188. package/build/src/common/Time.js.map +1 -0
  189. package/build/src/context/NoopContextManager.d.ts +9 -0
  190. package/build/src/context/NoopContextManager.js +50 -0
  191. package/build/src/context/NoopContextManager.js.map +1 -0
  192. package/build/src/context/context.d.ts +6 -0
  193. package/build/src/context/context.js +56 -0
  194. package/build/src/context/context.js.map +1 -0
  195. package/build/src/context/types.d.ts +52 -0
  196. package/build/src/context/types.js +18 -0
  197. package/build/src/context/types.js.map +1 -0
  198. package/build/src/diag/ComponentLogger.d.ts +20 -0
  199. package/build/src/diag/ComponentLogger.js +80 -0
  200. package/build/src/diag/ComponentLogger.js.map +1 -0
  201. package/build/src/diag/consoleLogger.d.ts +38 -0
  202. package/build/src/diag/consoleLogger.js +57 -0
  203. package/build/src/diag/consoleLogger.js.map +1 -0
  204. package/build/src/diag/index.d.ts +3 -0
  205. package/build/src/diag/index.js +30 -0
  206. package/build/src/diag/index.js.map +1 -0
  207. package/build/src/diag/internal/logLevelLogger.d.ts +3 -0
  208. package/build/src/diag/internal/logLevelLogger.js +45 -0
  209. package/build/src/diag/internal/logLevelLogger.js.map +1 -0
  210. package/build/src/diag/internal/noopLogger.d.ts +8 -0
  211. package/build/src/diag/internal/noopLogger.js +35 -0
  212. package/build/src/diag/internal/noopLogger.js.map +1 -0
  213. package/build/src/diag/types.d.ts +70 -0
  214. package/build/src/diag/types.js +44 -0
  215. package/build/src/diag/types.js.map +1 -0
  216. package/build/src/index.d.ts +53 -0
  217. package/build/src/index.js +83 -0
  218. package/build/src/index.js.map +1 -0
  219. package/build/src/internal/global-utils.d.ts +17 -0
  220. package/build/src/internal/global-utils.js +65 -0
  221. package/build/src/internal/global-utils.js.map +1 -0
  222. package/build/src/internal/semver.d.ts +34 -0
  223. package/build/src/internal/semver.js +122 -0
  224. package/build/src/internal/semver.js.map +1 -0
  225. package/build/src/platform/browser/globalThis.d.ts +3 -0
  226. package/build/src/platform/browser/globalThis.js +22 -0
  227. package/build/src/platform/browser/globalThis.js.map +1 -0
  228. package/build/src/platform/browser/index.d.ts +2 -0
  229. package/build/src/platform/browser/index.js +29 -0
  230. package/build/src/platform/browser/index.js.map +1 -0
  231. package/build/src/platform/index.d.ts +2 -0
  232. package/build/src/platform/index.js +29 -0
  233. package/build/src/platform/index.js.map +1 -0
  234. package/build/src/platform/node/globalThis.d.ts +3 -0
  235. package/build/src/platform/node/globalThis.js +22 -0
  236. package/build/src/platform/node/globalThis.js.map +1 -0
  237. package/build/src/platform/node/index.d.ts +2 -0
  238. package/build/src/platform/node/index.js +29 -0
  239. package/build/src/platform/node/index.js.map +1 -0
  240. package/build/src/propagation/NoopTextMapPropagator.d.ts +13 -0
  241. package/build/src/propagation/NoopTextMapPropagator.js +37 -0
  242. package/build/src/propagation/NoopTextMapPropagator.js.map +1 -0
  243. package/build/src/propagation/TextMapPropagator.d.ts +84 -0
  244. package/build/src/propagation/TextMapPropagator.js +41 -0
  245. package/build/src/propagation/TextMapPropagator.js.map +1 -0
  246. package/build/src/trace/NonRecordingSpan.d.ts +25 -0
  247. package/build/src/trace/NonRecordingSpan.js +65 -0
  248. package/build/src/trace/NonRecordingSpan.js.map +1 -0
  249. package/build/src/trace/NoopTracer.d.ts +14 -0
  250. package/build/src/trace/NoopTracer.js +77 -0
  251. package/build/src/trace/NoopTracer.js.map +1 -0
  252. package/build/src/trace/NoopTracerProvider.d.ts +12 -0
  253. package/build/src/trace/NoopTracerProvider.js +35 -0
  254. package/build/src/trace/NoopTracerProvider.js.map +1 -0
  255. package/build/src/trace/ProxyTracer.d.ts +23 -0
  256. package/build/src/trace/ProxyTracer.js +55 -0
  257. package/build/src/trace/ProxyTracer.js.map +1 -0
  258. package/build/src/trace/ProxyTracerProvider.d.ts +24 -0
  259. package/build/src/trace/ProxyTracerProvider.js +57 -0
  260. package/build/src/trace/ProxyTracerProvider.js.map +1 -0
  261. package/build/src/trace/Sampler.d.ts +30 -0
  262. package/build/src/trace/Sampler.js +18 -0
  263. package/build/src/trace/Sampler.js.map +1 -0
  264. package/build/src/trace/SamplingResult.d.ts +39 -0
  265. package/build/src/trace/SamplingResult.js +41 -0
  266. package/build/src/trace/SamplingResult.js.map +1 -0
  267. package/build/src/trace/SpanOptions.d.ts +23 -0
  268. package/build/src/trace/SpanOptions.js +18 -0
  269. package/build/src/trace/SpanOptions.js.map +1 -0
  270. package/build/src/trace/attributes.d.ts +10 -0
  271. package/build/src/trace/attributes.js +18 -0
  272. package/build/src/trace/attributes.js.map +1 -0
  273. package/build/src/trace/context-utils.d.ts +37 -0
  274. package/build/src/trace/context-utils.js +74 -0
  275. package/build/src/trace/context-utils.js.map +1 -0
  276. package/build/src/trace/link.d.ts +24 -0
  277. package/build/src/trace/link.js +18 -0
  278. package/build/src/trace/link.js.map +1 -0
  279. package/build/src/trace/span.d.ts +101 -0
  280. package/build/src/trace/span.js +18 -0
  281. package/build/src/trace/span.js.map +1 -0
  282. package/build/src/trace/span_context.d.ts +53 -0
  283. package/build/src/trace/span_context.js +18 -0
  284. package/build/src/trace/span_context.js.map +1 -0
  285. package/build/src/trace/span_kind.d.ts +27 -0
  286. package/build/src/trace/span_kind.js +46 -0
  287. package/build/src/trace/span_kind.js.map +1 -0
  288. package/build/src/trace/spancontext-utils.d.ts +20 -0
  289. package/build/src/trace/spancontext-utils.js +56 -0
  290. package/build/src/trace/spancontext-utils.js.map +1 -0
  291. package/build/src/trace/status.d.ts +25 -0
  292. package/build/src/trace/status.js +23 -0
  293. package/build/src/trace/status.js.map +1 -0
  294. package/build/src/trace/trace_flags.d.ts +7 -0
  295. package/build/src/trace/trace_flags.js +26 -0
  296. package/build/src/trace/trace_flags.js.map +1 -0
  297. package/build/src/trace/trace_state.d.ts +38 -0
  298. package/build/src/trace/trace_state.js +18 -0
  299. package/build/src/trace/trace_state.js.map +1 -0
  300. package/build/src/trace/tracer.d.ts +71 -0
  301. package/build/src/trace/tracer.js +18 -0
  302. package/build/src/trace/tracer.js.map +1 -0
  303. package/build/src/trace/tracer_provider.d.ts +19 -0
  304. package/build/src/trace/tracer_provider.js +18 -0
  305. package/build/src/trace/tracer_provider.js.map +1 -0
  306. package/build/src/version.d.ts +2 -0
  307. package/build/src/version.js +21 -0
  308. package/build/src/version.js.map +1 -0
  309. package/package.json +23 -18
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DiagComponentLogger = void 0;
19
+ var global_utils_1 = require("../internal/global-utils");
20
+ /**
21
+ * Component Logger which is meant to be used as part of any component which
22
+ * will add automatically additional namespace in front of the log message.
23
+ * It will then forward all message to global diag logger
24
+ * @example
25
+ * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
26
+ * cLogger.debug('test');
27
+ * // @opentelemetry/instrumentation-http test
28
+ */
29
+ var DiagComponentLogger = /** @class */ (function () {
30
+ function DiagComponentLogger(props) {
31
+ this._namespace = props.namespace || 'DiagComponentLogger';
32
+ }
33
+ DiagComponentLogger.prototype.debug = function () {
34
+ var args = [];
35
+ for (var _i = 0; _i < arguments.length; _i++) {
36
+ args[_i] = arguments[_i];
37
+ }
38
+ return logProxy('debug', this._namespace, args);
39
+ };
40
+ DiagComponentLogger.prototype.error = function () {
41
+ var args = [];
42
+ for (var _i = 0; _i < arguments.length; _i++) {
43
+ args[_i] = arguments[_i];
44
+ }
45
+ return logProxy('error', this._namespace, args);
46
+ };
47
+ DiagComponentLogger.prototype.info = function () {
48
+ var args = [];
49
+ for (var _i = 0; _i < arguments.length; _i++) {
50
+ args[_i] = arguments[_i];
51
+ }
52
+ return logProxy('info', this._namespace, args);
53
+ };
54
+ DiagComponentLogger.prototype.warn = function () {
55
+ var args = [];
56
+ for (var _i = 0; _i < arguments.length; _i++) {
57
+ args[_i] = arguments[_i];
58
+ }
59
+ return logProxy('warn', this._namespace, args);
60
+ };
61
+ DiagComponentLogger.prototype.verbose = function () {
62
+ var args = [];
63
+ for (var _i = 0; _i < arguments.length; _i++) {
64
+ args[_i] = arguments[_i];
65
+ }
66
+ return logProxy('verbose', this._namespace, args);
67
+ };
68
+ return DiagComponentLogger;
69
+ }());
70
+ exports.DiagComponentLogger = DiagComponentLogger;
71
+ function logProxy(funcName, namespace, args) {
72
+ var logger = global_utils_1.getGlobal('diag');
73
+ // shortcut if logger not set
74
+ if (!logger) {
75
+ return;
76
+ }
77
+ args.unshift(namespace);
78
+ return logger[funcName].apply(logger, args);
79
+ }
80
+ //# sourceMappingURL=ComponentLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentLogger.js","sourceRoot":"","sources":["../../../src/diag/ComponentLogger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yDAAqD;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;AA1BY,kDAAmB;AA4BhC,SAAS,QAAQ,CACf,QAA0B,EAC1B,SAAiB,EACjB,IAAS;IAET,IAAM,MAAM,GAAG,wBAAS,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,57 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DiagConsoleLogger = void 0;
19
+ var consoleMap = [
20
+ { n: 'error', c: 'error' },
21
+ { n: 'warn', c: 'warn' },
22
+ { n: 'info', c: 'info' },
23
+ { n: 'debug', c: 'debug' },
24
+ { n: 'verbose', c: 'trace' },
25
+ ];
26
+ /**
27
+ * A simple Immutable Console based diagnostic logger which will output any messages to the Console.
28
+ * If you want to limit the amount of logging to a specific level or lower use the
29
+ * {@link createLogLevelDiagLogger}
30
+ */
31
+ var DiagConsoleLogger = /** @class */ (function () {
32
+ function DiagConsoleLogger() {
33
+ function _consoleFunc(funcName) {
34
+ return function () {
35
+ var orgArguments = arguments;
36
+ if (console) {
37
+ // Some environments only expose the console when the F12 developer console is open
38
+ var theFunc = console[funcName];
39
+ if (typeof theFunc !== 'function') {
40
+ // Not all environments support all functions
41
+ theFunc = console.log;
42
+ }
43
+ // One last final check
44
+ if (typeof theFunc === 'function') {
45
+ return theFunc.apply(console, orgArguments);
46
+ }
47
+ }
48
+ };
49
+ }
50
+ for (var i = 0; i < consoleMap.length; i++) {
51
+ this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
52
+ }
53
+ }
54
+ return DiagConsoleLogger;
55
+ }());
56
+ exports.DiagConsoleLogger = DiagConsoleLogger;
57
+ //# 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;AA1DY,8CAAiB"}
@@ -0,0 +1,3 @@
1
+ export * from './consoleLogger';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ __exportStar(require("./consoleLogger"), exports);
29
+ __exportStar(require("./types"), exports);
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/diag/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAEH,kDAAgC;AAChC,0CAAwB"}
@@ -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,45 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createLogLevelDiagLogger = void 0;
19
+ var types_1 = require("../types");
20
+ function createLogLevelDiagLogger(maxLevel, logger) {
21
+ if (maxLevel < types_1.DiagLogLevel.NONE) {
22
+ maxLevel = types_1.DiagLogLevel.NONE;
23
+ }
24
+ else if (maxLevel > types_1.DiagLogLevel.ALL) {
25
+ maxLevel = types_1.DiagLogLevel.ALL;
26
+ }
27
+ // In case the logger is null or undefined
28
+ logger = logger || {};
29
+ function _filterFunc(funcName, theLevel) {
30
+ var theFunc = logger[funcName];
31
+ if (typeof theFunc === 'function' && maxLevel >= theLevel) {
32
+ return theFunc.bind(logger);
33
+ }
34
+ return function () { };
35
+ }
36
+ return {
37
+ error: _filterFunc('error', types_1.DiagLogLevel.ERROR),
38
+ warn: _filterFunc('warn', types_1.DiagLogLevel.WARN),
39
+ info: _filterFunc('info', types_1.DiagLogLevel.INFO),
40
+ debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG),
41
+ verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE),
42
+ };
43
+ }
44
+ exports.createLogLevelDiagLogger = createLogLevelDiagLogger;
45
+ //# 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,kCAAqE;AAErE,SAAgB,wBAAwB,CACtC,QAAsB,EACtB,MAAkB;IAElB,IAAI,QAAQ,GAAG,oBAAY,CAAC,IAAI,EAAE;QAChC,QAAQ,GAAG,oBAAY,CAAC,IAAI,CAAC;KAC9B;SAAM,IAAI,QAAQ,GAAG,oBAAY,CAAC,GAAG,EAAE;QACtC,QAAQ,GAAG,oBAAY,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,oBAAY,CAAC,KAAK,CAAC;QAC/C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,oBAAY,CAAC,IAAI,CAAC;QAC5C,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,oBAAY,CAAC,IAAI,CAAC;QAC5C,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,oBAAY,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,oBAAY,CAAC,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC;AAhCD,4DAgCC"}
@@ -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,35 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createNoopDiagLogger = void 0;
19
+ function noopLogFunction() { }
20
+ /**
21
+ * Returns a No-Op Diagnostic logger where all messages do nothing.
22
+ * @implements {@link DiagLogger}
23
+ * @returns {DiagLogger}
24
+ */
25
+ function createNoopDiagLogger() {
26
+ return {
27
+ verbose: noopLogFunction,
28
+ debug: noopLogFunction,
29
+ info: noopLogFunction,
30
+ warn: noopLogFunction,
31
+ error: noopLogFunction,
32
+ };
33
+ }
34
+ exports.createNoopDiagLogger = createNoopDiagLogger;
35
+ //# 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,SAAgB,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;AARD,oDAQC"}
@@ -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,44 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DiagLogLevel = void 0;
19
+ /**
20
+ * Defines the available internal logging levels for the diagnostic logger, the numeric values
21
+ * of the levels are defined to match the original values from the initial LogLevel to avoid
22
+ * compatibility/migration issues for any implementation that assume the numeric ordering.
23
+ */
24
+ var DiagLogLevel;
25
+ (function (DiagLogLevel) {
26
+ /** Diagnostic Logging level setting to disable all logging (except and forced logs) */
27
+ DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
28
+ /** Identifies an error scenario */
29
+ DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
30
+ /** Identifies a warning scenario */
31
+ DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";
32
+ /** General informational log message */
33
+ DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO";
34
+ /** General debug log message */
35
+ DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG";
36
+ /**
37
+ * Detailed trace level logging should only be used for development, should only be set
38
+ * in a development environment.
39
+ */
40
+ DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE";
41
+ /** Used to set the logging level to include all logging */
42
+ DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL";
43
+ })(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {}));
44
+ //# 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,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,GAAZ,oBAAY,KAAZ,oBAAY,QAwBvB"}
@@ -0,0 +1,53 @@
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 { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
23
+ export * from './context/context';
24
+ export * from './context/types';
25
+ import { ContextAPI } from './api/context';
26
+ export type { ContextAPI } from './api/context';
27
+ /** Entrypoint for context API */
28
+ export declare const context: ContextAPI;
29
+ import { TraceAPI } from './api/trace';
30
+ export type { TraceAPI } from './api/trace';
31
+ /** Entrypoint for trace API */
32
+ export declare const trace: TraceAPI;
33
+ import { PropagationAPI } from './api/propagation';
34
+ export type { PropagationAPI } from './api/propagation';
35
+ /** Entrypoint for propagation API */
36
+ export declare const propagation: PropagationAPI;
37
+ import { DiagAPI } from './api/diag';
38
+ export type { DiagAPI } from './api/diag';
39
+ /**
40
+ * Entrypoint for Diag API.
41
+ * Defines Diagnostic handler used for internal diagnostic logging operations.
42
+ * The default provides a Noop DiagLogger implementation which may be changed via the
43
+ * diag.setLogger(logger: DiagLogger) function.
44
+ */
45
+ export declare const diag: DiagAPI;
46
+ declare const _default: {
47
+ trace: TraceAPI;
48
+ context: ContextAPI;
49
+ propagation: PropagationAPI;
50
+ diag: DiagAPI;
51
+ };
52
+ export default _default;
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.baggageEntryMetadataFromString = void 0;
29
+ __exportStar(require("./baggage/types"), exports);
30
+ var utils_1 = require("./baggage/utils");
31
+ Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
32
+ __exportStar(require("./common/Exception"), exports);
33
+ __exportStar(require("./common/Time"), exports);
34
+ __exportStar(require("./diag"), exports);
35
+ __exportStar(require("./propagation/TextMapPropagator"), exports);
36
+ __exportStar(require("./trace/attributes"), exports);
37
+ __exportStar(require("./trace/link"), exports);
38
+ __exportStar(require("./trace/ProxyTracer"), exports);
39
+ __exportStar(require("./trace/ProxyTracerProvider"), exports);
40
+ __exportStar(require("./trace/Sampler"), exports);
41
+ __exportStar(require("./trace/SamplingResult"), exports);
42
+ __exportStar(require("./trace/span_context"), exports);
43
+ __exportStar(require("./trace/span_kind"), exports);
44
+ __exportStar(require("./trace/span"), exports);
45
+ __exportStar(require("./trace/SpanOptions"), exports);
46
+ __exportStar(require("./trace/status"), exports);
47
+ __exportStar(require("./trace/trace_flags"), exports);
48
+ __exportStar(require("./trace/trace_state"), exports);
49
+ __exportStar(require("./trace/tracer_provider"), exports);
50
+ __exportStar(require("./trace/tracer"), exports);
51
+ var spancontext_utils_1 = require("./trace/spancontext-utils");
52
+ Object.defineProperty(exports, "INVALID_SPANID", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } });
53
+ Object.defineProperty(exports, "INVALID_TRACEID", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } });
54
+ Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } });
55
+ Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
56
+ Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
57
+ Object.defineProperty(exports, "isValidSpanId", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } });
58
+ __exportStar(require("./context/context"), exports);
59
+ __exportStar(require("./context/types"), exports);
60
+ var context_1 = require("./api/context");
61
+ /** Entrypoint for context API */
62
+ exports.context = context_1.ContextAPI.getInstance();
63
+ var trace_1 = require("./api/trace");
64
+ /** Entrypoint for trace API */
65
+ exports.trace = trace_1.TraceAPI.getInstance();
66
+ var propagation_1 = require("./api/propagation");
67
+ /** Entrypoint for propagation API */
68
+ exports.propagation = propagation_1.PropagationAPI.getInstance();
69
+ var diag_1 = require("./api/diag");
70
+ /**
71
+ * Entrypoint for Diag API.
72
+ * Defines Diagnostic handler used for internal diagnostic logging operations.
73
+ * The default provides a Noop DiagLogger implementation which may be changed via the
74
+ * diag.setLogger(logger: DiagLogger) function.
75
+ */
76
+ exports.diag = diag_1.DiagAPI.instance();
77
+ exports.default = {
78
+ trace: exports.trace,
79
+ context: exports.context,
80
+ propagation: exports.propagation,
81
+ diag: exports.diag,
82
+ };
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,yCAAiE;AAAxD,uHAAA,8BAA8B,OAAA;AACvC,qDAAmC;AACnC,gDAA8B;AAC9B,yCAAuB;AACvB,kEAAgD;AAChD,qDAAmC;AACnC,+CAA6B;AAC7B,sDAAoC;AACpC,8DAA4C;AAC5C,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,sDAAoC;AACpC,iDAA+B;AAC/B,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,iDAA+B;AAE/B,+DAOmC;AANjC,mHAAA,cAAc,OAAA;AACd,oHAAA,eAAe,OAAA;AACf,yHAAA,oBAAoB,OAAA;AACpB,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAGf,oDAAkC;AAClC,kDAAgC;AAEhC,yCAA2C;AAE3C,iCAAiC;AACpB,QAAA,OAAO,GAAG,oBAAU,CAAC,WAAW,EAAE,CAAC;AAEhD,qCAAuC;AAEvC,+BAA+B;AAClB,QAAA,KAAK,GAAG,gBAAQ,CAAC,WAAW,EAAE,CAAC;AAE5C,iDAAmD;AAEnD,qCAAqC;AACxB,QAAA,WAAW,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC;AAExD,mCAAqC;AAGrC;;;;;GAKG;AACU,QAAA,IAAI,GAAG,cAAO,CAAC,QAAQ,EAAE,CAAC;AAEvC,kBAAe;IACb,KAAK,eAAA;IACL,OAAO,iBAAA;IACP,WAAW,qBAAA;IACX,IAAI,cAAA;CACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { DiagAPI } from '../api/diag';
2
+ import { ContextManager } from '../context/types';
3
+ import { DiagLogger } from '../diag';
4
+ import { TextMapPropagator } from '../propagation/TextMapPropagator';
5
+ import type { TracerProvider } from '../trace/tracer_provider';
6
+ export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagAPI, allowOverride?: boolean): boolean;
7
+ export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
8
+ export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagAPI): void;
9
+ declare type OTelGlobalAPI = {
10
+ version: string;
11
+ diag?: DiagLogger;
12
+ trace?: TracerProvider;
13
+ context?: ContextManager;
14
+ propagation?: TextMapPropagator;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=global-utils.d.ts.map