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