@opentelemetry/api 1.8.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 +4 -4
  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 +11 -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 +85 -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 +12 -2
  95. package/build/esm/metrics/NoopMeter.js +57 -118
  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 +10 -7
  113. package/build/esm/trace/NonRecordingSpan.js +27 -35
  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 +40 -9
  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 +11 -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 +85 -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 +12 -2
  285. package/build/esnext/metrics/NoopMeter.js +13 -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 +10 -7
  303. package/build/esnext/trace/NonRecordingSpan.js +9 -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 +40 -9
  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 +11 -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 +85 -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 +12 -2
  474. package/build/src/metrics/NoopMeter.js +15 -13
  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 +10 -7
  492. package/build/src/trace/NonRecordingSpan.js +9 -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 +40 -9
  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 +21 -38
  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,2 +1,2 @@
1
- export declare const VERSION = "1.8.0";
1
+ export declare const VERSION = "1.9.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,18 +1,7 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  // this is autogenerated file, see scripts/version-update.js
17
- export var VERSION = '1.8.0';
6
+ export const VERSION = '1.9.1';
18
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.8.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.1';\n"]}
@@ -1,6 +1,8 @@
1
- import { Context, ContextManager } from '../context/types';
1
+ import type { Context, ContextManager } from '../context/types';
2
2
  /**
3
3
  * Singleton object which represents the entry point to the OpenTelemetry Context API
4
+ *
5
+ * @since 1.0.0
4
6
  */
5
7
  export declare class ContextAPI {
6
8
  private static _instance?;
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { NoopContextManager } from '../context/NoopContextManager';
17
6
  import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
@@ -20,6 +9,8 @@ const API_NAME = 'context';
20
9
  const NOOP_CONTEXT_MANAGER = new NoopContextManager();
21
10
  /**
22
11
  * Singleton object which represents the entry point to the OpenTelemetry Context API
12
+ *
13
+ * @since 1.0.0
23
14
  */
24
15
  export class ContextAPI {
25
16
  /** Empty private constructor prevents end users from constructing a new instance of the API */
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,oBAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,+FAA+F;IAC/F,gBAAuB,CAAC;IAExB,oDAAoD;IAC7C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAAC,cAA8B;QAC3D,OAAO,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;;OAOG;IACI,IAAI,CACT,OAAgB,EAChB,EAAK,EACL,OAA8B,EAC9B,GAAG,IAAO;QAEV,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACvE,CAAC;IAED;;;;;OAKG;IACI,IAAI,CAAI,OAAgB,EAAE,MAAS;QACxC,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAEO,kBAAkB;QACxB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,OAAO;QACZ,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","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 { NoopContextManager } from '../context/NoopContextManager';\nimport { Context, ContextManager } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nexport class ContextAPI {\n private static _instance?: ContextAPI;\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 Context API */\n public static getInstance(): ContextAPI {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n public setGlobalContextManager(contextManager: ContextManager): boolean {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n\n /**\n * Get the currently active context\n */\n public active(): Context {\n return this._getContextManager().active();\n }\n\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n public with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n context: Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n public bind<T>(context: Context, target: T): T {\n return this._getContextManager().bind(context, target);\n }\n\n private _getContextManager(): ContextManager {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n\n /** Disable and remove the global context manager */\n public disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/api/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EACL,SAA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pC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport type { Context, ContextManager } from '../context/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n private static _instance?: ContextAPI;\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 Context API */\n public static getInstance(): ContextAPI {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n public setGlobalContextManager(contextManager: ContextManager): boolean {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n\n /**\n * Get the currently active context\n */\n public active(): Context {\n return this._getContextManager().active();\n }\n\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n public with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n context: Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n public bind<T>(context: Context, target: T): T {\n return this._getContextManager().bind(context, target);\n }\n\n private _getContextManager(): ContextManager {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n\n /** Disable and remove the global context manager */\n public disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
@@ -1,7 +1,9 @@
1
- import { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLoggerApi } from '../diag/types';
1
+ import type { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLoggerApi } from '../diag/types';
2
2
  /**
3
3
  * Singleton object which represents the entry point to the OpenTelemetry internal
4
4
  * diagnostic API
5
+ *
6
+ * @since 1.0.0
5
7
  */
6
8
  export declare class DiagAPI implements DiagLogger, DiagLoggerApi {
7
9
  private static _instance?;
@@ -1,28 +1,26 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { DiagComponentLogger } from '../diag/ComponentLogger';
17
6
  import { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';
18
- import { DiagLogLevel, } from '../diag/types';
7
+ import { DiagLogLevel } from '../diag/types';
19
8
  import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
20
9
  const API_NAME = 'diag';
21
10
  /**
22
11
  * Singleton object which represents the entry point to the OpenTelemetry internal
23
12
  * diagnostic API
13
+ *
14
+ * @since 1.0.0
24
15
  */
25
16
  export class DiagAPI {
17
+ /** Get the singleton instance of the DiagAPI API */
18
+ static instance() {
19
+ if (!this._instance) {
20
+ this._instance = new DiagAPI();
21
+ }
22
+ return this._instance;
23
+ }
26
24
  /**
27
25
  * Private internal constructor
28
26
  * @private
@@ -78,12 +76,5 @@ export class DiagAPI {
78
76
  self.warn = _logProxy('warn');
79
77
  self.error = _logProxy('error');
80
78
  }
81
- /** Get the singleton instance of the DiagAPI API */
82
- static instance() {
83
- if (!this._instance) {
84
- this._instance = new DiagAPI();
85
- }
86
- return this._instance;
87
- }
88
79
  }
89
80
  //# sourceMappingURL=diag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diag.js","sourceRoot":"","sources":["../../../src/api/diag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAKL,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;GAGG;AACH,MAAM,OAAO,OAAO;IAYlB;;;OAGG;IACH;QACE,SAAS,SAAS,CAAC,QAA0B;YAC3C,OAAO,UAAU,GAAG,IAAI;gBACtB,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;gBACjC,6BAA6B;gBAC7B,IAAI,CAAC,MAAM;oBAAE,OAAO;gBACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YACnC,CAAC,CAAC;QACJ,CAAC;QAED,mFAAmF;QACnF,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,6BAA6B;QAE7B,MAAM,SAAS,GAA+B,CAC5C,MAAM,EACN,iBAAiB,GAAG,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,EAAE,EACnD,EAAE;;YACF,IAAI,MAAM,KAAK,IAAI,EAAE;gBACnB,mCAAmC;gBACnC,2DAA2D;gBAC3D,qFAAqF;gBACrF,MAAM,GAAG,GAAG,IAAI,KAAK,CACnB,oIAAoI,C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,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAjFD,oDAAoD;IAC7C,MAAM,CAAC,QAAQ;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;SAChC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CA+FF","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 { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport {\n ComponentLoggerOptions,\n DiagLogFunction,\n DiagLogger,\n DiagLoggerApi,\n DiagLogLevel,\n} from '../diag/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\n\nconst API_NAME = 'diag';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nexport class DiagAPI implements DiagLogger, DiagLoggerApi {\n private static _instance?: DiagAPI;\n\n /** Get the singleton instance of the DiagAPI API */\n public static instance(): DiagAPI {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Private internal constructor\n * @private\n */\n private constructor() {\n function _logProxy(funcName: keyof DiagLogger): DiagLogFunction {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) return;\n return logger[funcName](...args);\n };\n }\n\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n\n // DiagAPI specific functions\n\n const setLogger: DiagLoggerApi['setLogger'] = (\n logger,\n optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }\n ) => {\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error(\n 'Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'\n );\n self.error(err.stack ?? err.message);\n return false;\n }\n\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger(\n optionsOrLogLevel.logLevel ?? DiagLogLevel.INFO,\n logger\n );\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = new Error().stack ?? '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(\n `Current logger will overwrite one already registered from ${stack}`\n );\n }\n\n return registerGlobal('diag', newLogger, self, true);\n };\n\n self.setLogger = setLogger;\n\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n\n self.createComponentLogger = (options: ComponentLoggerOptions) => {\n return new DiagComponentLogger(options);\n };\n\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n\n public setLogger!: DiagLoggerApi['setLogger'];\n /**\n *\n */\n public createComponentLogger!: (\n options: ComponentLoggerOptions\n ) => DiagLogger;\n\n // DiagLogger implementation\n public verbose!: DiagLogFunction;\n public debug!: DiagLogFunction;\n public info!: DiagLogFunction;\n public warn!: DiagLogFunction;\n public error!: DiagLogFunction;\n\n /**\n * Unregister the global logger and return to Noop\n */\n public disable!: () => void;\n}\n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AI,CAAC,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CAqBF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport type {\n ComponentLoggerOptions,\n DiagLogFunction,\n DiagLogger,\n DiagLoggerApi,\n} from '../diag/types';\nimport { DiagLogLevel } from '../diag/types';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\n\nconst API_NAME = 'diag';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n *\n * @since 1.0.0\n */\nexport class DiagAPI implements DiagLogger, DiagLoggerApi {\n private static _instance?: DiagAPI;\n\n /** Get the singleton instance of the DiagAPI API */\n public static instance(): DiagAPI {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Private internal constructor\n * @private\n */\n private constructor() {\n function _logProxy(funcName: keyof DiagLogger): DiagLogFunction {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) return;\n return logger[funcName](...args);\n };\n }\n\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n\n // DiagAPI specific functions\n\n const setLogger: DiagLoggerApi['setLogger'] = (\n logger,\n optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }\n ) => {\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error(\n 'Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'\n );\n self.error(err.stack ?? err.message);\n return false;\n }\n\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger(\n optionsOrLogLevel.logLevel ?? DiagLogLevel.INFO,\n logger\n );\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = new Error().stack ?? '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(\n `Current logger will overwrite one already registered from ${stack}`\n );\n }\n\n return registerGlobal('diag', newLogger, self, true);\n };\n\n self.setLogger = setLogger;\n\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n\n self.createComponentLogger = (options: ComponentLoggerOptions) => {\n return new DiagComponentLogger(options);\n };\n\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n\n public setLogger!: DiagLoggerApi['setLogger'];\n /**\n *\n */\n public createComponentLogger!: (\n options: ComponentLoggerOptions\n ) => DiagLogger;\n\n // DiagLogger implementation\n public verbose!: DiagLogFunction;\n public debug!: DiagLogFunction;\n public info!: DiagLogFunction;\n public warn!: DiagLogFunction;\n public error!: DiagLogFunction;\n\n /**\n * Unregister the global logger and return to Noop\n */\n public disable!: () => void;\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { Meter, MeterOptions } from '../metrics/Meter';
2
- import { MeterProvider } from '../metrics/MeterProvider';
1
+ import type { Meter, MeterOptions } from '../metrics/Meter';
2
+ import type { MeterProvider } from '../metrics/MeterProvider';
3
3
  /**
4
4
  * Singleton object which represents the entry point to the OpenTelemetry Metrics API
5
5
  */
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';
17
6
  import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/api/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,+FAA+F;IAC/F,gBAAuB,CAAC;IAExB,oDAAoD;IAC7C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,sBAAsB,CAAC,QAAuB;QACnD,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,QAAQ,CACb,IAAY,EACZ,OAAgB,EAChB,OAAsB;QAEtB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,uCAAuC;IAChC,OAAO;QACZ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","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 { Meter, MeterOptions } from '../metrics/Meter';\nimport { MeterProvider } from '../metrics/MeterProvider';\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'metrics';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nexport class MetricsAPI {\n private static _instance?: MetricsAPI;\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 Metrics API */\n public static getInstance(): MetricsAPI {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n public setGlobalMeterProvider(provider: MeterProvider): boolean {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n }\n\n /**\n * Returns the global meter provider.\n */\n public getMeterProvider(): MeterProvider {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n }\n\n /**\n * Returns a meter from the global meter provider.\n */\n public getMeter(\n name: string,\n version?: string,\n options?: MeterOptions\n ): Meter {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n\n /** Remove the global meter provider */\n public disable(): void {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/api/metrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAE3B;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB,+FAA+F;IAC/F,gBAAuB,CAAC;IAExB,oDAAoD;IAC7C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,EAAE,CAAC;SACnC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,sBAAsB,CAAC,QAAuB;QACnD,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,QAAQ,CACb,IAAY,EACZ,OAAgB,EAChB,OAAsB;QAEtB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,uCAAuC;IAChC,OAAO;QACZ,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from '../metrics/Meter';\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'metrics';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nexport class MetricsAPI {\n private static _instance?: MetricsAPI;\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 Metrics API */\n public static getInstance(): MetricsAPI {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n public setGlobalMeterProvider(provider: MeterProvider): boolean {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n }\n\n /**\n * Returns the global meter provider.\n */\n public getMeterProvider(): MeterProvider {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n }\n\n /**\n * Returns a meter from the global meter provider.\n */\n public getMeter(\n name: string,\n version?: string,\n options?: MeterOptions\n ): Meter {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n\n /** Remove the global meter provider */\n public disable(): void {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n"]}
@@ -1,9 +1,11 @@
1
- import { Context } from '../context/types';
2
- import { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
1
+ import type { Context } from '../context/types';
2
+ import type { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
3
3
  import { getBaggage, getActiveBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers';
4
4
  import { createBaggage } from '../baggage/utils';
5
5
  /**
6
6
  * Singleton object which represents the entry point to the OpenTelemetry Propagation API
7
+ *
8
+ * @since 1.0.0
7
9
  */
8
10
  export declare class PropagationAPI {
9
11
  private static _instance?;
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
17
6
  import { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';
@@ -23,6 +12,8 @@ const API_NAME = 'propagation';
23
12
  const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
24
13
  /**
25
14
  * Singleton object which represents the entry point to the OpenTelemetry Propagation API
15
+ *
16
+ * @since 1.0.0
26
17
  */
27
18
  export class PropagationAPI {
28
19
  /** Empty private constructor prevents end users from constructing a new instance of the API */
@@ -1 +1 @@
1
- {"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../src/api/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAIrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,MAAM,wBAAwB,GAAG,IAA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AAC;IACzD,CAAC;CACF","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,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAM7E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,aAAa,CAAC;AAC/B,MAAM,wBAAwB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAE7D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAGzB,+FAA+F;IA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-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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';
17
6
  import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
@@ -21,6 +10,8 @@ import { DiagAPI } from './diag';
21
10
  const API_NAME = 'trace';
22
11
  /**
23
12
  * Singleton object which represents the entry point to the OpenTelemetry Tracing API
13
+ *
14
+ * @since 1.0.0
24
15
  */
25
16
  export class TraceAPI {
26
17
  /** 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,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;GAEG;AACH,MAAM,OAAO,QAAQ;IAKnB,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAmDlD,oBAAe,GAAG,eAAe,CAAC;QAElC,uBAAkB,GAAG,kBAAkB,CAAC;QAExC,eAAU,GAAG,UAAU,CAAC;QAExB,YAAO,GAAG,OAAO,CAAC;QAElB,kBAAa,GAAG,aAAa,CAAC;QAE9B,mBAAc,GAAG,cAAc,CAAC;QAEhC,YAAO,GAAG,OAAO,CAAC;QAElB,mBAAc,GAAG,cAAc,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,cAAc,CAC5B,QAAQ,EACR,IAAI,CAAC,oBAAoB,EACzB,OAAO,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,SAAS,CAAC,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,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACxD,CAAC;CAiBF","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,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,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;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,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACxD,CAAC;CAiBF","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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { ContextAPI } from '../api/context';
17
6
  import { createContextKey } from '../context/context';
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC","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,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC","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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export class BaggageImpl {
17
6
  constructor(entries) {
@@ -25,7 +14,7 @@ export class BaggageImpl {
25
14
  return Object.assign({}, entry);
26
15
  }
27
16
  getAllEntries() {
28
- return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);
17
+ return Array.from(this._entries.entries());
29
18
  }
30
19
  setEntry(key, entry) {
31
20
  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,MAAM,OAAO,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","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 Ba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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","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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  /**
17
6
  * Symbol used to make BaggageEntryMetadata an opaque type
@@ -1 +1 @@
1
- {"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,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;AACH,MAAM,CAAC,MAAM,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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export {};
17
6
  //# 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,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { DiagAPI } from '../api/diag';
17
6
  import { BaggageImpl } from './internal/baggage-impl';
@@ -30,6 +19,7 @@ export function createBaggage(entries = {}) {
30
19
  *
31
20
  * @param str string metadata. Format is currently not defined by the spec and has no special meaning.
32
21
  *
22
+ * @since 1.0.0
33
23
  */
34
24
  export function baggageEntryMetadataFromString(str) {
35
25
  if (typeof str !== 'string') {