@opentelemetry/api 1.9.0 → 1.9.1

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 (625) hide show
  1. package/README.md +3 -2
  2. package/build/esm/api/context.d.ts +3 -1
  3. package/build/esm/api/context.js +23 -65
  4. package/build/esm/api/context.js.map +1 -1
  5. package/build/esm/api/diag.d.ts +3 -1
  6. package/build/esm/api/diag.js +28 -69
  7. package/build/esm/api/diag.js.map +1 -1
  8. package/build/esm/api/metrics.d.ts +2 -2
  9. package/build/esm/api/metrics.js +15 -29
  10. package/build/esm/api/metrics.js.map +1 -1
  11. package/build/esm/api/propagation.d.ts +4 -2
  12. package/build/esm/api/propagation.js +22 -35
  13. package/build/esm/api/propagation.js.map +1 -1
  14. package/build/esm/api/trace.d.ts +4 -2
  15. package/build/esm/api/trace.js +18 -29
  16. package/build/esm/api/trace.js.map +1 -1
  17. package/build/esm/baggage/context-helpers.d.ts +2 -2
  18. package/build/esm/baggage/context-helpers.js +2 -13
  19. package/build/esm/baggage/context-helpers.js.map +1 -1
  20. package/build/esm/baggage/internal/baggage-impl.js +23 -81
  21. package/build/esm/baggage/internal/baggage-impl.js.map +1 -1
  22. package/build/esm/baggage/internal/symbol.js +2 -13
  23. package/build/esm/baggage/internal/symbol.js.map +1 -1
  24. package/build/esm/baggage/types.d.ts +9 -2
  25. package/build/esm/baggage/types.js +1 -12
  26. package/build/esm/baggage/types.js.map +1 -1
  27. package/build/esm/baggage/utils.d.ts +2 -1
  28. package/build/esm/baggage/utils.js +6 -17
  29. package/build/esm/baggage/utils.js.map +1 -1
  30. package/build/esm/common/Attributes.d.ts +5 -1
  31. package/build/esm/common/Attributes.js +1 -12
  32. package/build/esm/common/Attributes.js.map +1 -1
  33. package/build/esm/common/Exception.d.ts +3 -1
  34. package/build/esm/common/Exception.js +1 -12
  35. package/build/esm/common/Exception.js.map +1 -1
  36. package/build/esm/common/Time.d.ts +6 -2
  37. package/build/esm/common/Time.js.map +1 -1
  38. package/build/esm/context/NoopContextManager.d.ts +1 -1
  39. package/build/esm/context/NoopContextManager.js +14 -58
  40. package/build/esm/context/NoopContextManager.js.map +1 -1
  41. package/build/esm/context/context.d.ts +11 -3
  42. package/build/esm/context/context.js +20 -24
  43. package/build/esm/context/context.js.map +1 -1
  44. package/build/esm/context/types.d.ts +6 -0
  45. package/build/esm/context/types.js +1 -12
  46. package/build/esm/context/types.js.map +1 -1
  47. package/build/esm/context-api.d.ts +4 -1
  48. package/build/esm/context-api.js +6 -14
  49. package/build/esm/context-api.js.map +1 -1
  50. package/build/esm/diag/ComponentLogger.d.ts +6 -6
  51. package/build/esm/diag/ComponentLogger.js +16 -75
  52. package/build/esm/diag/ComponentLogger.js.map +1 -1
  53. package/build/esm/diag/consoleLogger.d.ts +6 -1
  54. package/build/esm/diag/consoleLogger.js +41 -31
  55. package/build/esm/diag/consoleLogger.js.map +1 -1
  56. package/build/esm/diag/internal/logLevelLogger.d.ts +2 -1
  57. package/build/esm/diag/internal/logLevelLogger.js +2 -13
  58. package/build/esm/diag/internal/logLevelLogger.js.map +1 -1
  59. package/build/esm/diag/internal/noopLogger.d.ts +1 -1
  60. package/build/esm/diag/internal/noopLogger.js +1 -12
  61. package/build/esm/diag/internal/noopLogger.js.map +1 -1
  62. package/build/esm/diag/types.d.ts +11 -1
  63. package/build/esm/diag/types.js +1 -12
  64. package/build/esm/diag/types.js.map +1 -1
  65. package/build/esm/diag-api.d.ts +2 -0
  66. package/build/esm/diag-api.js +4 -13
  67. package/build/esm/diag-api.js.map +1 -1
  68. package/build/esm/experimental/index.d.ts +5 -1
  69. package/build/esm/experimental/index.js +5 -12
  70. package/build/esm/experimental/index.js.map +1 -1
  71. package/build/esm/experimental/trace/SugaredOptions.d.ts +1 -1
  72. package/build/esm/experimental/trace/SugaredOptions.js +1 -12
  73. package/build/esm/experimental/trace/SugaredOptions.js.map +1 -1
  74. package/build/esm/experimental/trace/SugaredTracer.d.ts +2 -2
  75. package/build/esm/experimental/trace/SugaredTracer.js +22 -26
  76. package/build/esm/experimental/trace/SugaredTracer.js.map +1 -1
  77. package/build/esm/index.d.ts +29 -24
  78. package/build/esm/index.js +9 -19
  79. package/build/esm/index.js.map +1 -1
  80. package/build/esm/internal/global-utils.d.ts +5 -5
  81. package/build/esm/internal/global-utils.js +20 -25
  82. package/build/esm/internal/global-utils.js.map +1 -1
  83. package/build/esm/internal/semver.js +10 -21
  84. package/build/esm/internal/semver.js.map +1 -1
  85. package/build/esm/metrics/Meter.d.ts +5 -1
  86. package/build/esm/metrics/Meter.js +1 -12
  87. package/build/esm/metrics/Meter.js.map +1 -1
  88. package/build/esm/metrics/MeterProvider.d.ts +3 -1
  89. package/build/esm/metrics/MeterProvider.js +1 -12
  90. package/build/esm/metrics/MeterProvider.js.map +1 -1
  91. package/build/esm/metrics/Metric.d.ts +79 -11
  92. package/build/esm/metrics/Metric.js +5 -12
  93. package/build/esm/metrics/Metric.js.map +1 -1
  94. package/build/esm/metrics/NoopMeter.d.ts +4 -2
  95. package/build/esm/metrics/NoopMeter.js +54 -131
  96. package/build/esm/metrics/NoopMeter.js.map +1 -1
  97. package/build/esm/metrics/NoopMeterProvider.d.ts +2 -2
  98. package/build/esm/metrics/NoopMeterProvider.js +6 -21
  99. package/build/esm/metrics/NoopMeterProvider.js.map +1 -1
  100. package/build/esm/metrics-api.d.ts +5 -1
  101. package/build/esm/metrics-api.js +7 -14
  102. package/build/esm/metrics-api.js.map +1 -1
  103. package/build/esm/propagation/NoopTextMapPropagator.d.ts +2 -2
  104. package/build/esm/propagation/NoopTextMapPropagator.js +8 -23
  105. package/build/esm/propagation/NoopTextMapPropagator.js.map +1 -1
  106. package/build/esm/propagation/TextMapPropagator.d.ts +14 -2
  107. package/build/esm/propagation/TextMapPropagator.js +12 -17
  108. package/build/esm/propagation/TextMapPropagator.js.map +1 -1
  109. package/build/esm/propagation-api.d.ts +5 -1
  110. package/build/esm/propagation-api.js +7 -14
  111. package/build/esm/propagation-api.js.map +1 -1
  112. package/build/esm/trace/NonRecordingSpan.d.ts +8 -8
  113. package/build/esm/trace/NonRecordingSpan.js +25 -39
  114. package/build/esm/trace/NonRecordingSpan.js.map +1 -1
  115. package/build/esm/trace/NoopTracer.d.ts +4 -4
  116. package/build/esm/trace/NoopTracer.js +21 -33
  117. package/build/esm/trace/NoopTracer.js.map +1 -1
  118. package/build/esm/trace/NoopTracerProvider.d.ts +3 -3
  119. package/build/esm/trace/NoopTracerProvider.js +5 -20
  120. package/build/esm/trace/NoopTracerProvider.js.map +1 -1
  121. package/build/esm/trace/ProxyTracer.d.ts +14 -9
  122. package/build/esm/trace/ProxyTracer.js +16 -27
  123. package/build/esm/trace/ProxyTracer.js.map +1 -1
  124. package/build/esm/trace/ProxyTracerProvider.d.ts +6 -3
  125. package/build/esm/trace/ProxyTracerProvider.js +15 -27
  126. package/build/esm/trace/ProxyTracerProvider.js.map +1 -1
  127. package/build/esm/trace/Sampler.d.ts +7 -5
  128. package/build/esm/trace/Sampler.js +1 -12
  129. package/build/esm/trace/Sampler.js.map +1 -1
  130. package/build/esm/trace/SamplingResult.d.ts +6 -2
  131. package/build/esm/trace/SamplingResult.js +3 -12
  132. package/build/esm/trace/SamplingResult.js.map +1 -1
  133. package/build/esm/trace/SpanOptions.d.ts +7 -5
  134. package/build/esm/trace/SpanOptions.js +1 -12
  135. package/build/esm/trace/SpanOptions.js.map +1 -1
  136. package/build/esm/trace/attributes.d.ts +5 -3
  137. package/build/esm/trace/attributes.js +1 -12
  138. package/build/esm/trace/attributes.js.map +1 -1
  139. package/build/esm/trace/context-utils.d.ts +3 -3
  140. package/build/esm/trace/context-utils.js +2 -13
  141. package/build/esm/trace/context-utils.js.map +1 -1
  142. package/build/esm/trace/internal/tracestate-impl.d.ts +1 -1
  143. package/build/esm/trace/internal/tracestate-impl.js +37 -49
  144. package/build/esm/trace/internal/tracestate-impl.js.map +1 -1
  145. package/build/esm/trace/internal/tracestate-validators.js +7 -18
  146. package/build/esm/trace/internal/tracestate-validators.js.map +1 -1
  147. package/build/esm/trace/internal/utils.d.ts +4 -1
  148. package/build/esm/trace/internal/utils.js +4 -12
  149. package/build/esm/trace/internal/utils.js.map +1 -1
  150. package/build/esm/trace/invalid-span-constants.d.ts +10 -1
  151. package/build/esm/trace/invalid-span-constants.js +13 -15
  152. package/build/esm/trace/invalid-span-constants.js.map +1 -1
  153. package/build/esm/trace/link.d.ts +4 -2
  154. package/build/esm/trace/link.js +1 -12
  155. package/build/esm/trace/link.js.map +1 -1
  156. package/build/esm/trace/span.d.ts +22 -10
  157. package/build/esm/trace/span.js +1 -12
  158. package/build/esm/trace/span.js.map +1 -1
  159. package/build/esm/trace/span_context.d.ts +3 -1
  160. package/build/esm/trace/span_context.js +1 -12
  161. package/build/esm/trace/span_context.js.map +1 -1
  162. package/build/esm/trace/span_kind.d.ts +3 -0
  163. package/build/esm/trace/span_kind.js +4 -12
  164. package/build/esm/trace/span_kind.js.map +1 -1
  165. package/build/esm/trace/spancontext-utils.d.ts +10 -2
  166. package/build/esm/trace/spancontext-utils.js +33 -16
  167. package/build/esm/trace/spancontext-utils.js.map +1 -1
  168. package/build/esm/trace/status.d.ts +5 -0
  169. package/build/esm/trace/status.js +6 -0
  170. package/build/esm/trace/status.js.map +1 -1
  171. package/build/esm/trace/trace_flags.d.ts +3 -0
  172. package/build/esm/trace/trace_flags.js +4 -12
  173. package/build/esm/trace/trace_flags.js.map +1 -1
  174. package/build/esm/trace/trace_state.d.ts +3 -0
  175. package/build/esm/trace/trace_state.js +1 -12
  176. package/build/esm/trace/trace_state.js.map +1 -1
  177. package/build/esm/trace/tracer.d.ts +5 -3
  178. package/build/esm/trace/tracer.js +1 -12
  179. package/build/esm/trace/tracer.js.map +1 -1
  180. package/build/esm/trace/tracer_options.d.ts +2 -0
  181. package/build/esm/trace/tracer_options.js +1 -12
  182. package/build/esm/trace/tracer_options.js.map +1 -1
  183. package/build/esm/trace/tracer_provider.d.ts +4 -2
  184. package/build/esm/trace/tracer_provider.js +1 -12
  185. package/build/esm/trace/tracer_provider.js.map +1 -1
  186. package/build/esm/trace-api.d.ts +5 -1
  187. package/build/esm/trace-api.js +7 -14
  188. package/build/esm/trace-api.js.map +1 -1
  189. package/build/esm/version.d.ts +1 -1
  190. package/build/esm/version.js +2 -13
  191. package/build/esm/version.js.map +1 -1
  192. package/build/esnext/api/context.d.ts +3 -1
  193. package/build/esnext/api/context.js +3 -12
  194. package/build/esnext/api/context.js.map +1 -1
  195. package/build/esnext/api/diag.d.ts +3 -1
  196. package/build/esnext/api/diag.js +11 -20
  197. package/build/esnext/api/diag.js.map +1 -1
  198. package/build/esnext/api/metrics.d.ts +2 -2
  199. package/build/esnext/api/metrics.js +1 -12
  200. package/build/esnext/api/metrics.js.map +1 -1
  201. package/build/esnext/api/propagation.d.ts +4 -2
  202. package/build/esnext/api/propagation.js +3 -12
  203. package/build/esnext/api/propagation.js.map +1 -1
  204. package/build/esnext/api/trace.d.ts +4 -2
  205. package/build/esnext/api/trace.js +3 -12
  206. package/build/esnext/api/trace.js.map +1 -1
  207. package/build/esnext/baggage/context-helpers.d.ts +2 -2
  208. package/build/esnext/baggage/context-helpers.js +1 -12
  209. package/build/esnext/baggage/context-helpers.js.map +1 -1
  210. package/build/esnext/baggage/internal/baggage-impl.js +2 -13
  211. package/build/esnext/baggage/internal/baggage-impl.js.map +1 -1
  212. package/build/esnext/baggage/internal/symbol.js +1 -12
  213. package/build/esnext/baggage/internal/symbol.js.map +1 -1
  214. package/build/esnext/baggage/types.d.ts +9 -2
  215. package/build/esnext/baggage/types.js +1 -12
  216. package/build/esnext/baggage/types.js.map +1 -1
  217. package/build/esnext/baggage/utils.d.ts +2 -1
  218. package/build/esnext/baggage/utils.js +2 -12
  219. package/build/esnext/baggage/utils.js.map +1 -1
  220. package/build/esnext/common/Attributes.d.ts +5 -1
  221. package/build/esnext/common/Attributes.js +1 -12
  222. package/build/esnext/common/Attributes.js.map +1 -1
  223. package/build/esnext/common/Exception.d.ts +3 -1
  224. package/build/esnext/common/Exception.js +1 -12
  225. package/build/esnext/common/Exception.js.map +1 -1
  226. package/build/esnext/common/Time.d.ts +6 -2
  227. package/build/esnext/common/Time.js.map +1 -1
  228. package/build/esnext/context/NoopContextManager.d.ts +1 -1
  229. package/build/esnext/context/NoopContextManager.js +1 -12
  230. package/build/esnext/context/NoopContextManager.js.map +1 -1
  231. package/build/esnext/context/context.d.ts +11 -3
  232. package/build/esnext/context/context.js +10 -13
  233. package/build/esnext/context/context.js.map +1 -1
  234. package/build/esnext/context/types.d.ts +6 -0
  235. package/build/esnext/context/types.js +1 -12
  236. package/build/esnext/context/types.js.map +1 -1
  237. package/build/esnext/context-api.d.ts +4 -1
  238. package/build/esnext/context-api.js +5 -13
  239. package/build/esnext/context-api.js.map +1 -1
  240. package/build/esnext/diag/ComponentLogger.d.ts +6 -6
  241. package/build/esnext/diag/ComponentLogger.js +2 -14
  242. package/build/esnext/diag/ComponentLogger.js.map +1 -1
  243. package/build/esnext/diag/consoleLogger.d.ts +6 -1
  244. package/build/esnext/diag/consoleLogger.js +36 -20
  245. package/build/esnext/diag/consoleLogger.js.map +1 -1
  246. package/build/esnext/diag/internal/logLevelLogger.d.ts +2 -1
  247. package/build/esnext/diag/internal/logLevelLogger.js +1 -12
  248. package/build/esnext/diag/internal/logLevelLogger.js.map +1 -1
  249. package/build/esnext/diag/internal/noopLogger.d.ts +1 -1
  250. package/build/esnext/diag/internal/noopLogger.js +1 -12
  251. package/build/esnext/diag/internal/noopLogger.js.map +1 -1
  252. package/build/esnext/diag/types.d.ts +11 -1
  253. package/build/esnext/diag/types.js +1 -12
  254. package/build/esnext/diag/types.js.map +1 -1
  255. package/build/esnext/diag-api.d.ts +2 -0
  256. package/build/esnext/diag-api.js +3 -12
  257. package/build/esnext/diag-api.js.map +1 -1
  258. package/build/esnext/experimental/index.d.ts +5 -1
  259. package/build/esnext/experimental/index.js +5 -12
  260. package/build/esnext/experimental/index.js.map +1 -1
  261. package/build/esnext/experimental/trace/SugaredOptions.d.ts +1 -1
  262. package/build/esnext/experimental/trace/SugaredOptions.js +1 -12
  263. package/build/esnext/experimental/trace/SugaredOptions.js.map +1 -1
  264. package/build/esnext/experimental/trace/SugaredTracer.d.ts +2 -2
  265. package/build/esnext/experimental/trace/SugaredTracer.js +2 -2
  266. package/build/esnext/experimental/trace/SugaredTracer.js.map +1 -1
  267. package/build/esnext/index.d.ts +29 -24
  268. package/build/esnext/index.js +4 -14
  269. package/build/esnext/index.js.map +1 -1
  270. package/build/esnext/internal/global-utils.d.ts +5 -5
  271. package/build/esnext/internal/global-utils.js +10 -14
  272. package/build/esnext/internal/global-utils.js.map +1 -1
  273. package/build/esnext/internal/semver.js +1 -12
  274. package/build/esnext/internal/semver.js.map +1 -1
  275. package/build/esnext/metrics/Meter.d.ts +5 -1
  276. package/build/esnext/metrics/Meter.js +1 -12
  277. package/build/esnext/metrics/Meter.js.map +1 -1
  278. package/build/esnext/metrics/MeterProvider.d.ts +3 -1
  279. package/build/esnext/metrics/MeterProvider.js +1 -12
  280. package/build/esnext/metrics/MeterProvider.js.map +1 -1
  281. package/build/esnext/metrics/Metric.d.ts +79 -11
  282. package/build/esnext/metrics/Metric.js +5 -12
  283. package/build/esnext/metrics/Metric.js.map +1 -1
  284. package/build/esnext/metrics/NoopMeter.d.ts +4 -2
  285. package/build/esnext/metrics/NoopMeter.js +3 -12
  286. package/build/esnext/metrics/NoopMeter.js.map +1 -1
  287. package/build/esnext/metrics/NoopMeterProvider.d.ts +2 -2
  288. package/build/esnext/metrics/NoopMeterProvider.js +1 -12
  289. package/build/esnext/metrics/NoopMeterProvider.js.map +1 -1
  290. package/build/esnext/metrics-api.d.ts +5 -1
  291. package/build/esnext/metrics-api.js +6 -13
  292. package/build/esnext/metrics-api.js.map +1 -1
  293. package/build/esnext/propagation/NoopTextMapPropagator.d.ts +2 -2
  294. package/build/esnext/propagation/NoopTextMapPropagator.js +1 -12
  295. package/build/esnext/propagation/NoopTextMapPropagator.js.map +1 -1
  296. package/build/esnext/propagation/TextMapPropagator.d.ts +14 -2
  297. package/build/esnext/propagation/TextMapPropagator.js +7 -12
  298. package/build/esnext/propagation/TextMapPropagator.js.map +1 -1
  299. package/build/esnext/propagation-api.d.ts +5 -1
  300. package/build/esnext/propagation-api.js +6 -13
  301. package/build/esnext/propagation-api.js.map +1 -1
  302. package/build/esnext/trace/NonRecordingSpan.d.ts +8 -8
  303. package/build/esnext/trace/NonRecordingSpan.js +3 -14
  304. package/build/esnext/trace/NonRecordingSpan.js.map +1 -1
  305. package/build/esnext/trace/NoopTracer.d.ts +4 -4
  306. package/build/esnext/trace/NoopTracer.js +6 -13
  307. package/build/esnext/trace/NoopTracer.js.map +1 -1
  308. package/build/esnext/trace/NoopTracerProvider.d.ts +3 -3
  309. package/build/esnext/trace/NoopTracerProvider.js +1 -12
  310. package/build/esnext/trace/NoopTracerProvider.js.map +1 -1
  311. package/build/esnext/trace/ProxyTracer.d.ts +14 -9
  312. package/build/esnext/trace/ProxyTracer.js +5 -14
  313. package/build/esnext/trace/ProxyTracer.js.map +1 -1
  314. package/build/esnext/trace/ProxyTracerProvider.d.ts +6 -3
  315. package/build/esnext/trace/ProxyTracerProvider.js +4 -12
  316. package/build/esnext/trace/ProxyTracerProvider.js.map +1 -1
  317. package/build/esnext/trace/Sampler.d.ts +7 -5
  318. package/build/esnext/trace/Sampler.js +1 -12
  319. package/build/esnext/trace/Sampler.js.map +1 -1
  320. package/build/esnext/trace/SamplingResult.d.ts +6 -2
  321. package/build/esnext/trace/SamplingResult.js +3 -12
  322. package/build/esnext/trace/SamplingResult.js.map +1 -1
  323. package/build/esnext/trace/SpanOptions.d.ts +7 -5
  324. package/build/esnext/trace/SpanOptions.js +1 -12
  325. package/build/esnext/trace/SpanOptions.js.map +1 -1
  326. package/build/esnext/trace/attributes.d.ts +5 -3
  327. package/build/esnext/trace/attributes.js +1 -12
  328. package/build/esnext/trace/attributes.js.map +1 -1
  329. package/build/esnext/trace/context-utils.d.ts +3 -3
  330. package/build/esnext/trace/context-utils.js +1 -12
  331. package/build/esnext/trace/context-utils.js.map +1 -1
  332. package/build/esnext/trace/internal/tracestate-impl.d.ts +1 -1
  333. package/build/esnext/trace/internal/tracestate-impl.js +8 -17
  334. package/build/esnext/trace/internal/tracestate-impl.js.map +1 -1
  335. package/build/esnext/trace/internal/tracestate-validators.js +1 -12
  336. package/build/esnext/trace/internal/tracestate-validators.js.map +1 -1
  337. package/build/esnext/trace/internal/utils.d.ts +4 -1
  338. package/build/esnext/trace/internal/utils.js +4 -12
  339. package/build/esnext/trace/internal/utils.js.map +1 -1
  340. package/build/esnext/trace/invalid-span-constants.d.ts +10 -1
  341. package/build/esnext/trace/invalid-span-constants.js +10 -12
  342. package/build/esnext/trace/invalid-span-constants.js.map +1 -1
  343. package/build/esnext/trace/link.d.ts +4 -2
  344. package/build/esnext/trace/link.js +1 -12
  345. package/build/esnext/trace/link.js.map +1 -1
  346. package/build/esnext/trace/span.d.ts +22 -10
  347. package/build/esnext/trace/span.js +1 -12
  348. package/build/esnext/trace/span.js.map +1 -1
  349. package/build/esnext/trace/span_context.d.ts +3 -1
  350. package/build/esnext/trace/span_context.js +1 -12
  351. package/build/esnext/trace/span_context.js.map +1 -1
  352. package/build/esnext/trace/span_kind.d.ts +3 -0
  353. package/build/esnext/trace/span_kind.js +4 -12
  354. package/build/esnext/trace/span_kind.js.map +1 -1
  355. package/build/esnext/trace/spancontext-utils.d.ts +10 -2
  356. package/build/esnext/trace/spancontext-utils.js +33 -16
  357. package/build/esnext/trace/spancontext-utils.js.map +1 -1
  358. package/build/esnext/trace/status.d.ts +5 -0
  359. package/build/esnext/trace/status.js +6 -0
  360. package/build/esnext/trace/status.js.map +1 -1
  361. package/build/esnext/trace/trace_flags.d.ts +3 -0
  362. package/build/esnext/trace/trace_flags.js +4 -12
  363. package/build/esnext/trace/trace_flags.js.map +1 -1
  364. package/build/esnext/trace/trace_state.d.ts +3 -0
  365. package/build/esnext/trace/trace_state.js +1 -12
  366. package/build/esnext/trace/trace_state.js.map +1 -1
  367. package/build/esnext/trace/tracer.d.ts +5 -3
  368. package/build/esnext/trace/tracer.js +1 -12
  369. package/build/esnext/trace/tracer.js.map +1 -1
  370. package/build/esnext/trace/tracer_options.d.ts +2 -0
  371. package/build/esnext/trace/tracer_options.js +1 -12
  372. package/build/esnext/trace/tracer_options.js.map +1 -1
  373. package/build/esnext/trace/tracer_provider.d.ts +4 -2
  374. package/build/esnext/trace/tracer_provider.js +1 -12
  375. package/build/esnext/trace/tracer_provider.js.map +1 -1
  376. package/build/esnext/trace-api.d.ts +5 -1
  377. package/build/esnext/trace-api.js +6 -13
  378. package/build/esnext/trace-api.js.map +1 -1
  379. package/build/esnext/version.d.ts +1 -1
  380. package/build/esnext/version.js +2 -13
  381. package/build/esnext/version.js.map +1 -1
  382. package/build/src/api/context.d.ts +3 -1
  383. package/build/src/api/context.js +3 -12
  384. package/build/src/api/context.js.map +1 -1
  385. package/build/src/api/diag.d.ts +3 -1
  386. package/build/src/api/diag.js +10 -19
  387. package/build/src/api/diag.js.map +1 -1
  388. package/build/src/api/metrics.d.ts +2 -2
  389. package/build/src/api/metrics.js +1 -12
  390. package/build/src/api/metrics.js.map +1 -1
  391. package/build/src/api/propagation.d.ts +4 -2
  392. package/build/src/api/propagation.js +3 -12
  393. package/build/src/api/propagation.js.map +1 -1
  394. package/build/src/api/trace.d.ts +4 -2
  395. package/build/src/api/trace.js +3 -12
  396. package/build/src/api/trace.js.map +1 -1
  397. package/build/src/baggage/context-helpers.d.ts +2 -2
  398. package/build/src/baggage/context-helpers.js +1 -12
  399. package/build/src/baggage/context-helpers.js.map +1 -1
  400. package/build/src/baggage/internal/baggage-impl.js +2 -13
  401. package/build/src/baggage/internal/baggage-impl.js.map +1 -1
  402. package/build/src/baggage/internal/symbol.js +1 -12
  403. package/build/src/baggage/internal/symbol.js.map +1 -1
  404. package/build/src/baggage/types.d.ts +9 -2
  405. package/build/src/baggage/types.js +1 -12
  406. package/build/src/baggage/types.js.map +1 -1
  407. package/build/src/baggage/utils.d.ts +2 -1
  408. package/build/src/baggage/utils.js +2 -12
  409. package/build/src/baggage/utils.js.map +1 -1
  410. package/build/src/common/Attributes.d.ts +5 -1
  411. package/build/src/common/Attributes.js +1 -12
  412. package/build/src/common/Attributes.js.map +1 -1
  413. package/build/src/common/Exception.d.ts +3 -1
  414. package/build/src/common/Exception.js +1 -12
  415. package/build/src/common/Exception.js.map +1 -1
  416. package/build/src/common/Time.d.ts +6 -2
  417. package/build/src/common/Time.js.map +1 -1
  418. package/build/src/context/NoopContextManager.d.ts +1 -1
  419. package/build/src/context/NoopContextManager.js +1 -12
  420. package/build/src/context/NoopContextManager.js.map +1 -1
  421. package/build/src/context/context.d.ts +11 -3
  422. package/build/src/context/context.js +11 -14
  423. package/build/src/context/context.js.map +1 -1
  424. package/build/src/context/types.d.ts +6 -0
  425. package/build/src/context/types.js +1 -12
  426. package/build/src/context/types.js.map +1 -1
  427. package/build/src/context-api.d.ts +4 -1
  428. package/build/src/context-api.js +5 -13
  429. package/build/src/context-api.js.map +1 -1
  430. package/build/src/diag/ComponentLogger.d.ts +6 -6
  431. package/build/src/diag/ComponentLogger.js +2 -14
  432. package/build/src/diag/ComponentLogger.js.map +1 -1
  433. package/build/src/diag/consoleLogger.d.ts +6 -1
  434. package/build/src/diag/consoleLogger.js +37 -21
  435. package/build/src/diag/consoleLogger.js.map +1 -1
  436. package/build/src/diag/internal/logLevelLogger.d.ts +2 -1
  437. package/build/src/diag/internal/logLevelLogger.js +1 -12
  438. package/build/src/diag/internal/logLevelLogger.js.map +1 -1
  439. package/build/src/diag/internal/noopLogger.d.ts +1 -1
  440. package/build/src/diag/internal/noopLogger.js +1 -12
  441. package/build/src/diag/internal/noopLogger.js.map +1 -1
  442. package/build/src/diag/types.d.ts +11 -1
  443. package/build/src/diag/types.js +1 -12
  444. package/build/src/diag/types.js.map +1 -1
  445. package/build/src/diag-api.d.ts +2 -0
  446. package/build/src/diag-api.js +3 -12
  447. package/build/src/diag-api.js.map +1 -1
  448. package/build/src/experimental/index.d.ts +5 -1
  449. package/build/src/experimental/index.js +7 -14
  450. package/build/src/experimental/index.js.map +1 -1
  451. package/build/src/experimental/trace/SugaredOptions.d.ts +1 -1
  452. package/build/src/experimental/trace/SugaredOptions.js +1 -12
  453. package/build/src/experimental/trace/SugaredOptions.js.map +1 -1
  454. package/build/src/experimental/trace/SugaredTracer.d.ts +2 -2
  455. package/build/src/experimental/trace/SugaredTracer.js.map +1 -1
  456. package/build/src/index.d.ts +29 -24
  457. package/build/src/index.js +2 -12
  458. package/build/src/index.js.map +1 -1
  459. package/build/src/internal/global-utils.d.ts +5 -5
  460. package/build/src/internal/global-utils.js +10 -14
  461. package/build/src/internal/global-utils.js.map +1 -1
  462. package/build/src/internal/semver.js +1 -12
  463. package/build/src/internal/semver.js.map +1 -1
  464. package/build/src/metrics/Meter.d.ts +5 -1
  465. package/build/src/metrics/Meter.js +1 -12
  466. package/build/src/metrics/Meter.js.map +1 -1
  467. package/build/src/metrics/MeterProvider.d.ts +3 -1
  468. package/build/src/metrics/MeterProvider.js +1 -12
  469. package/build/src/metrics/MeterProvider.js.map +1 -1
  470. package/build/src/metrics/Metric.d.ts +79 -11
  471. package/build/src/metrics/Metric.js +6 -13
  472. package/build/src/metrics/Metric.js.map +1 -1
  473. package/build/src/metrics/NoopMeter.d.ts +4 -2
  474. package/build/src/metrics/NoopMeter.js +3 -12
  475. package/build/src/metrics/NoopMeter.js.map +1 -1
  476. package/build/src/metrics/NoopMeterProvider.d.ts +2 -2
  477. package/build/src/metrics/NoopMeterProvider.js +1 -12
  478. package/build/src/metrics/NoopMeterProvider.js.map +1 -1
  479. package/build/src/metrics-api.d.ts +5 -1
  480. package/build/src/metrics-api.js +6 -13
  481. package/build/src/metrics-api.js.map +1 -1
  482. package/build/src/propagation/NoopTextMapPropagator.d.ts +2 -2
  483. package/build/src/propagation/NoopTextMapPropagator.js +1 -12
  484. package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
  485. package/build/src/propagation/TextMapPropagator.d.ts +14 -2
  486. package/build/src/propagation/TextMapPropagator.js +7 -12
  487. package/build/src/propagation/TextMapPropagator.js.map +1 -1
  488. package/build/src/propagation-api.d.ts +5 -1
  489. package/build/src/propagation-api.js +6 -13
  490. package/build/src/propagation-api.js.map +1 -1
  491. package/build/src/trace/NonRecordingSpan.d.ts +8 -8
  492. package/build/src/trace/NonRecordingSpan.js +3 -14
  493. package/build/src/trace/NonRecordingSpan.js.map +1 -1
  494. package/build/src/trace/NoopTracer.d.ts +4 -4
  495. package/build/src/trace/NoopTracer.js +6 -13
  496. package/build/src/trace/NoopTracer.js.map +1 -1
  497. package/build/src/trace/NoopTracerProvider.d.ts +3 -3
  498. package/build/src/trace/NoopTracerProvider.js +1 -12
  499. package/build/src/trace/NoopTracerProvider.js.map +1 -1
  500. package/build/src/trace/ProxyTracer.d.ts +14 -9
  501. package/build/src/trace/ProxyTracer.js +5 -14
  502. package/build/src/trace/ProxyTracer.js.map +1 -1
  503. package/build/src/trace/ProxyTracerProvider.d.ts +6 -3
  504. package/build/src/trace/ProxyTracerProvider.js +4 -12
  505. package/build/src/trace/ProxyTracerProvider.js.map +1 -1
  506. package/build/src/trace/Sampler.d.ts +7 -5
  507. package/build/src/trace/Sampler.js +1 -12
  508. package/build/src/trace/Sampler.js.map +1 -1
  509. package/build/src/trace/SamplingResult.d.ts +6 -2
  510. package/build/src/trace/SamplingResult.js +3 -12
  511. package/build/src/trace/SamplingResult.js.map +1 -1
  512. package/build/src/trace/SpanOptions.d.ts +7 -5
  513. package/build/src/trace/SpanOptions.js +1 -12
  514. package/build/src/trace/SpanOptions.js.map +1 -1
  515. package/build/src/trace/attributes.d.ts +5 -3
  516. package/build/src/trace/attributes.js +1 -12
  517. package/build/src/trace/attributes.js.map +1 -1
  518. package/build/src/trace/context-utils.d.ts +3 -3
  519. package/build/src/trace/context-utils.js +1 -12
  520. package/build/src/trace/context-utils.js.map +1 -1
  521. package/build/src/trace/internal/tracestate-impl.d.ts +1 -1
  522. package/build/src/trace/internal/tracestate-impl.js +8 -17
  523. package/build/src/trace/internal/tracestate-impl.js.map +1 -1
  524. package/build/src/trace/internal/tracestate-validators.js +1 -12
  525. package/build/src/trace/internal/tracestate-validators.js.map +1 -1
  526. package/build/src/trace/internal/utils.d.ts +4 -1
  527. package/build/src/trace/internal/utils.js +4 -12
  528. package/build/src/trace/internal/utils.js.map +1 -1
  529. package/build/src/trace/invalid-span-constants.d.ts +10 -1
  530. package/build/src/trace/invalid-span-constants.js +10 -12
  531. package/build/src/trace/invalid-span-constants.js.map +1 -1
  532. package/build/src/trace/link.d.ts +4 -2
  533. package/build/src/trace/link.js +1 -12
  534. package/build/src/trace/link.js.map +1 -1
  535. package/build/src/trace/span.d.ts +22 -10
  536. package/build/src/trace/span.js +1 -12
  537. package/build/src/trace/span.js.map +1 -1
  538. package/build/src/trace/span_context.d.ts +3 -1
  539. package/build/src/trace/span_context.js +1 -12
  540. package/build/src/trace/span_context.js.map +1 -1
  541. package/build/src/trace/span_kind.d.ts +3 -0
  542. package/build/src/trace/span_kind.js +6 -14
  543. package/build/src/trace/span_kind.js.map +1 -1
  544. package/build/src/trace/spancontext-utils.d.ts +10 -2
  545. package/build/src/trace/spancontext-utils.js +33 -16
  546. package/build/src/trace/spancontext-utils.js.map +1 -1
  547. package/build/src/trace/status.d.ts +5 -0
  548. package/build/src/trace/status.js +6 -0
  549. package/build/src/trace/status.js.map +1 -1
  550. package/build/src/trace/trace_flags.d.ts +3 -0
  551. package/build/src/trace/trace_flags.js +4 -12
  552. package/build/src/trace/trace_flags.js.map +1 -1
  553. package/build/src/trace/trace_state.d.ts +3 -0
  554. package/build/src/trace/trace_state.js +1 -12
  555. package/build/src/trace/trace_state.js.map +1 -1
  556. package/build/src/trace/tracer.d.ts +5 -3
  557. package/build/src/trace/tracer.js +1 -12
  558. package/build/src/trace/tracer.js.map +1 -1
  559. package/build/src/trace/tracer_options.d.ts +2 -0
  560. package/build/src/trace/tracer_options.js +1 -12
  561. package/build/src/trace/tracer_options.js.map +1 -1
  562. package/build/src/trace/tracer_provider.d.ts +4 -2
  563. package/build/src/trace/tracer_provider.js +1 -12
  564. package/build/src/trace/tracer_provider.js.map +1 -1
  565. package/build/src/trace-api.d.ts +5 -1
  566. package/build/src/trace-api.js +6 -13
  567. package/build/src/trace-api.js.map +1 -1
  568. package/build/src/version.d.ts +1 -1
  569. package/build/src/version.js +2 -13
  570. package/build/src/version.js.map +1 -1
  571. package/package.json +19 -36
  572. package/build/esm/metrics/ObservableResult.d.ts +0 -31
  573. package/build/esm/metrics/ObservableResult.js +0 -17
  574. package/build/esm/metrics/ObservableResult.js.map +0 -1
  575. package/build/esm/platform/browser/globalThis.d.ts +0 -10
  576. package/build/esm/platform/browser/globalThis.js +0 -35
  577. package/build/esm/platform/browser/globalThis.js.map +0 -1
  578. package/build/esm/platform/browser/index.d.ts +0 -2
  579. package/build/esm/platform/browser/index.js +0 -17
  580. package/build/esm/platform/browser/index.js.map +0 -1
  581. package/build/esm/platform/index.d.ts +0 -2
  582. package/build/esm/platform/index.js +0 -17
  583. package/build/esm/platform/index.js.map +0 -1
  584. package/build/esm/platform/node/globalThis.d.ts +0 -3
  585. package/build/esm/platform/node/globalThis.js +0 -19
  586. package/build/esm/platform/node/globalThis.js.map +0 -1
  587. package/build/esm/platform/node/index.d.ts +0 -2
  588. package/build/esm/platform/node/index.js +0 -17
  589. package/build/esm/platform/node/index.js.map +0 -1
  590. package/build/esnext/metrics/ObservableResult.d.ts +0 -31
  591. package/build/esnext/metrics/ObservableResult.js +0 -17
  592. package/build/esnext/metrics/ObservableResult.js.map +0 -1
  593. package/build/esnext/platform/browser/globalThis.d.ts +0 -10
  594. package/build/esnext/platform/browser/globalThis.js +0 -35
  595. package/build/esnext/platform/browser/globalThis.js.map +0 -1
  596. package/build/esnext/platform/browser/index.d.ts +0 -2
  597. package/build/esnext/platform/browser/index.js +0 -17
  598. package/build/esnext/platform/browser/index.js.map +0 -1
  599. package/build/esnext/platform/index.d.ts +0 -2
  600. package/build/esnext/platform/index.js +0 -17
  601. package/build/esnext/platform/index.js.map +0 -1
  602. package/build/esnext/platform/node/globalThis.d.ts +0 -3
  603. package/build/esnext/platform/node/globalThis.js +0 -19
  604. package/build/esnext/platform/node/globalThis.js.map +0 -1
  605. package/build/esnext/platform/node/index.d.ts +0 -2
  606. package/build/esnext/platform/node/index.js +0 -17
  607. package/build/esnext/platform/node/index.js.map +0 -1
  608. package/build/src/metrics/ObservableResult.d.ts +0 -31
  609. package/build/src/metrics/ObservableResult.js +0 -18
  610. package/build/src/metrics/ObservableResult.js.map +0 -1
  611. package/build/src/platform/browser/globalThis.d.ts +0 -10
  612. package/build/src/platform/browser/globalThis.js +0 -38
  613. package/build/src/platform/browser/globalThis.js.map +0 -1
  614. package/build/src/platform/browser/index.d.ts +0 -2
  615. package/build/src/platform/browser/index.js +0 -29
  616. package/build/src/platform/browser/index.js.map +0 -1
  617. package/build/src/platform/index.d.ts +0 -2
  618. package/build/src/platform/index.js +0 -29
  619. package/build/src/platform/index.js.map +0 -1
  620. package/build/src/platform/node/globalThis.d.ts +0 -3
  621. package/build/src/platform/node/globalThis.js +0 -22
  622. package/build/src/platform/node/globalThis.js.map +0 -1
  623. package/build/src/platform/node/index.d.ts +0 -2
  624. package/build/src/platform/node/index.js +0 -29
  625. package/build/src/platform/node/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,2DAIkC;AAClC,gFAA6E;AAC7E,wEAM0C;AAC1C,gEAKoC;AACpC,4CAAiD;AACjD,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,MAAM,wBAAwB,GAAG,IAAI,6CAAqB,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAa,cAAc;IAGzB,+FAA+F;IAC/F;QA8DO,kBAAa,GAAG,qBAAa,CAAC;QAE9B,eAAU,GAAG,4BAAU,CAAC;QAExB,qBAAgB,GAAG,kCAAgB,CAAC;QAEpC,eAAU,GAAG,4BAAU,CAAC;QAExB,kBAAa,GAAG,+BAAa,CAAC;IAtEd,CAAC;IAExB,uDAAuD;IAChD,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAA6B;QACtD,OAAO,IAAA,6BAAc,EAAC,QAAQ,EAAE,UAAU,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CACX,OAAgB,EAChB,OAAgB,EAChB,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CACZ,OAAgB,EAChB,OAAgB,EAChB,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,mCAAmC;IAC5B,OAAO;QACZ,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAYO,oBAAoB;QAC1B,OAAO,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,wBAAwB,CAAC;IACzD,CAAC;CACF;AA/ED,wCA+EC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Context } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport {\n defaultTextMapGetter,\n defaultTextMapSetter,\n TextMapGetter,\n TextMapPropagator,\n TextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n getBaggage,\n getActiveBaggage,\n setBaggage,\n deleteBaggage,\n} from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nexport class PropagationAPI {\n private static _instance?: PropagationAPI;\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Propagator API */\n public static getInstance(): PropagationAPI {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n public setGlobalPropagator(propagator: TextMapPropagator): boolean {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n public inject<Carrier>(\n context: Context,\n carrier: Carrier,\n setter: TextMapSetter<Carrier> = defaultTextMapSetter\n ): void {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n public extract<Carrier>(\n context: Context,\n carrier: Carrier,\n getter: TextMapGetter<Carrier> = defaultTextMapGetter\n ): Context {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n public fields(): string[] {\n return this._getGlobalPropagator().fields();\n }\n\n /** Remove the global propagator */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n\n public createBaggage = createBaggage;\n\n public getBaggage = getBaggage;\n\n public getActiveBaggage = getActiveBaggage;\n\n public setBaggage = setBaggage;\n\n public deleteBaggage = deleteBaggage;\n\n private _getGlobalPropagator(): TextMapPropagator {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n"]}
1
+ {"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAIkC;AAClC,gFAA6E;AAM7E,wEAG0C;AAC1C,gEAKoC;AACpC,4CAAiD;AACjD,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,MAAM,wBAAwB,GAAG,IAAI,6CAAqB,EAAE,CAAC;AAE7D;;;;GAIG;AACH,MAAa,cAAc;IAGzB,+FAA+F;IAC/F;QA8DO,kBAAa,GAAG,qBAAa,CAAC;QAE9B,eAAU,GAAG,4BAAU,CAAC;QAExB,qBAAgB,GAAG,kCAAgB,CAAC;QAEpC,eAAU,GAAG,4BAAU,CAAC;QAExB,kBAAa,GAAG,+BAAa,CAAC;IAtEd,CAAC;IAExB,uDAAuD;IAChD,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;SACvC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAA6B;QACtD,OAAO,IAAA,6BAAc,EAAC,QAAQ,EAAE,UAAU,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CACX,OAAgB,EAChB,OAAgB,EAChB,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CACZ,OAAgB,EAChB,OAAgB,EAChB,SAAiC,wCAAoB;QAErD,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED,mCAAmC;IAC5B,OAAO;QACZ,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAYO,oBAAoB;QAC1B,OAAO,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,wBAAwB,CAAC;IACzD,CAAC;CACF;AA/ED,wCA+EC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport type {\n TextMapGetter,\n TextMapPropagator,\n TextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from '../propagation/TextMapPropagator';\nimport {\n getBaggage,\n getActiveBaggage,\n setBaggage,\n deleteBaggage,\n} from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n private static _instance?: PropagationAPI;\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Propagator API */\n public static getInstance(): PropagationAPI {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n public setGlobalPropagator(propagator: TextMapPropagator): boolean {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n public inject<Carrier>(\n context: Context,\n carrier: Carrier,\n setter: TextMapSetter<Carrier> = defaultTextMapSetter\n ): void {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n public extract<Carrier>(\n context: Context,\n carrier: Carrier,\n getter: TextMapGetter<Carrier> = defaultTextMapGetter\n ): Context {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n public fields(): string[] {\n return this._getGlobalPropagator().fields();\n }\n\n /** Remove the global propagator */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n\n public createBaggage = createBaggage;\n\n public getBaggage = getBaggage;\n\n public getActiveBaggage = getActiveBaggage;\n\n public setBaggage = setBaggage;\n\n public deleteBaggage = deleteBaggage;\n\n private _getGlobalPropagator(): TextMapPropagator {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n"]}
@@ -1,9 +1,11 @@
1
1
  import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
2
- import { Tracer } from '../trace/tracer';
3
- import { TracerProvider } from '../trace/tracer_provider';
2
+ import type { Tracer } from '../trace/tracer';
3
+ import type { TracerProvider } from '../trace/tracer_provider';
4
4
  import { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils';
5
5
  /**
6
6
  * Singleton object which represents the entry point to the OpenTelemetry Tracing API
7
+ *
8
+ * @since 1.0.0
7
9
  */
8
10
  export declare class TraceAPI {
9
11
  private static _instance?;
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.TraceAPI = void 0;
@@ -24,6 +13,8 @@ const diag_1 = require("./diag");
24
13
  const API_NAME = 'trace';
25
14
  /**
26
15
  * Singleton object which represents the entry point to the OpenTelemetry Tracing API
16
+ *
17
+ * @since 1.0.0
27
18
  */
28
19
  class TraceAPI {
29
20
  /** Empty private constructor prevents end users from constructing a new instance of the API */
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAIkC;AAClC,sEAAmE;AACnE,kEAGoC;AAGpC,0DAOgC;AAChC,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;GAEG;AACH,MAAa,QAAQ;IAKnB,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAmDlD,oBAAe,GAAG,mCAAe,CAAC;QAElC,uBAAkB,GAAG,sCAAkB,CAAC;QAExC,eAAU,GAAG,0BAAU,CAAC;QAExB,YAAO,GAAG,uBAAO,CAAC;QAElB,kBAAa,GAAG,6BAAa,CAAC;QAE9B,mBAAc,GAAG,8BAAc,CAAC;QAEhC,YAAO,GAAG,uBAAO,CAAC;QAElB,mBAAc,GAAG,8BAAc,CAAC;IA9DhB,CAAC;IAExB,kDAAkD;IAC3C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAAC,QAAwB;QACrD,MAAM,OAAO,GAAG,IAAA,6BAAc,EAC5B,QAAQ,EACR,IAAI,CAAC,oBAAoB,EACzB,cAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SACjD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,OAAO;QACZ,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;IACxD,CAAC;CAiBF;AArED,4BAqEC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport {\n isSpanContextValid,\n wrapSpanContext,\n} from '../trace/spancontext-utils';\nimport { Tracer } from '../trace/tracer';\nimport { TracerProvider } from '../trace/tracer_provider';\nimport {\n deleteSpan,\n getActiveSpan,\n getSpan,\n getSpanContext,\n setSpan,\n setSpanContext,\n} from '../trace/context-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'trace';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nexport class TraceAPI {\n private static _instance?: TraceAPI;\n\n private _proxyTracerProvider = new ProxyTracerProvider();\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Trace API */\n public static getInstance(): TraceAPI {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n public setGlobalTracerProvider(provider: TracerProvider): boolean {\n const success = registerGlobal(\n API_NAME,\n this._proxyTracerProvider,\n DiagAPI.instance()\n );\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n\n /**\n * Returns the global tracer provider.\n */\n public getTracerProvider(): TracerProvider {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n\n /**\n * Returns a tracer from the global tracer provider.\n */\n public getTracer(name: string, version?: string): Tracer {\n return this.getTracerProvider().getTracer(name, version);\n }\n\n /** Remove the global tracer provider */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n\n public wrapSpanContext = wrapSpanContext;\n\n public isSpanContextValid = isSpanContextValid;\n\n public deleteSpan = deleteSpan;\n\n public getSpan = getSpan;\n\n public getActiveSpan = getActiveSpan;\n\n public getSpanContext = getSpanContext;\n\n public setSpan = setSpan;\n\n public setSpanContext = setSpanContext;\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAIkC;AAClC,sEAAmE;AACnE,kEAGoC;AAGpC,0DAOgC;AAChC,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;;;GAIG;AACH,MAAa,QAAQ;IAKnB,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAmDlD,oBAAe,GAAG,mCAAe,CAAC;QAElC,uBAAkB,GAAG,sCAAkB,CAAC;QAExC,eAAU,GAAG,0BAAU,CAAC;QAExB,YAAO,GAAG,uBAAO,CAAC;QAElB,kBAAa,GAAG,6BAAa,CAAC;QAE9B,mBAAc,GAAG,8BAAc,CAAC;QAEhC,YAAO,GAAG,uBAAO,CAAC;QAElB,mBAAc,GAAG,8BAAc,CAAC;IA9DhB,CAAC;IAExB,kDAAkD;IAC3C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAAC,QAAwB;QACrD,MAAM,OAAO,GAAG,IAAA,6BAAc,EAC5B,QAAQ,EACR,IAAI,CAAC,oBAAoB,EACzB,cAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SACjD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,OAAO;QACZ,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,yCAAmB,EAAE,CAAC;IACxD,CAAC;CAiBF;AArED,4BAqEC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport {\n isSpanContextValid,\n wrapSpanContext,\n} from '../trace/spancontext-utils';\nimport type { Tracer } from '../trace/tracer';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport {\n deleteSpan,\n getActiveSpan,\n getSpan,\n getSpanContext,\n setSpan,\n setSpanContext,\n} from '../trace/context-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'trace';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n private static _instance?: TraceAPI;\n\n private _proxyTracerProvider = new ProxyTracerProvider();\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Trace API */\n public static getInstance(): TraceAPI {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n public setGlobalTracerProvider(provider: TracerProvider): boolean {\n const success = registerGlobal(\n API_NAME,\n this._proxyTracerProvider,\n DiagAPI.instance()\n );\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n\n /**\n * Returns the global tracer provider.\n */\n public getTracerProvider(): TracerProvider {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n\n /**\n * Returns a tracer from the global tracer provider.\n */\n public getTracer(name: string, version?: string): Tracer {\n return this.getTracerProvider().getTracer(name, version);\n }\n\n /** Remove the global tracer provider */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n\n public wrapSpanContext = wrapSpanContext;\n\n public isSpanContextValid = isSpanContextValid;\n\n public deleteSpan = deleteSpan;\n\n public getSpan = getSpan;\n\n public getActiveSpan = getActiveSpan;\n\n public getSpanContext = getSpanContext;\n\n public setSpan = setSpan;\n\n public setSpanContext = setSpanContext;\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { Context } from '../context/types';
2
- import { Baggage } from './types';
1
+ import type { Context } from '../context/types';
2
+ import type { Baggage } from './types';
3
3
  /**
4
4
  * Retrieve the current baggage from the given context
5
5
  *
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA4C;AAC5C,gDAAsD;AAItD;;GAEG;AACH,MAAM,WAAW,GAAG,IAAA,0BAAgB,EAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAFD,gCAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC;AAFD,sCAEC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\nimport { Context } from '../context/types';\nimport { Baggage } from './types';\n\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context: Context): Baggage | undefined {\n return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;\n}\n\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage(): Baggage | undefined {\n return getBaggage(ContextAPI.getInstance().active());\n}\n\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context: Context, baggage: Baggage): Context {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context: Context): Context {\n return context.deleteValue(BAGGAGE_KEY);\n}\n"]}
1
+ {"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAA4C;AAC5C,gDAAsD;AAItD;;GAEG;AACH,MAAM,WAAW,GAAG,IAAA,0BAAgB,EAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAFD,gCAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,UAAU,CAAC,oBAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC;AAFD,sCAEC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\nimport type { Context } from '../context/types';\nimport type { Baggage } from './types';\n\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context: Context): Baggage | undefined {\n return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;\n}\n\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage(): Baggage | undefined {\n return getBaggage(ContextAPI.getInstance().active());\n}\n\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context: Context, baggage: Baggage): Context {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context: Context): Context {\n return context.deleteValue(BAGGAGE_KEY);\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.BaggageImpl = void 0;
@@ -28,7 +17,7 @@ class BaggageImpl {
28
17
  return Object.assign({}, entry);
29
18
  }
30
19
  getAllEntries() {
31
- return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);
20
+ return Array.from(this._entries.entries());
32
21
  }
33
22
  setEntry(key, entry) {
34
23
  const newBaggage = new BaggageImpl(this._entries);
@@ -1 +1 @@
1
- {"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,MAAa,WAAW;IAGtB,YAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAmB;QACvC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,GAAG,IAAc;QAC7B,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AA3CD,kCA2CC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n private _entries: Map<string, BaggageEntry>;\n\n constructor(entries?: Map<string, BaggageEntry>) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n\n getEntry(key: string): BaggageEntry | undefined {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n\n return Object.assign({}, entry);\n }\n\n getAllEntries(): [string, BaggageEntry][] {\n return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);\n }\n\n setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n\n removeEntry(key: string): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n\n removeEntries(...keys: string[]): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n\n clear(): BaggageImpl {\n return new BaggageImpl();\n }\n}\n"]}
1
+ {"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,MAAa,WAAW;IAGtB,YAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAmB;QACvC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,GAAG,IAAc;QAC7B,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AA3CD,kCA2CC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n private _entries: Map<string, BaggageEntry>;\n\n constructor(entries?: Map<string, BaggageEntry>) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n\n getEntry(key: string): BaggageEntry | undefined {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n\n return Object.assign({}, entry);\n }\n\n getAllEntries(): [string, BaggageEntry][] {\n return Array.from(this._entries.entries());\n }\n\n setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n\n removeEntry(key: string): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n\n removeEntries(...keys: string[]): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n\n clear(): BaggageImpl {\n return new BaggageImpl();\n }\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.baggageEntryMetadataSymbol = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AACU,QAAA,0BAA0B,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n"]}
1
+ {"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACU,QAAA,0BAA0B,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n"]}
@@ -1,4 +1,7 @@
1
- import { baggageEntryMetadataSymbol } from './internal/symbol';
1
+ import type { baggageEntryMetadataSymbol } from './internal/symbol';
2
+ /**
3
+ * @since 1.0.0
4
+ */
2
5
  export interface BaggageEntry {
3
6
  /** `String` value of the `BaggageEntry`. */
4
7
  value: string;
@@ -11,8 +14,10 @@ export interface BaggageEntry {
11
14
  /**
12
15
  * Serializable Metadata defined by the W3C baggage specification.
13
16
  * It currently has no special meaning defined by the OpenTelemetry or W3C.
17
+ *
18
+ * @since 1.0.0
14
19
  */
15
- export declare type BaggageEntryMetadata = {
20
+ export type BaggageEntryMetadata = {
16
21
  toString(): string;
17
22
  } & {
18
23
  __TYPE__: typeof baggageEntryMetadataSymbol;
@@ -21,6 +26,8 @@ export declare type BaggageEntryMetadata = {
21
26
  * Baggage represents collection of key-value pairs with optional metadata.
22
27
  * Each key of Baggage is associated with exactly one value.
23
28
  * Baggage may be used to annotate and enrich telemetry data.
29
+ *
30
+ * @since 1.0.0
24
31
  */
25
32
  export interface Baggage {
26
33
  /**
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/baggage/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface BaggageEntry {\n /** `String` value of the `BaggageEntry`. */\n value: string;\n /**\n * Metadata is an optional string property defined by the W3C baggage specification.\n * It currently has no special meaning defined by the specification.\n */\n metadata?: BaggageEntryMetadata;\n}\n\n/**\n * Serializable Metadata defined by the W3C baggage specification.\n * It currently has no special meaning defined by the OpenTelemetry or W3C.\n */\nexport type BaggageEntryMetadata = { toString(): string } & {\n __TYPE__: typeof baggageEntryMetadataSymbol;\n};\n\n/**\n * Baggage represents collection of key-value pairs with optional metadata.\n * Each key of Baggage is associated with exactly one value.\n * Baggage may be used to annotate and enrich telemetry data.\n */\nexport interface Baggage {\n /**\n * Get an entry from Baggage if it exists\n *\n * @param key The key which identifies the BaggageEntry\n */\n getEntry(key: string): BaggageEntry | undefined;\n\n /**\n * Get a list of all entries in the Baggage\n */\n getAllEntries(): [string, BaggageEntry][];\n\n /**\n * Returns a new baggage with the entries from the current bag and the specified entry\n *\n * @param key string which identifies the baggage entry\n * @param entry BaggageEntry for the given key\n */\n setEntry(key: string, entry: BaggageEntry): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entry\n *\n * @param key key identifying the entry to be removed\n */\n removeEntry(key: string): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entries\n *\n * @param key keys identifying the entries to be removed\n */\n removeEntries(...key: string[]): Baggage;\n\n /**\n * Returns a new baggage with no entries\n */\n clear(): Baggage;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/baggage/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { baggageEntryMetadataSymbol } from './internal/symbol';\n\n/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface BaggageEntry {\n /** `String` value of the `BaggageEntry`. */\n value: string;\n /**\n * Metadata is an optional string property defined by the W3C baggage specification.\n * It currently has no special meaning defined by the specification.\n */\n metadata?: BaggageEntryMetadata;\n}\n\n/**\n * Serializable Metadata defined by the W3C baggage specification.\n * It currently has no special meaning defined by the OpenTelemetry or W3C.\n *\n * @since 1.0.0\n */\nexport type BaggageEntryMetadata = { toString(): string } & {\n __TYPE__: typeof baggageEntryMetadataSymbol;\n};\n\n/**\n * Baggage represents collection of key-value pairs with optional metadata.\n * Each key of Baggage is associated with exactly one value.\n * Baggage may be used to annotate and enrich telemetry data.\n *\n * @since 1.0.0\n */\nexport interface Baggage {\n /**\n * Get an entry from Baggage if it exists\n *\n * @param key The key which identifies the BaggageEntry\n */\n getEntry(key: string): BaggageEntry | undefined;\n\n /**\n * Get a list of all entries in the Baggage\n */\n getAllEntries(): [string, BaggageEntry][];\n\n /**\n * Returns a new baggage with the entries from the current bag and the specified entry\n *\n * @param key string which identifies the baggage entry\n * @param entry BaggageEntry for the given key\n */\n setEntry(key: string, entry: BaggageEntry): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entry\n *\n * @param key key identifying the entry to be removed\n */\n removeEntry(key: string): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entries\n *\n * @param key keys identifying the entries to be removed\n */\n removeEntries(...key: string[]): Baggage;\n\n /**\n * Returns a new baggage with no entries\n */\n clear(): Baggage;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
1
+ import type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
2
2
  /**
3
3
  * Create a new Baggage with optional entries
4
4
  *
@@ -10,6 +10,7 @@ export declare function createBaggage(entries?: Record<string, BaggageEntry>): B
10
10
  *
11
11
  * @param str string metadata. Format is currently not defined by the spec and has no special meaning.
12
12
  *
13
+ * @since 1.0.0
13
14
  */
14
15
  export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
15
16
  //# sourceMappingURL=utils.d.ts.map
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.baggageEntryMetadataFromString = exports.createBaggage = void 0;
@@ -34,6 +23,7 @@ exports.createBaggage = createBaggage;
34
23
  *
35
24
  * @param str string metadata. Format is currently not defined by the spec and has no special meaning.
36
25
  *
26
+ * @since 1.0.0
37
27
  */
38
28
  function baggageEntryMetadataFromString(str) {
39
29
  if (typeof str !== 'string') {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sCAAsC;AACtC,0DAAsD;AACtD,8CAA+D;AAG/D,MAAM,IAAI,GAAG,cAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,0BAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAJD,sCAIC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,mCAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAhBD,wEAgBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sCAAsC;AACtC,0DAAsD;AACtD,8CAA+D;AAG/D,MAAM,IAAI,GAAG,cAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,UAAwC,EAAE;IAE1C,OAAO,IAAI,0BAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAJD,sCAIC;AAED;;;;;;GAMG;AACH,SAAgB,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,qDAAqD,OAAO,GAAG,EAAE,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,mCAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAhBD,wEAgBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport type { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}
@@ -2,6 +2,8 @@
2
2
  * Attributes is a map from string to attribute values.
3
3
  *
4
4
  * Note: only the own enumerable keys are counted as valid attribute keys.
5
+ *
6
+ * @since 1.3.0
5
7
  */
6
8
  export interface Attributes {
7
9
  [attributeKey: string]: AttributeValue | undefined;
@@ -10,6 +12,8 @@ export interface Attributes {
10
12
  * Attribute values may be any non-nullish primitive value except an object.
11
13
  *
12
14
  * null or undefined attribute values are invalid and will result in undefined behavior.
15
+ *
16
+ * @since 1.3.0
13
17
  */
14
- export declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
18
+ export type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
15
19
  //# sourceMappingURL=Attributes.d.ts.map
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=Attributes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Attributes.js","sourceRoot":"","sources":["../../../src/common/Attributes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Attributes is a map from string to attribute values.\n *\n * Note: only the own enumerable keys are counted as valid attribute keys.\n */\nexport interface Attributes {\n [attributeKey: string]: AttributeValue | undefined;\n}\n\n/**\n * Attribute values may be any non-nullish primitive value except an object.\n *\n * null or undefined attribute values are invalid and will result in undefined behavior.\n */\nexport type AttributeValue =\n | string\n | number\n | boolean\n | Array<null | undefined | string>\n | Array<null | undefined | number>\n | Array<null | undefined | boolean>;\n"]}
1
+ {"version":3,"file":"Attributes.js","sourceRoot":"","sources":["../../../src/common/Attributes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Attributes is a map from string to attribute values.\n *\n * Note: only the own enumerable keys are counted as valid attribute keys.\n *\n * @since 1.3.0\n */\nexport interface Attributes {\n [attributeKey: string]: AttributeValue | undefined;\n}\n\n/**\n * Attribute values may be any non-nullish primitive value except an object.\n *\n * null or undefined attribute values are invalid and will result in undefined behavior.\n *\n * @since 1.3.0\n */\nexport type AttributeValue =\n | string\n | number\n | boolean\n | Array<null | undefined | string>\n | Array<null | undefined | number>\n | Array<null | undefined | boolean>;\n"]}
@@ -20,7 +20,9 @@ interface ExceptionWithName {
20
20
  * Defines Exception.
21
21
  *
22
22
  * string or an object with one of (message or name or code) and optional stack
23
+ *
24
+ * @since 1.0.0
23
25
  */
24
- export declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
26
+ export type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
25
27
  export {};
26
28
  //# sourceMappingURL=Exception.d.ts.map
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=Exception.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/common/Exception.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninterface ExceptionWithCode {\n code: string | number;\n name?: string;\n message?: string;\n stack?: string;\n}\n\ninterface ExceptionWithMessage {\n code?: string | number;\n message: string;\n name?: string;\n stack?: string;\n}\n\ninterface ExceptionWithName {\n code?: string | number;\n message?: string;\n name: string;\n stack?: string;\n}\n\n/**\n * Defines Exception.\n *\n * string or an object with one of (message or name or code) and optional stack\n */\nexport type Exception =\n | ExceptionWithCode\n | ExceptionWithMessage\n | ExceptionWithName\n | string;\n"]}
1
+ {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/common/Exception.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\ninterface ExceptionWithCode {\n code: string | number;\n name?: string;\n message?: string;\n stack?: string;\n}\n\ninterface ExceptionWithMessage {\n code?: string | number;\n message: string;\n name?: string;\n stack?: string;\n}\n\ninterface ExceptionWithName {\n code?: string | number;\n message?: string;\n name: string;\n stack?: string;\n}\n\n/**\n * Defines Exception.\n *\n * string or an object with one of (message or name or code) and optional stack\n *\n * @since 1.0.0\n */\nexport type Exception =\n | ExceptionWithCode\n | ExceptionWithMessage\n | ExceptionWithName\n | string;\n"]}
@@ -9,12 +9,16 @@
9
9
  * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
10
10
  * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
11
11
  * This is represented in HrTime format as [1609504210, 150000000].
12
+ *
13
+ * @since 1.0.0
12
14
  */
13
- export declare type HrTime = [number, number];
15
+ export type HrTime = [number, number];
14
16
  /**
15
17
  * Defines TimeInput.
16
18
  *
17
19
  * hrtime, epoch milliseconds, performance.now() or Date
20
+ *
21
+ * @since 1.0.0
18
22
  */
19
- export declare type TimeInput = HrTime | number | Date;
23
+ export type TimeInput = HrTime | number | Date;
20
24
  //# sourceMappingURL=Time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../src/common/Time.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Defines High-Resolution Time.\n *\n * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n */\nexport type HrTime = [number, number];\n\n/**\n * Defines TimeInput.\n *\n * hrtime, epoch milliseconds, performance.now() or Date\n */\nexport type TimeInput = HrTime | number | Date;\n"]}
1
+ {"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../src/common/Time.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines High-Resolution Time.\n *\n * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n *\n * @since 1.0.0\n */\nexport type HrTime = [number, number];\n\n/**\n * Defines TimeInput.\n *\n * hrtime, epoch milliseconds, performance.now() or Date\n *\n * @since 1.0.0\n */\nexport type TimeInput = HrTime | number | Date;\n"]}
@@ -1,4 +1,4 @@
1
- import * as types from './types';
1
+ import type * as types from './types';
2
2
  export declare class NoopContextManager implements types.ContextManager {
3
3
  active(): types.Context;
4
4
  with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(_context: types.Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.NoopContextManager = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,uCAAyC;AAGzC,MAAa,kBAAkB;IAC7B,MAAM;QACJ,OAAO,sBAAY,CAAC;IACtB,CAAC;IAED,IAAI,CACF,QAAuB,EACvB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAI,QAAuB,EAAE,MAAS;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzBD,gDAyBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n active(): types.Context {\n return ROOT_CONTEXT;\n }\n\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n _context: types.Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return fn.call(thisArg, ...args);\n }\n\n bind<T>(_context: types.Context, target: T): T {\n return target;\n }\n\n enable(): this {\n return this;\n }\n\n disable(): this {\n return this;\n }\n}\n"]}
1
+ {"version":3,"file":"NoopContextManager.js","sourceRoot":"","sources":["../../../src/context/NoopContextManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAAyC;AAGzC,MAAa,kBAAkB;IAC7B,MAAM;QACJ,OAAO,sBAAY,CAAC;IACtB,CAAC;IAED,IAAI,CACF,QAAuB,EACvB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,CAAI,QAAuB,EAAE,MAAS;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzBD,gDAyBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport type * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n active(): types.Context {\n return ROOT_CONTEXT;\n }\n\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n _context: types.Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return fn.call(thisArg, ...args);\n }\n\n bind<T>(_context: types.Context, target: T): T {\n return target;\n }\n\n enable(): this {\n return this;\n }\n\n disable(): this {\n return this;\n }\n}\n"]}
@@ -1,6 +1,14 @@
1
- import { Context } from './types';
2
- /** Get a key to uniquely identify a context value */
1
+ import type { Context } from './types';
2
+ /**
3
+ * Get a key to uniquely identify a context value
4
+ *
5
+ * @since 1.0.0
6
+ */
3
7
  export declare function createContextKey(description: string): symbol;
4
- /** The root context is used as the default parent context when there is no active context */
8
+ /**
9
+ * The root context is used as the default parent context when there is no active context
10
+ *
11
+ * @since 1.0.0
12
+ */
5
13
  export declare const ROOT_CONTEXT: Context;
6
14
  //# sourceMappingURL=context.d.ts.map
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
  /*
3
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.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.ROOT_CONTEXT = exports.createContextKey = void 0;
19
- /** Get a key to uniquely identify a context value */
8
+ /**
9
+ * Get a key to uniquely identify a context value
10
+ *
11
+ * @since 1.0.0
12
+ */
20
13
  function createContextKey(description) {
21
14
  // The specification states that for the same input, multiple calls should
22
15
  // return different keys. Due to the nature of the JS dependency management
@@ -50,6 +43,10 @@ class BaseContext {
50
43
  };
51
44
  }
52
45
  }
53
- /** The root context is used as the default parent context when there is no active context */
46
+ /**
47
+ * The root context is used as the default parent context when there is no active context
48
+ *
49
+ * @since 1.0.0
50
+ */
54
51
  exports.ROOT_CONTEXT = new BaseContext();
55
52
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,qDAAqD;AACrD,SAAgB,gBAAgB,CAAC,WAAmB;IAClD,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AARD,4CAQC;AAED,MAAM,WAAW;IAGf;;;;OAIG;IACH,YAAY,aAAoC;QAC9C,mBAAmB;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;YACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CAyBF;AAED,6FAA6F;AAChF,QAAA,YAAY,GAAY,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Context } from './types';\n\n/** Get a key to uniquely identify a context value */\nexport function createContextKey(description: string) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\n\nclass BaseContext implements Context {\n private _currentContext!: Map<symbol, unknown>;\n\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext?: Map<symbol, unknown>) {\n // for minification\n const self = this;\n\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n self.getValue = (key: symbol) => self._currentContext.get(key);\n\n self.setValue = (key: symbol, value: unknown): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n\n self.deleteValue = (key: symbol): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n public getValue!: (key: symbol) => unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n public setValue!: (key: symbol, value: unknown) => Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n public deleteValue!: (key: symbol) => Context;\n}\n\n/** The root context is used as the default parent context when there is no active context */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/context/context.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,WAAmB;IAClD,0EAA0E;IAC1E,2EAA2E;IAC3E,wEAAwE;IACxE,mDAAmD;IACnD,EAAE;IACF,8EAA8E;IAC9E,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AARD,4CAQC;AAED,MAAM,WAAW;IAGf;;;;OAIG;IACH,YAAY,aAAoC;QAC9C,mBAAmB;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;YACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,CAAC,GAAW,EAAW,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACtD,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CAyBF;AAED;;;;GAIG;AACU,QAAA,YAAY,GAAY,IAAI,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from './types';\n\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description: string) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\n\nclass BaseContext implements Context {\n private _currentContext!: Map<symbol, unknown>;\n\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext?: Map<symbol, unknown>) {\n // for minification\n const self = this;\n\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n\n self.getValue = (key: symbol) => self._currentContext.get(key);\n\n self.setValue = (key: symbol, value: unknown): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n\n self.deleteValue = (key: symbol): Context => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n\n /**\n * Get a value from the context.\n *\n * @param key key which identifies a context value\n */\n public getValue!: (key: symbol) => unknown;\n\n /**\n * Create a new context which inherits from this context and has\n * the given key set to the given value.\n *\n * @param key context key for which to set the value\n * @param value value to set for the given key\n */\n public setValue!: (key: symbol, value: unknown) => Context;\n\n /**\n * Return a new context which inherits from this context but does\n * not contain a value for the given key.\n *\n * @param key context key for which to clear a value\n */\n public deleteValue!: (key: symbol) => Context;\n}\n\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT: Context = new BaseContext();\n"]}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
1
4
  export interface Context {
2
5
  /**
3
6
  * Get a value from the context.
@@ -21,6 +24,9 @@ export interface Context {
21
24
  */
22
25
  deleteValue(key: symbol): Context;
23
26
  }
27
+ /**
28
+ * @since 1.0.0
29
+ */
24
30
  export interface ContextManager {
25
31
  /**
26
32
  * Get the current active context