@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,17 +1,9 @@
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
4
+ */
5
+ /**
6
+ * @since 1.0.0
15
7
  */
16
8
  export var SpanKind;
17
9
  (function (SpanKind) {
@@ -1 +1 @@
1
- {"version":3,"file":"span_kind.js","sourceRoot":"","sources":["../../../src/trace/span_kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,QA6BX;AA7BD,WAAY,QAAQ;IAClB,iEAAiE;IACjE,+CAAY,CAAA;IAEZ;;;OAGG;IACH,2CAAU,CAAA;IAEV;;;OAGG;IACH,2CAAU,CAAA;IAEV;;;;OAIG;IACH,+CAAY,CAAA;IAEZ;;;;OAIG;IACH,+CAAY,CAAA;AACd,CAAC,EA7BW,QAAQ,KAAR,QAAQ,QA6BnB","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 */\nexport enum SpanKind {\n /** Default value. Indicates that the span is used internally. */\n INTERNAL = 0,\n\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SERVER = 1,\n\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n CLIENT = 2,\n\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n PRODUCER = 3,\n\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n CONSUMER = 4,\n}\n"]}
1
+ {"version":3,"file":"span_kind.js","sourceRoot":"","sources":["../../../src/trace/span_kind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,QA6BX;AA7BD,WAAY,QAAQ;IAClB,iEAAiE;IACjE,+CAAY,CAAA;IAEZ;;;OAGG;IACH,2CAAU,CAAA;IAEV;;;OAGG;IACH,2CAAU,CAAA;IAEV;;;;OAIG;IACH,+CAAY,CAAA;IAEZ;;;;OAIG;IACH,+CAAY,CAAA;AACd,CAAC,EA7BW,QAAQ,KAAR,QAAQ,QA6BnB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport enum SpanKind {\n /** Default value. Indicates that the span is used internally. */\n INTERNAL = 0,\n\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SERVER = 1,\n\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n CLIENT = 2,\n\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n PRODUCER = 3,\n\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n CONSUMER = 4,\n}\n"]}
@@ -1,10 +1,18 @@
1
- import { Span } from './span';
2
- import { SpanContext } from './span_context';
1
+ import type { Span } from './span';
2
+ import type { SpanContext } from './span_context';
3
+ /**
4
+ * @since 1.0.0
5
+ */
3
6
  export declare function isValidTraceId(traceId: string): boolean;
7
+ /**
8
+ * @since 1.0.0
9
+ */
4
10
  export declare function isValidSpanId(spanId: string): boolean;
5
11
  /**
6
12
  * Returns true if this {@link SpanContext} is valid.
7
13
  * @return true if this {@link SpanContext} is valid.
14
+ *
15
+ * @since 1.0.0
8
16
  */
9
17
  export declare function isSpanContextValid(spanContext: SpanContext): boolean;
10
18
  /**
@@ -1,31 +1,48 @@
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 { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';
17
6
  import { NonRecordingSpan } from './NonRecordingSpan';
18
- const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
19
- const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
7
+ // Valid characters (0-9, a-f, A-F) are marked as 1.
8
+ const isHex = new Uint8Array([
9
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
10
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
11
+ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
12
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
13
+ ]);
14
+ function isValidHex(id, length) {
15
+ // As of 1.9.0 the id was allowed to be a non-string value,
16
+ // even though it was not possible in the types.
17
+ if (typeof id !== 'string' || id.length !== length)
18
+ return false;
19
+ let r = 0;
20
+ for (let i = 0; i < id.length; i += 4) {
21
+ r +=
22
+ (isHex[id.charCodeAt(i)] | 0) +
23
+ (isHex[id.charCodeAt(i + 1)] | 0) +
24
+ (isHex[id.charCodeAt(i + 2)] | 0) +
25
+ (isHex[id.charCodeAt(i + 3)] | 0);
26
+ }
27
+ return r === length;
28
+ }
29
+ /**
30
+ * @since 1.0.0
31
+ */
20
32
  export function isValidTraceId(traceId) {
21
- return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
33
+ return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
22
34
  }
35
+ /**
36
+ * @since 1.0.0
37
+ */
23
38
  export function isValidSpanId(spanId) {
24
- return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
39
+ return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
25
40
  }
26
41
  /**
27
42
  * Returns true if this {@link SpanContext} is valid.
28
43
  * @return true if this {@link SpanContext} is valid.
44
+ *
45
+ * @since 1.0.0
29
46
  */
30
47
  export function isSpanContextValid(spanContext) {
31
48
  return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));
@@ -1 +1 @@
1
- {"version":3,"file":"spancontext-utils.js","sourceRoot":"","sources":["../../../src/trace/spancontext-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,eAAe,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,cAAc,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAwB;IACzD,OAAO,CACL,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CACzE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,WAAwB;IACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,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 */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\n\nconst VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nconst VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\n\nexport function isValidTraceId(traceId: string): boolean {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;\n}\n\nexport function isValidSpanId(spanId: string): boolean {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;\n}\n\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nexport function isSpanContextValid(spanContext: SpanContext): boolean {\n return (\n isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)\n );\n}\n\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext: SpanContext): Span {\n return new NonRecordingSpan(spanContext);\n}\n"]}
1
+ {"version":3,"file":"spancontext-utils.js","sourceRoot":"","sources":["../../../src/trace/spancontext-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,oDAAoD;AACpD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC;IAC3B,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC5E,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC5E,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC5E,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;CAC1E,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,EAAU,EAAE,MAAc;IAC5C,2DAA2D;IAC3D,gDAAgD;IAChD,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAEjE,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACrC,CAAC;YACC,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC7B,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACjC,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACjC,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACrC;IAED,OAAO,CAAC,KAAK,MAAM,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,KAAK,eAAe,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,KAAK,cAAc,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAwB;IACzD,OAAO,CACL,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CACzE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,WAAwB;IACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport type { Span } from './span';\nimport type { SpanContext } from './span_context';\n\n// Valid characters (0-9, a-f, A-F) are marked as 1.\nconst isHex = new Uint8Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n]);\n\nfunction isValidHex(id: string, length: number): boolean {\n // As of 1.9.0 the id was allowed to be a non-string value,\n // even though it was not possible in the types.\n if (typeof id !== 'string' || id.length !== length) return false;\n\n let r = 0;\n for (let i = 0; i < id.length; i += 4) {\n r +=\n (isHex[id.charCodeAt(i)] | 0) +\n (isHex[id.charCodeAt(i + 1)] | 0) +\n (isHex[id.charCodeAt(i + 2)] | 0) +\n (isHex[id.charCodeAt(i + 3)] | 0);\n }\n\n return r === length;\n}\n\n/**\n * @since 1.0.0\n */\nexport function isValidTraceId(traceId: string): boolean {\n return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;\n}\n\n/**\n * @since 1.0.0\n */\nexport function isValidSpanId(spanId: string): boolean {\n return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;\n}\n\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n *\n * @since 1.0.0\n */\nexport function isSpanContextValid(spanContext: SpanContext): boolean {\n return (\n isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)\n );\n}\n\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext: SpanContext): Span {\n return new NonRecordingSpan(spanContext);\n}\n"]}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
1
4
  export interface SpanStatus {
2
5
  /** The status code of this message. */
3
6
  code: SpanStatusCode;
@@ -6,6 +9,8 @@ export interface SpanStatus {
6
9
  }
7
10
  /**
8
11
  * An enumeration of status codes.
12
+ *
13
+ * @since 1.0.0
9
14
  */
10
15
  export declare enum SpanStatusCode {
11
16
  /**
@@ -1,5 +1,11 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
1
5
  /**
2
6
  * An enumeration of status codes.
7
+ *
8
+ * @since 1.0.0
3
9
  */
4
10
  export var SpanStatusCode;
5
11
  (function (SpanStatusCode) {
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/trace/status.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,CAAN,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,+CAAM,CAAA;IACN;;OAEG;IACH,qDAAS,CAAA;AACX,CAAC,EAdW,cAAc,KAAd,cAAc,QAczB","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 */\nexport interface SpanStatus {\n /** The status code of this message. */\n code: SpanStatusCode;\n /** A developer-facing error message. */\n message?: string;\n}\n\n/**\n * An enumeration of status codes.\n */\nexport enum SpanStatusCode {\n /**\n * The default status.\n */\n UNSET = 0,\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n OK = 1,\n /**\n * The operation contains an error.\n */\n ERROR = 2,\n}\n"]}
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/trace/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,+CAAM,CAAA;IACN;;OAEG;IACH,qDAAS,CAAA;AACX,CAAC,EAdW,cAAc,KAAd,cAAc,QAczB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface SpanStatus {\n /** The status code of this message. */\n code: SpanStatusCode;\n /** A developer-facing error message. */\n message?: string;\n}\n\n/**\n * An enumeration of status codes.\n *\n * @since 1.0.0\n */\nexport enum SpanStatusCode {\n /**\n * The default status.\n */\n UNSET = 0,\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n OK = 1,\n /**\n * The operation contains an error.\n */\n ERROR = 2,\n}\n"]}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
1
4
  export declare enum TraceFlags {
2
5
  /** Represents no flag set. */
3
6
  NONE = 0,
@@ -1,17 +1,9 @@
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
4
+ */
5
+ /**
6
+ * @since 1.0.0
15
7
  */
16
8
  export var TraceFlags;
17
9
  (function (TraceFlags) {
@@ -1 +1 @@
1
- {"version":3,"file":"trace_flags.js","sourceRoot":"","sources":["../../../src/trace/trace_flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAA8B;IAC9B,2CAAU,CAAA;IACV,gEAAgE;IAChE,iDAAkB,CAAA;AACpB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","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 */\nexport enum TraceFlags {\n /** Represents no flag set. */\n NONE = 0x0,\n /** Bit to represent whether trace is sampled in trace flags. */\n SAMPLED = 0x1 << 0,\n}\n"]}
1
+ {"version":3,"file":"trace_flags.js","sourceRoot":"","sources":["../../../src/trace/trace_flags.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAA8B;IAC9B,2CAAU,CAAA;IACV,gEAAgE;IAChE,iDAAkB,CAAA;AACpB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport enum TraceFlags {\n /** Represents no flag set. */\n NONE = 0x0,\n /** Bit to represent whether trace is sampled in trace flags. */\n SAMPLED = 0x1 << 0,\n}\n"]}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
1
4
  export interface TraceState {
2
5
  /**
3
6
  * Create a new TraceState which inherits from this TraceState and has the
@@ -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=trace_state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace_state.js","sourceRoot":"","sources":["../../../src/trace/trace_state.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\nexport interface TraceState {\n /**\n * Create a new TraceState which inherits from this TraceState and has the\n * given key set.\n * The new entry will always be added in the front of the list of states.\n *\n * @param key key of the TraceState entry.\n * @param value value of the TraceState entry.\n */\n set(key: string, value: string): TraceState;\n\n /**\n * Return a new TraceState which inherits from this TraceState but does not\n * contain the given key.\n *\n * @param key the key for the TraceState entry to be removed.\n */\n unset(key: string): TraceState;\n\n /**\n * Returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n *\n * @param key with which the specified value is to be associated.\n * @returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n */\n get(key: string): string | undefined;\n\n // TODO: Consider to add support for merging an object as well by also\n // accepting a single internalTraceState argument similar to the constructor.\n\n /**\n * Serializes the TraceState to a `list` as defined below. The `list` is a\n * series of `list-members` separated by commas `,`, and a list-member is a\n * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs\n * surrounding `list-members` are ignored. There can be a maximum of 32\n * `list-members` in a `list`.\n *\n * @returns the serialized string.\n */\n serialize(): string;\n}\n"]}
1
+ {"version":3,"file":"trace_state.js","sourceRoot":"","sources":["../../../src/trace/trace_state.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @since 1.0.0\n */\nexport interface TraceState {\n /**\n * Create a new TraceState which inherits from this TraceState and has the\n * given key set.\n * The new entry will always be added in the front of the list of states.\n *\n * @param key key of the TraceState entry.\n * @param value value of the TraceState entry.\n */\n set(key: string, value: string): TraceState;\n\n /**\n * Return a new TraceState which inherits from this TraceState but does not\n * contain the given key.\n *\n * @param key the key for the TraceState entry to be removed.\n */\n unset(key: string): TraceState;\n\n /**\n * Returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n *\n * @param key with which the specified value is to be associated.\n * @returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n */\n get(key: string): string | undefined;\n\n // TODO: Consider to add support for merging an object as well by also\n // accepting a single internalTraceState argument similar to the constructor.\n\n /**\n * Serializes the TraceState to a `list` as defined below. The `list` is a\n * series of `list-members` separated by commas `,`, and a list-member is a\n * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs\n * surrounding `list-members` are ignored. There can be a maximum of 32\n * `list-members` in a `list`.\n *\n * @returns the serialized string.\n */\n serialize(): string;\n}\n"]}
@@ -1,8 +1,10 @@
1
- import { Context } from '../context/types';
2
- import { Span } from './span';
3
- import { SpanOptions } from './SpanOptions';
1
+ import type { Context } from '../context/types';
2
+ import type { Span } from './span';
3
+ import type { SpanOptions } from './SpanOptions';
4
4
  /**
5
5
  * Tracer provides an interface for creating {@link Span}s.
6
+ *
7
+ * @since 1.0.0
6
8
  */
7
9
  export interface Tracer {
8
10
  /**
@@ -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=tracer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/trace/tracer.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 { Context } from '../context/types';\nimport { Span } from './span';\nimport { SpanOptions } from './SpanOptions';\n\n/**\n * Tracer provides an interface for creating {@link Span}s.\n */\nexport interface Tracer {\n /**\n * Starts a new {@link Span}. Start the span without setting it on context.\n *\n * This method do NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @returns Span The newly created span\n * @example\n * const span = tracer.startSpan('op');\n * span.setAttribute('key', 'value');\n * span.end();\n */\n startSpan(name: string, options?: SpanOptions, context?: Context): Span;\n\n /**\n * Starts a new {@link Span} and calls the given function passing it the\n * created span as first argument.\n * Additionally the new span gets set in context and this context is activated\n * for the duration of the function call.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @param fn function called in the context of the span and receives the newly created span as an argument\n * @returns return value of fn\n * @example\n * const something = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * span.setStatus({code: SpanStatusCode.OK});\n * return something;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * } finally {\n * span.end();\n * }\n * });\n *\n * @example\n * const span = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * return span;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * }\n * });\n * do some more work\n * span.end();\n */\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n}\n"]}
1
+ {"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/trace/tracer.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '../context/types';\nimport type { Span } from './span';\nimport type { SpanOptions } from './SpanOptions';\n\n/**\n * Tracer provides an interface for creating {@link Span}s.\n *\n * @since 1.0.0\n */\nexport interface Tracer {\n /**\n * Starts a new {@link Span}. Start the span without setting it on context.\n *\n * This method do NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @returns Span The newly created span\n * @example\n * const span = tracer.startSpan('op');\n * span.setAttribute('key', 'value');\n * span.end();\n */\n startSpan(name: string, options?: SpanOptions, context?: Context): Span;\n\n /**\n * Starts a new {@link Span} and calls the given function passing it the\n * created span as first argument.\n * Additionally the new span gets set in context and this context is activated\n * for the duration of the function call.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @param fn function called in the context of the span and receives the newly created span as an argument\n * @returns return value of fn\n * @example\n * const something = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * span.setStatus({code: SpanStatusCode.OK});\n * return something;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * } finally {\n * span.end();\n * }\n * });\n *\n * @example\n * const span = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * return span;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * }\n * });\n * do some more work\n * span.end();\n */\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * An interface describes additional metadata of a tracer.
3
+ *
4
+ * @since 1.3.0
3
5
  */
4
6
  export interface TracerOptions {
5
7
  /**
@@ -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=tracer_options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer_options.js","sourceRoot":"","sources":["../../../src/trace/tracer_options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An interface describes additional metadata of a tracer.\n */\nexport interface TracerOptions {\n /**\n * The schemaUrl of the tracer or instrumentation library\n */\n schemaUrl?: string;\n}\n"]}
1
+ {"version":3,"file":"tracer_options.js","sourceRoot":"","sources":["../../../src/trace/tracer_options.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * An interface describes additional metadata of a tracer.\n *\n * @since 1.3.0\n */\nexport interface TracerOptions {\n /**\n * The schemaUrl of the tracer or instrumentation library\n */\n schemaUrl?: string;\n}\n"]}
@@ -1,7 +1,9 @@
1
- import { Tracer } from './tracer';
2
- import { TracerOptions } from './tracer_options';
1
+ import type { Tracer } from './tracer';
2
+ import type { TracerOptions } from './tracer_options';
3
3
  /**
4
4
  * A registry for creating named {@link Tracer}s.
5
+ *
6
+ * @since 1.0.0
5
7
  */
6
8
  export interface TracerProvider {
7
9
  /**
@@ -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=tracer_provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracer_provider.js","sourceRoot":"","sources":["../../../src/trace/tracer_provider.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 { Tracer } from './tracer';\nimport { TracerOptions } from './tracer_options';\n\n/**\n * A registry for creating named {@link Tracer}s.\n */\nexport interface TracerProvider {\n /**\n * Returns a Tracer, creating one if one with the given name and version is\n * not already created.\n *\n * This function may return different Tracer types (e.g.\n * {@link NoopTracerProvider} vs. a functional tracer).\n *\n * @param name The name of the tracer or instrumentation library.\n * @param version The version of the tracer or instrumentation library.\n * @param options The options of the tracer or instrumentation library.\n * @returns Tracer A Tracer with the given name and version\n */\n getTracer(name: string, version?: string, options?: TracerOptions): Tracer;\n}\n"]}
1
+ {"version":3,"file":"tracer_provider.js","sourceRoot":"","sources":["../../../src/trace/tracer_provider.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Tracer } from './tracer';\nimport type { TracerOptions } from './tracer_options';\n\n/**\n * A registry for creating named {@link Tracer}s.\n *\n * @since 1.0.0\n */\nexport interface TracerProvider {\n /**\n * Returns a Tracer, creating one if one with the given name and version is\n * not already created.\n *\n * This function may return different Tracer types (e.g.\n * {@link NoopTracerProvider} vs. a functional tracer).\n *\n * @param name The name of the tracer or instrumentation library.\n * @param version The version of the tracer or instrumentation library.\n * @param options The options of the tracer or instrumentation library.\n * @returns Tracer A Tracer with the given name and version\n */\n getTracer(name: string, version?: string, options?: TracerOptions): Tracer;\n}\n"]}
@@ -1,4 +1,8 @@
1
1
  import { TraceAPI } from './api/trace';
2
- /** Entrypoint for trace API */
2
+ /**
3
+ * Entrypoint for trace API
4
+ *
5
+ * @since 1.0.0
6
+ */
3
7
  export declare const trace: TraceAPI;
4
8
  //# sourceMappingURL=trace-api.d.ts.map
@@ -1,21 +1,14 @@
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
  // Split module-level variable definition into separate files to allow
17
6
  // tree-shaking on each api instance.
18
7
  import { TraceAPI } from './api/trace';
19
- /** Entrypoint for trace API */
8
+ /**
9
+ * Entrypoint for trace API
10
+ *
11
+ * @since 1.0.0
12
+ */
20
13
  export const trace = TraceAPI.getInstance();
21
14
  //# sourceMappingURL=trace-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace-api.js","sourceRoot":"","sources":["../../src/trace-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n/** Entrypoint for trace API */\nexport const trace = TraceAPI.getInstance();\n"]}
1
+ {"version":3,"file":"trace-api.js","sourceRoot":"","sources":["../../src/trace-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n\n/**\n * Entrypoint for trace API\n *\n * @since 1.0.0\n */\nexport const trace = TraceAPI.getInstance();\n"]}
@@ -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 const 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,MAAM,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,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.ContextAPI = void 0;
@@ -23,6 +12,8 @@ const API_NAME = 'context';
23
12
  const NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager();
24
13
  /**
25
14
  * Singleton object which represents the entry point to the OpenTelemetry Context API
15
+ *
16
+ * @since 1.0.0
26
17
  */
27
18
  class ContextAPI {
28
19
  /** 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,sEAAmE;AAEnE,2DAIkC;AAClC,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,oBAAoB,GAAG,IAAI,uCAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH,MAAa,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,IAAA,6BAAc,EAAC,QAAQ,EAAE,cAAc,EAAE,cAAO,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,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,OAAO;QACZ,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAnED,gCAmEC","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,sEAAmE;AAEnE,2DAIkC;AAClC,iCAAiC;AAEjC,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,oBAAoB,GAAG,IAAI,uCAAkB,EAAE,CAAC;AAEtD;;;;GAIG;AACH,MAAa,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,IAAA,6BAAc,EAAC,QAAQ,EAAE,cAAc,EAAE,cAAO,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,IAAA,wBAAS,EAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC;IACrD,CAAC;IAED,oDAAoD;IAC7C,OAAO;QACZ,IAAI,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,CAAC;QACpC,IAAA,+BAAgB,EAAC,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAnED,gCAmEC","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,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.DiagAPI = void 0;
@@ -24,8 +13,17 @@ const API_NAME = 'diag';
24
13
  /**
25
14
  * Singleton object which represents the entry point to the OpenTelemetry internal
26
15
  * diagnostic API
16
+ *
17
+ * @since 1.0.0
27
18
  */
28
19
  class DiagAPI {
20
+ /** Get the singleton instance of the DiagAPI API */
21
+ static instance() {
22
+ if (!this._instance) {
23
+ this._instance = new DiagAPI();
24
+ }
25
+ return this._instance;
26
+ }
29
27
  /**
30
28
  * Private internal constructor
31
29
  * @private
@@ -81,13 +79,6 @@ class DiagAPI {
81
79
  self.warn = _logProxy('warn');
82
80
  self.error = _logProxy('error');
83
81
  }
84
- /** Get the singleton instance of the DiagAPI API */
85
- static instance() {
86
- if (!this._instance) {
87
- this._instance = new DiagAPI();
88
- }
89
- return this._instance;
90
- }
91
82
  }
92
83
  exports.DiagAPI = DiagAPI;
93
84
  //# sourceMappingURL=diag.js.map