@opentelemetry/api 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (625) hide show
  1. package/README.md +3 -2
  2. package/build/esm/api/context.d.ts +3 -1
  3. package/build/esm/api/context.js +23 -65
  4. package/build/esm/api/context.js.map +1 -1
  5. package/build/esm/api/diag.d.ts +3 -1
  6. package/build/esm/api/diag.js +28 -69
  7. package/build/esm/api/diag.js.map +1 -1
  8. package/build/esm/api/metrics.d.ts +2 -2
  9. package/build/esm/api/metrics.js +15 -29
  10. package/build/esm/api/metrics.js.map +1 -1
  11. package/build/esm/api/propagation.d.ts +4 -2
  12. package/build/esm/api/propagation.js +22 -35
  13. package/build/esm/api/propagation.js.map +1 -1
  14. package/build/esm/api/trace.d.ts +4 -2
  15. package/build/esm/api/trace.js +18 -29
  16. package/build/esm/api/trace.js.map +1 -1
  17. package/build/esm/baggage/context-helpers.d.ts +2 -2
  18. package/build/esm/baggage/context-helpers.js +2 -13
  19. package/build/esm/baggage/context-helpers.js.map +1 -1
  20. package/build/esm/baggage/internal/baggage-impl.js +23 -81
  21. package/build/esm/baggage/internal/baggage-impl.js.map +1 -1
  22. package/build/esm/baggage/internal/symbol.js +2 -13
  23. package/build/esm/baggage/internal/symbol.js.map +1 -1
  24. package/build/esm/baggage/types.d.ts +9 -2
  25. package/build/esm/baggage/types.js +1 -12
  26. package/build/esm/baggage/types.js.map +1 -1
  27. package/build/esm/baggage/utils.d.ts +2 -1
  28. package/build/esm/baggage/utils.js +6 -17
  29. package/build/esm/baggage/utils.js.map +1 -1
  30. package/build/esm/common/Attributes.d.ts +5 -1
  31. package/build/esm/common/Attributes.js +1 -12
  32. package/build/esm/common/Attributes.js.map +1 -1
  33. package/build/esm/common/Exception.d.ts +3 -1
  34. package/build/esm/common/Exception.js +1 -12
  35. package/build/esm/common/Exception.js.map +1 -1
  36. package/build/esm/common/Time.d.ts +6 -2
  37. package/build/esm/common/Time.js.map +1 -1
  38. package/build/esm/context/NoopContextManager.d.ts +1 -1
  39. package/build/esm/context/NoopContextManager.js +14 -58
  40. package/build/esm/context/NoopContextManager.js.map +1 -1
  41. package/build/esm/context/context.d.ts +11 -3
  42. package/build/esm/context/context.js +20 -24
  43. package/build/esm/context/context.js.map +1 -1
  44. package/build/esm/context/types.d.ts +6 -0
  45. package/build/esm/context/types.js +1 -12
  46. package/build/esm/context/types.js.map +1 -1
  47. package/build/esm/context-api.d.ts +4 -1
  48. package/build/esm/context-api.js +6 -14
  49. package/build/esm/context-api.js.map +1 -1
  50. package/build/esm/diag/ComponentLogger.d.ts +6 -6
  51. package/build/esm/diag/ComponentLogger.js +16 -75
  52. package/build/esm/diag/ComponentLogger.js.map +1 -1
  53. package/build/esm/diag/consoleLogger.d.ts +6 -1
  54. package/build/esm/diag/consoleLogger.js +41 -31
  55. package/build/esm/diag/consoleLogger.js.map +1 -1
  56. package/build/esm/diag/internal/logLevelLogger.d.ts +2 -1
  57. package/build/esm/diag/internal/logLevelLogger.js +2 -13
  58. package/build/esm/diag/internal/logLevelLogger.js.map +1 -1
  59. package/build/esm/diag/internal/noopLogger.d.ts +1 -1
  60. package/build/esm/diag/internal/noopLogger.js +1 -12
  61. package/build/esm/diag/internal/noopLogger.js.map +1 -1
  62. package/build/esm/diag/types.d.ts +11 -1
  63. package/build/esm/diag/types.js +1 -12
  64. package/build/esm/diag/types.js.map +1 -1
  65. package/build/esm/diag-api.d.ts +2 -0
  66. package/build/esm/diag-api.js +4 -13
  67. package/build/esm/diag-api.js.map +1 -1
  68. package/build/esm/experimental/index.d.ts +5 -1
  69. package/build/esm/experimental/index.js +5 -12
  70. package/build/esm/experimental/index.js.map +1 -1
  71. package/build/esm/experimental/trace/SugaredOptions.d.ts +1 -1
  72. package/build/esm/experimental/trace/SugaredOptions.js +1 -12
  73. package/build/esm/experimental/trace/SugaredOptions.js.map +1 -1
  74. package/build/esm/experimental/trace/SugaredTracer.d.ts +2 -2
  75. package/build/esm/experimental/trace/SugaredTracer.js +22 -26
  76. package/build/esm/experimental/trace/SugaredTracer.js.map +1 -1
  77. package/build/esm/index.d.ts +29 -24
  78. package/build/esm/index.js +9 -19
  79. package/build/esm/index.js.map +1 -1
  80. package/build/esm/internal/global-utils.d.ts +5 -5
  81. package/build/esm/internal/global-utils.js +20 -25
  82. package/build/esm/internal/global-utils.js.map +1 -1
  83. package/build/esm/internal/semver.js +10 -21
  84. package/build/esm/internal/semver.js.map +1 -1
  85. package/build/esm/metrics/Meter.d.ts +5 -1
  86. package/build/esm/metrics/Meter.js +1 -12
  87. package/build/esm/metrics/Meter.js.map +1 -1
  88. package/build/esm/metrics/MeterProvider.d.ts +3 -1
  89. package/build/esm/metrics/MeterProvider.js +1 -12
  90. package/build/esm/metrics/MeterProvider.js.map +1 -1
  91. package/build/esm/metrics/Metric.d.ts +79 -11
  92. package/build/esm/metrics/Metric.js +5 -12
  93. package/build/esm/metrics/Metric.js.map +1 -1
  94. package/build/esm/metrics/NoopMeter.d.ts +4 -2
  95. package/build/esm/metrics/NoopMeter.js +54 -131
  96. package/build/esm/metrics/NoopMeter.js.map +1 -1
  97. package/build/esm/metrics/NoopMeterProvider.d.ts +2 -2
  98. package/build/esm/metrics/NoopMeterProvider.js +6 -21
  99. package/build/esm/metrics/NoopMeterProvider.js.map +1 -1
  100. package/build/esm/metrics-api.d.ts +5 -1
  101. package/build/esm/metrics-api.js +7 -14
  102. package/build/esm/metrics-api.js.map +1 -1
  103. package/build/esm/propagation/NoopTextMapPropagator.d.ts +2 -2
  104. package/build/esm/propagation/NoopTextMapPropagator.js +8 -23
  105. package/build/esm/propagation/NoopTextMapPropagator.js.map +1 -1
  106. package/build/esm/propagation/TextMapPropagator.d.ts +14 -2
  107. package/build/esm/propagation/TextMapPropagator.js +12 -17
  108. package/build/esm/propagation/TextMapPropagator.js.map +1 -1
  109. package/build/esm/propagation-api.d.ts +5 -1
  110. package/build/esm/propagation-api.js +7 -14
  111. package/build/esm/propagation-api.js.map +1 -1
  112. package/build/esm/trace/NonRecordingSpan.d.ts +8 -8
  113. package/build/esm/trace/NonRecordingSpan.js +25 -39
  114. package/build/esm/trace/NonRecordingSpan.js.map +1 -1
  115. package/build/esm/trace/NoopTracer.d.ts +4 -4
  116. package/build/esm/trace/NoopTracer.js +21 -33
  117. package/build/esm/trace/NoopTracer.js.map +1 -1
  118. package/build/esm/trace/NoopTracerProvider.d.ts +3 -3
  119. package/build/esm/trace/NoopTracerProvider.js +5 -20
  120. package/build/esm/trace/NoopTracerProvider.js.map +1 -1
  121. package/build/esm/trace/ProxyTracer.d.ts +14 -9
  122. package/build/esm/trace/ProxyTracer.js +16 -27
  123. package/build/esm/trace/ProxyTracer.js.map +1 -1
  124. package/build/esm/trace/ProxyTracerProvider.d.ts +6 -3
  125. package/build/esm/trace/ProxyTracerProvider.js +15 -27
  126. package/build/esm/trace/ProxyTracerProvider.js.map +1 -1
  127. package/build/esm/trace/Sampler.d.ts +7 -5
  128. package/build/esm/trace/Sampler.js +1 -12
  129. package/build/esm/trace/Sampler.js.map +1 -1
  130. package/build/esm/trace/SamplingResult.d.ts +6 -2
  131. package/build/esm/trace/SamplingResult.js +3 -12
  132. package/build/esm/trace/SamplingResult.js.map +1 -1
  133. package/build/esm/trace/SpanOptions.d.ts +7 -5
  134. package/build/esm/trace/SpanOptions.js +1 -12
  135. package/build/esm/trace/SpanOptions.js.map +1 -1
  136. package/build/esm/trace/attributes.d.ts +5 -3
  137. package/build/esm/trace/attributes.js +1 -12
  138. package/build/esm/trace/attributes.js.map +1 -1
  139. package/build/esm/trace/context-utils.d.ts +3 -3
  140. package/build/esm/trace/context-utils.js +2 -13
  141. package/build/esm/trace/context-utils.js.map +1 -1
  142. package/build/esm/trace/internal/tracestate-impl.d.ts +1 -1
  143. package/build/esm/trace/internal/tracestate-impl.js +37 -49
  144. package/build/esm/trace/internal/tracestate-impl.js.map +1 -1
  145. package/build/esm/trace/internal/tracestate-validators.js +7 -18
  146. package/build/esm/trace/internal/tracestate-validators.js.map +1 -1
  147. package/build/esm/trace/internal/utils.d.ts +4 -1
  148. package/build/esm/trace/internal/utils.js +4 -12
  149. package/build/esm/trace/internal/utils.js.map +1 -1
  150. package/build/esm/trace/invalid-span-constants.d.ts +10 -1
  151. package/build/esm/trace/invalid-span-constants.js +13 -15
  152. package/build/esm/trace/invalid-span-constants.js.map +1 -1
  153. package/build/esm/trace/link.d.ts +4 -2
  154. package/build/esm/trace/link.js +1 -12
  155. package/build/esm/trace/link.js.map +1 -1
  156. package/build/esm/trace/span.d.ts +22 -10
  157. package/build/esm/trace/span.js +1 -12
  158. package/build/esm/trace/span.js.map +1 -1
  159. package/build/esm/trace/span_context.d.ts +3 -1
  160. package/build/esm/trace/span_context.js +1 -12
  161. package/build/esm/trace/span_context.js.map +1 -1
  162. package/build/esm/trace/span_kind.d.ts +3 -0
  163. package/build/esm/trace/span_kind.js +4 -12
  164. package/build/esm/trace/span_kind.js.map +1 -1
  165. package/build/esm/trace/spancontext-utils.d.ts +10 -2
  166. package/build/esm/trace/spancontext-utils.js +33 -16
  167. package/build/esm/trace/spancontext-utils.js.map +1 -1
  168. package/build/esm/trace/status.d.ts +5 -0
  169. package/build/esm/trace/status.js +6 -0
  170. package/build/esm/trace/status.js.map +1 -1
  171. package/build/esm/trace/trace_flags.d.ts +3 -0
  172. package/build/esm/trace/trace_flags.js +4 -12
  173. package/build/esm/trace/trace_flags.js.map +1 -1
  174. package/build/esm/trace/trace_state.d.ts +3 -0
  175. package/build/esm/trace/trace_state.js +1 -12
  176. package/build/esm/trace/trace_state.js.map +1 -1
  177. package/build/esm/trace/tracer.d.ts +5 -3
  178. package/build/esm/trace/tracer.js +1 -12
  179. package/build/esm/trace/tracer.js.map +1 -1
  180. package/build/esm/trace/tracer_options.d.ts +2 -0
  181. package/build/esm/trace/tracer_options.js +1 -12
  182. package/build/esm/trace/tracer_options.js.map +1 -1
  183. package/build/esm/trace/tracer_provider.d.ts +4 -2
  184. package/build/esm/trace/tracer_provider.js +1 -12
  185. package/build/esm/trace/tracer_provider.js.map +1 -1
  186. package/build/esm/trace-api.d.ts +5 -1
  187. package/build/esm/trace-api.js +7 -14
  188. package/build/esm/trace-api.js.map +1 -1
  189. package/build/esm/version.d.ts +1 -1
  190. package/build/esm/version.js +2 -13
  191. package/build/esm/version.js.map +1 -1
  192. package/build/esnext/api/context.d.ts +3 -1
  193. package/build/esnext/api/context.js +3 -12
  194. package/build/esnext/api/context.js.map +1 -1
  195. package/build/esnext/api/diag.d.ts +3 -1
  196. package/build/esnext/api/diag.js +11 -20
  197. package/build/esnext/api/diag.js.map +1 -1
  198. package/build/esnext/api/metrics.d.ts +2 -2
  199. package/build/esnext/api/metrics.js +1 -12
  200. package/build/esnext/api/metrics.js.map +1 -1
  201. package/build/esnext/api/propagation.d.ts +4 -2
  202. package/build/esnext/api/propagation.js +3 -12
  203. package/build/esnext/api/propagation.js.map +1 -1
  204. package/build/esnext/api/trace.d.ts +4 -2
  205. package/build/esnext/api/trace.js +3 -12
  206. package/build/esnext/api/trace.js.map +1 -1
  207. package/build/esnext/baggage/context-helpers.d.ts +2 -2
  208. package/build/esnext/baggage/context-helpers.js +1 -12
  209. package/build/esnext/baggage/context-helpers.js.map +1 -1
  210. package/build/esnext/baggage/internal/baggage-impl.js +2 -13
  211. package/build/esnext/baggage/internal/baggage-impl.js.map +1 -1
  212. package/build/esnext/baggage/internal/symbol.js +1 -12
  213. package/build/esnext/baggage/internal/symbol.js.map +1 -1
  214. package/build/esnext/baggage/types.d.ts +9 -2
  215. package/build/esnext/baggage/types.js +1 -12
  216. package/build/esnext/baggage/types.js.map +1 -1
  217. package/build/esnext/baggage/utils.d.ts +2 -1
  218. package/build/esnext/baggage/utils.js +2 -12
  219. package/build/esnext/baggage/utils.js.map +1 -1
  220. package/build/esnext/common/Attributes.d.ts +5 -1
  221. package/build/esnext/common/Attributes.js +1 -12
  222. package/build/esnext/common/Attributes.js.map +1 -1
  223. package/build/esnext/common/Exception.d.ts +3 -1
  224. package/build/esnext/common/Exception.js +1 -12
  225. package/build/esnext/common/Exception.js.map +1 -1
  226. package/build/esnext/common/Time.d.ts +6 -2
  227. package/build/esnext/common/Time.js.map +1 -1
  228. package/build/esnext/context/NoopContextManager.d.ts +1 -1
  229. package/build/esnext/context/NoopContextManager.js +1 -12
  230. package/build/esnext/context/NoopContextManager.js.map +1 -1
  231. package/build/esnext/context/context.d.ts +11 -3
  232. package/build/esnext/context/context.js +10 -13
  233. package/build/esnext/context/context.js.map +1 -1
  234. package/build/esnext/context/types.d.ts +6 -0
  235. package/build/esnext/context/types.js +1 -12
  236. package/build/esnext/context/types.js.map +1 -1
  237. package/build/esnext/context-api.d.ts +4 -1
  238. package/build/esnext/context-api.js +5 -13
  239. package/build/esnext/context-api.js.map +1 -1
  240. package/build/esnext/diag/ComponentLogger.d.ts +6 -6
  241. package/build/esnext/diag/ComponentLogger.js +2 -14
  242. package/build/esnext/diag/ComponentLogger.js.map +1 -1
  243. package/build/esnext/diag/consoleLogger.d.ts +6 -1
  244. package/build/esnext/diag/consoleLogger.js +36 -20
  245. package/build/esnext/diag/consoleLogger.js.map +1 -1
  246. package/build/esnext/diag/internal/logLevelLogger.d.ts +2 -1
  247. package/build/esnext/diag/internal/logLevelLogger.js +1 -12
  248. package/build/esnext/diag/internal/logLevelLogger.js.map +1 -1
  249. package/build/esnext/diag/internal/noopLogger.d.ts +1 -1
  250. package/build/esnext/diag/internal/noopLogger.js +1 -12
  251. package/build/esnext/diag/internal/noopLogger.js.map +1 -1
  252. package/build/esnext/diag/types.d.ts +11 -1
  253. package/build/esnext/diag/types.js +1 -12
  254. package/build/esnext/diag/types.js.map +1 -1
  255. package/build/esnext/diag-api.d.ts +2 -0
  256. package/build/esnext/diag-api.js +3 -12
  257. package/build/esnext/diag-api.js.map +1 -1
  258. package/build/esnext/experimental/index.d.ts +5 -1
  259. package/build/esnext/experimental/index.js +5 -12
  260. package/build/esnext/experimental/index.js.map +1 -1
  261. package/build/esnext/experimental/trace/SugaredOptions.d.ts +1 -1
  262. package/build/esnext/experimental/trace/SugaredOptions.js +1 -12
  263. package/build/esnext/experimental/trace/SugaredOptions.js.map +1 -1
  264. package/build/esnext/experimental/trace/SugaredTracer.d.ts +2 -2
  265. package/build/esnext/experimental/trace/SugaredTracer.js +2 -2
  266. package/build/esnext/experimental/trace/SugaredTracer.js.map +1 -1
  267. package/build/esnext/index.d.ts +29 -24
  268. package/build/esnext/index.js +4 -14
  269. package/build/esnext/index.js.map +1 -1
  270. package/build/esnext/internal/global-utils.d.ts +5 -5
  271. package/build/esnext/internal/global-utils.js +10 -14
  272. package/build/esnext/internal/global-utils.js.map +1 -1
  273. package/build/esnext/internal/semver.js +1 -12
  274. package/build/esnext/internal/semver.js.map +1 -1
  275. package/build/esnext/metrics/Meter.d.ts +5 -1
  276. package/build/esnext/metrics/Meter.js +1 -12
  277. package/build/esnext/metrics/Meter.js.map +1 -1
  278. package/build/esnext/metrics/MeterProvider.d.ts +3 -1
  279. package/build/esnext/metrics/MeterProvider.js +1 -12
  280. package/build/esnext/metrics/MeterProvider.js.map +1 -1
  281. package/build/esnext/metrics/Metric.d.ts +79 -11
  282. package/build/esnext/metrics/Metric.js +5 -12
  283. package/build/esnext/metrics/Metric.js.map +1 -1
  284. package/build/esnext/metrics/NoopMeter.d.ts +4 -2
  285. package/build/esnext/metrics/NoopMeter.js +3 -12
  286. package/build/esnext/metrics/NoopMeter.js.map +1 -1
  287. package/build/esnext/metrics/NoopMeterProvider.d.ts +2 -2
  288. package/build/esnext/metrics/NoopMeterProvider.js +1 -12
  289. package/build/esnext/metrics/NoopMeterProvider.js.map +1 -1
  290. package/build/esnext/metrics-api.d.ts +5 -1
  291. package/build/esnext/metrics-api.js +6 -13
  292. package/build/esnext/metrics-api.js.map +1 -1
  293. package/build/esnext/propagation/NoopTextMapPropagator.d.ts +2 -2
  294. package/build/esnext/propagation/NoopTextMapPropagator.js +1 -12
  295. package/build/esnext/propagation/NoopTextMapPropagator.js.map +1 -1
  296. package/build/esnext/propagation/TextMapPropagator.d.ts +14 -2
  297. package/build/esnext/propagation/TextMapPropagator.js +7 -12
  298. package/build/esnext/propagation/TextMapPropagator.js.map +1 -1
  299. package/build/esnext/propagation-api.d.ts +5 -1
  300. package/build/esnext/propagation-api.js +6 -13
  301. package/build/esnext/propagation-api.js.map +1 -1
  302. package/build/esnext/trace/NonRecordingSpan.d.ts +8 -8
  303. package/build/esnext/trace/NonRecordingSpan.js +3 -14
  304. package/build/esnext/trace/NonRecordingSpan.js.map +1 -1
  305. package/build/esnext/trace/NoopTracer.d.ts +4 -4
  306. package/build/esnext/trace/NoopTracer.js +6 -13
  307. package/build/esnext/trace/NoopTracer.js.map +1 -1
  308. package/build/esnext/trace/NoopTracerProvider.d.ts +3 -3
  309. package/build/esnext/trace/NoopTracerProvider.js +1 -12
  310. package/build/esnext/trace/NoopTracerProvider.js.map +1 -1
  311. package/build/esnext/trace/ProxyTracer.d.ts +14 -9
  312. package/build/esnext/trace/ProxyTracer.js +5 -14
  313. package/build/esnext/trace/ProxyTracer.js.map +1 -1
  314. package/build/esnext/trace/ProxyTracerProvider.d.ts +6 -3
  315. package/build/esnext/trace/ProxyTracerProvider.js +4 -12
  316. package/build/esnext/trace/ProxyTracerProvider.js.map +1 -1
  317. package/build/esnext/trace/Sampler.d.ts +7 -5
  318. package/build/esnext/trace/Sampler.js +1 -12
  319. package/build/esnext/trace/Sampler.js.map +1 -1
  320. package/build/esnext/trace/SamplingResult.d.ts +6 -2
  321. package/build/esnext/trace/SamplingResult.js +3 -12
  322. package/build/esnext/trace/SamplingResult.js.map +1 -1
  323. package/build/esnext/trace/SpanOptions.d.ts +7 -5
  324. package/build/esnext/trace/SpanOptions.js +1 -12
  325. package/build/esnext/trace/SpanOptions.js.map +1 -1
  326. package/build/esnext/trace/attributes.d.ts +5 -3
  327. package/build/esnext/trace/attributes.js +1 -12
  328. package/build/esnext/trace/attributes.js.map +1 -1
  329. package/build/esnext/trace/context-utils.d.ts +3 -3
  330. package/build/esnext/trace/context-utils.js +1 -12
  331. package/build/esnext/trace/context-utils.js.map +1 -1
  332. package/build/esnext/trace/internal/tracestate-impl.d.ts +1 -1
  333. package/build/esnext/trace/internal/tracestate-impl.js +8 -17
  334. package/build/esnext/trace/internal/tracestate-impl.js.map +1 -1
  335. package/build/esnext/trace/internal/tracestate-validators.js +1 -12
  336. package/build/esnext/trace/internal/tracestate-validators.js.map +1 -1
  337. package/build/esnext/trace/internal/utils.d.ts +4 -1
  338. package/build/esnext/trace/internal/utils.js +4 -12
  339. package/build/esnext/trace/internal/utils.js.map +1 -1
  340. package/build/esnext/trace/invalid-span-constants.d.ts +10 -1
  341. package/build/esnext/trace/invalid-span-constants.js +10 -12
  342. package/build/esnext/trace/invalid-span-constants.js.map +1 -1
  343. package/build/esnext/trace/link.d.ts +4 -2
  344. package/build/esnext/trace/link.js +1 -12
  345. package/build/esnext/trace/link.js.map +1 -1
  346. package/build/esnext/trace/span.d.ts +22 -10
  347. package/build/esnext/trace/span.js +1 -12
  348. package/build/esnext/trace/span.js.map +1 -1
  349. package/build/esnext/trace/span_context.d.ts +3 -1
  350. package/build/esnext/trace/span_context.js +1 -12
  351. package/build/esnext/trace/span_context.js.map +1 -1
  352. package/build/esnext/trace/span_kind.d.ts +3 -0
  353. package/build/esnext/trace/span_kind.js +4 -12
  354. package/build/esnext/trace/span_kind.js.map +1 -1
  355. package/build/esnext/trace/spancontext-utils.d.ts +10 -2
  356. package/build/esnext/trace/spancontext-utils.js +33 -16
  357. package/build/esnext/trace/spancontext-utils.js.map +1 -1
  358. package/build/esnext/trace/status.d.ts +5 -0
  359. package/build/esnext/trace/status.js +6 -0
  360. package/build/esnext/trace/status.js.map +1 -1
  361. package/build/esnext/trace/trace_flags.d.ts +3 -0
  362. package/build/esnext/trace/trace_flags.js +4 -12
  363. package/build/esnext/trace/trace_flags.js.map +1 -1
  364. package/build/esnext/trace/trace_state.d.ts +3 -0
  365. package/build/esnext/trace/trace_state.js +1 -12
  366. package/build/esnext/trace/trace_state.js.map +1 -1
  367. package/build/esnext/trace/tracer.d.ts +5 -3
  368. package/build/esnext/trace/tracer.js +1 -12
  369. package/build/esnext/trace/tracer.js.map +1 -1
  370. package/build/esnext/trace/tracer_options.d.ts +2 -0
  371. package/build/esnext/trace/tracer_options.js +1 -12
  372. package/build/esnext/trace/tracer_options.js.map +1 -1
  373. package/build/esnext/trace/tracer_provider.d.ts +4 -2
  374. package/build/esnext/trace/tracer_provider.js +1 -12
  375. package/build/esnext/trace/tracer_provider.js.map +1 -1
  376. package/build/esnext/trace-api.d.ts +5 -1
  377. package/build/esnext/trace-api.js +6 -13
  378. package/build/esnext/trace-api.js.map +1 -1
  379. package/build/esnext/version.d.ts +1 -1
  380. package/build/esnext/version.js +2 -13
  381. package/build/esnext/version.js.map +1 -1
  382. package/build/src/api/context.d.ts +3 -1
  383. package/build/src/api/context.js +3 -12
  384. package/build/src/api/context.js.map +1 -1
  385. package/build/src/api/diag.d.ts +3 -1
  386. package/build/src/api/diag.js +10 -19
  387. package/build/src/api/diag.js.map +1 -1
  388. package/build/src/api/metrics.d.ts +2 -2
  389. package/build/src/api/metrics.js +1 -12
  390. package/build/src/api/metrics.js.map +1 -1
  391. package/build/src/api/propagation.d.ts +4 -2
  392. package/build/src/api/propagation.js +3 -12
  393. package/build/src/api/propagation.js.map +1 -1
  394. package/build/src/api/trace.d.ts +4 -2
  395. package/build/src/api/trace.js +3 -12
  396. package/build/src/api/trace.js.map +1 -1
  397. package/build/src/baggage/context-helpers.d.ts +2 -2
  398. package/build/src/baggage/context-helpers.js +1 -12
  399. package/build/src/baggage/context-helpers.js.map +1 -1
  400. package/build/src/baggage/internal/baggage-impl.js +2 -13
  401. package/build/src/baggage/internal/baggage-impl.js.map +1 -1
  402. package/build/src/baggage/internal/symbol.js +1 -12
  403. package/build/src/baggage/internal/symbol.js.map +1 -1
  404. package/build/src/baggage/types.d.ts +9 -2
  405. package/build/src/baggage/types.js +1 -12
  406. package/build/src/baggage/types.js.map +1 -1
  407. package/build/src/baggage/utils.d.ts +2 -1
  408. package/build/src/baggage/utils.js +2 -12
  409. package/build/src/baggage/utils.js.map +1 -1
  410. package/build/src/common/Attributes.d.ts +5 -1
  411. package/build/src/common/Attributes.js +1 -12
  412. package/build/src/common/Attributes.js.map +1 -1
  413. package/build/src/common/Exception.d.ts +3 -1
  414. package/build/src/common/Exception.js +1 -12
  415. package/build/src/common/Exception.js.map +1 -1
  416. package/build/src/common/Time.d.ts +6 -2
  417. package/build/src/common/Time.js.map +1 -1
  418. package/build/src/context/NoopContextManager.d.ts +1 -1
  419. package/build/src/context/NoopContextManager.js +1 -12
  420. package/build/src/context/NoopContextManager.js.map +1 -1
  421. package/build/src/context/context.d.ts +11 -3
  422. package/build/src/context/context.js +11 -14
  423. package/build/src/context/context.js.map +1 -1
  424. package/build/src/context/types.d.ts +6 -0
  425. package/build/src/context/types.js +1 -12
  426. package/build/src/context/types.js.map +1 -1
  427. package/build/src/context-api.d.ts +4 -1
  428. package/build/src/context-api.js +5 -13
  429. package/build/src/context-api.js.map +1 -1
  430. package/build/src/diag/ComponentLogger.d.ts +6 -6
  431. package/build/src/diag/ComponentLogger.js +2 -14
  432. package/build/src/diag/ComponentLogger.js.map +1 -1
  433. package/build/src/diag/consoleLogger.d.ts +6 -1
  434. package/build/src/diag/consoleLogger.js +37 -21
  435. package/build/src/diag/consoleLogger.js.map +1 -1
  436. package/build/src/diag/internal/logLevelLogger.d.ts +2 -1
  437. package/build/src/diag/internal/logLevelLogger.js +1 -12
  438. package/build/src/diag/internal/logLevelLogger.js.map +1 -1
  439. package/build/src/diag/internal/noopLogger.d.ts +1 -1
  440. package/build/src/diag/internal/noopLogger.js +1 -12
  441. package/build/src/diag/internal/noopLogger.js.map +1 -1
  442. package/build/src/diag/types.d.ts +11 -1
  443. package/build/src/diag/types.js +1 -12
  444. package/build/src/diag/types.js.map +1 -1
  445. package/build/src/diag-api.d.ts +2 -0
  446. package/build/src/diag-api.js +3 -12
  447. package/build/src/diag-api.js.map +1 -1
  448. package/build/src/experimental/index.d.ts +5 -1
  449. package/build/src/experimental/index.js +7 -14
  450. package/build/src/experimental/index.js.map +1 -1
  451. package/build/src/experimental/trace/SugaredOptions.d.ts +1 -1
  452. package/build/src/experimental/trace/SugaredOptions.js +1 -12
  453. package/build/src/experimental/trace/SugaredOptions.js.map +1 -1
  454. package/build/src/experimental/trace/SugaredTracer.d.ts +2 -2
  455. package/build/src/experimental/trace/SugaredTracer.js.map +1 -1
  456. package/build/src/index.d.ts +29 -24
  457. package/build/src/index.js +2 -12
  458. package/build/src/index.js.map +1 -1
  459. package/build/src/internal/global-utils.d.ts +5 -5
  460. package/build/src/internal/global-utils.js +10 -14
  461. package/build/src/internal/global-utils.js.map +1 -1
  462. package/build/src/internal/semver.js +1 -12
  463. package/build/src/internal/semver.js.map +1 -1
  464. package/build/src/metrics/Meter.d.ts +5 -1
  465. package/build/src/metrics/Meter.js +1 -12
  466. package/build/src/metrics/Meter.js.map +1 -1
  467. package/build/src/metrics/MeterProvider.d.ts +3 -1
  468. package/build/src/metrics/MeterProvider.js +1 -12
  469. package/build/src/metrics/MeterProvider.js.map +1 -1
  470. package/build/src/metrics/Metric.d.ts +79 -11
  471. package/build/src/metrics/Metric.js +6 -13
  472. package/build/src/metrics/Metric.js.map +1 -1
  473. package/build/src/metrics/NoopMeter.d.ts +4 -2
  474. package/build/src/metrics/NoopMeter.js +3 -12
  475. package/build/src/metrics/NoopMeter.js.map +1 -1
  476. package/build/src/metrics/NoopMeterProvider.d.ts +2 -2
  477. package/build/src/metrics/NoopMeterProvider.js +1 -12
  478. package/build/src/metrics/NoopMeterProvider.js.map +1 -1
  479. package/build/src/metrics-api.d.ts +5 -1
  480. package/build/src/metrics-api.js +6 -13
  481. package/build/src/metrics-api.js.map +1 -1
  482. package/build/src/propagation/NoopTextMapPropagator.d.ts +2 -2
  483. package/build/src/propagation/NoopTextMapPropagator.js +1 -12
  484. package/build/src/propagation/NoopTextMapPropagator.js.map +1 -1
  485. package/build/src/propagation/TextMapPropagator.d.ts +14 -2
  486. package/build/src/propagation/TextMapPropagator.js +7 -12
  487. package/build/src/propagation/TextMapPropagator.js.map +1 -1
  488. package/build/src/propagation-api.d.ts +5 -1
  489. package/build/src/propagation-api.js +6 -13
  490. package/build/src/propagation-api.js.map +1 -1
  491. package/build/src/trace/NonRecordingSpan.d.ts +8 -8
  492. package/build/src/trace/NonRecordingSpan.js +3 -14
  493. package/build/src/trace/NonRecordingSpan.js.map +1 -1
  494. package/build/src/trace/NoopTracer.d.ts +4 -4
  495. package/build/src/trace/NoopTracer.js +6 -13
  496. package/build/src/trace/NoopTracer.js.map +1 -1
  497. package/build/src/trace/NoopTracerProvider.d.ts +3 -3
  498. package/build/src/trace/NoopTracerProvider.js +1 -12
  499. package/build/src/trace/NoopTracerProvider.js.map +1 -1
  500. package/build/src/trace/ProxyTracer.d.ts +14 -9
  501. package/build/src/trace/ProxyTracer.js +5 -14
  502. package/build/src/trace/ProxyTracer.js.map +1 -1
  503. package/build/src/trace/ProxyTracerProvider.d.ts +6 -3
  504. package/build/src/trace/ProxyTracerProvider.js +4 -12
  505. package/build/src/trace/ProxyTracerProvider.js.map +1 -1
  506. package/build/src/trace/Sampler.d.ts +7 -5
  507. package/build/src/trace/Sampler.js +1 -12
  508. package/build/src/trace/Sampler.js.map +1 -1
  509. package/build/src/trace/SamplingResult.d.ts +6 -2
  510. package/build/src/trace/SamplingResult.js +3 -12
  511. package/build/src/trace/SamplingResult.js.map +1 -1
  512. package/build/src/trace/SpanOptions.d.ts +7 -5
  513. package/build/src/trace/SpanOptions.js +1 -12
  514. package/build/src/trace/SpanOptions.js.map +1 -1
  515. package/build/src/trace/attributes.d.ts +5 -3
  516. package/build/src/trace/attributes.js +1 -12
  517. package/build/src/trace/attributes.js.map +1 -1
  518. package/build/src/trace/context-utils.d.ts +3 -3
  519. package/build/src/trace/context-utils.js +1 -12
  520. package/build/src/trace/context-utils.js.map +1 -1
  521. package/build/src/trace/internal/tracestate-impl.d.ts +1 -1
  522. package/build/src/trace/internal/tracestate-impl.js +8 -17
  523. package/build/src/trace/internal/tracestate-impl.js.map +1 -1
  524. package/build/src/trace/internal/tracestate-validators.js +1 -12
  525. package/build/src/trace/internal/tracestate-validators.js.map +1 -1
  526. package/build/src/trace/internal/utils.d.ts +4 -1
  527. package/build/src/trace/internal/utils.js +4 -12
  528. package/build/src/trace/internal/utils.js.map +1 -1
  529. package/build/src/trace/invalid-span-constants.d.ts +10 -1
  530. package/build/src/trace/invalid-span-constants.js +10 -12
  531. package/build/src/trace/invalid-span-constants.js.map +1 -1
  532. package/build/src/trace/link.d.ts +4 -2
  533. package/build/src/trace/link.js +1 -12
  534. package/build/src/trace/link.js.map +1 -1
  535. package/build/src/trace/span.d.ts +22 -10
  536. package/build/src/trace/span.js +1 -12
  537. package/build/src/trace/span.js.map +1 -1
  538. package/build/src/trace/span_context.d.ts +3 -1
  539. package/build/src/trace/span_context.js +1 -12
  540. package/build/src/trace/span_context.js.map +1 -1
  541. package/build/src/trace/span_kind.d.ts +3 -0
  542. package/build/src/trace/span_kind.js +6 -14
  543. package/build/src/trace/span_kind.js.map +1 -1
  544. package/build/src/trace/spancontext-utils.d.ts +10 -2
  545. package/build/src/trace/spancontext-utils.js +33 -16
  546. package/build/src/trace/spancontext-utils.js.map +1 -1
  547. package/build/src/trace/status.d.ts +5 -0
  548. package/build/src/trace/status.js +6 -0
  549. package/build/src/trace/status.js.map +1 -1
  550. package/build/src/trace/trace_flags.d.ts +3 -0
  551. package/build/src/trace/trace_flags.js +4 -12
  552. package/build/src/trace/trace_flags.js.map +1 -1
  553. package/build/src/trace/trace_state.d.ts +3 -0
  554. package/build/src/trace/trace_state.js +1 -12
  555. package/build/src/trace/trace_state.js.map +1 -1
  556. package/build/src/trace/tracer.d.ts +5 -3
  557. package/build/src/trace/tracer.js +1 -12
  558. package/build/src/trace/tracer.js.map +1 -1
  559. package/build/src/trace/tracer_options.d.ts +2 -0
  560. package/build/src/trace/tracer_options.js +1 -12
  561. package/build/src/trace/tracer_options.js.map +1 -1
  562. package/build/src/trace/tracer_provider.d.ts +4 -2
  563. package/build/src/trace/tracer_provider.js +1 -12
  564. package/build/src/trace/tracer_provider.js.map +1 -1
  565. package/build/src/trace-api.d.ts +5 -1
  566. package/build/src/trace-api.js +6 -13
  567. package/build/src/trace-api.js.map +1 -1
  568. package/build/src/version.d.ts +1 -1
  569. package/build/src/version.js +2 -13
  570. package/build/src/version.js.map +1 -1
  571. package/package.json +19 -36
  572. package/build/esm/metrics/ObservableResult.d.ts +0 -31
  573. package/build/esm/metrics/ObservableResult.js +0 -17
  574. package/build/esm/metrics/ObservableResult.js.map +0 -1
  575. package/build/esm/platform/browser/globalThis.d.ts +0 -10
  576. package/build/esm/platform/browser/globalThis.js +0 -35
  577. package/build/esm/platform/browser/globalThis.js.map +0 -1
  578. package/build/esm/platform/browser/index.d.ts +0 -2
  579. package/build/esm/platform/browser/index.js +0 -17
  580. package/build/esm/platform/browser/index.js.map +0 -1
  581. package/build/esm/platform/index.d.ts +0 -2
  582. package/build/esm/platform/index.js +0 -17
  583. package/build/esm/platform/index.js.map +0 -1
  584. package/build/esm/platform/node/globalThis.d.ts +0 -3
  585. package/build/esm/platform/node/globalThis.js +0 -19
  586. package/build/esm/platform/node/globalThis.js.map +0 -1
  587. package/build/esm/platform/node/index.d.ts +0 -2
  588. package/build/esm/platform/node/index.js +0 -17
  589. package/build/esm/platform/node/index.js.map +0 -1
  590. package/build/esnext/metrics/ObservableResult.d.ts +0 -31
  591. package/build/esnext/metrics/ObservableResult.js +0 -17
  592. package/build/esnext/metrics/ObservableResult.js.map +0 -1
  593. package/build/esnext/platform/browser/globalThis.d.ts +0 -10
  594. package/build/esnext/platform/browser/globalThis.js +0 -35
  595. package/build/esnext/platform/browser/globalThis.js.map +0 -1
  596. package/build/esnext/platform/browser/index.d.ts +0 -2
  597. package/build/esnext/platform/browser/index.js +0 -17
  598. package/build/esnext/platform/browser/index.js.map +0 -1
  599. package/build/esnext/platform/index.d.ts +0 -2
  600. package/build/esnext/platform/index.js +0 -17
  601. package/build/esnext/platform/index.js.map +0 -1
  602. package/build/esnext/platform/node/globalThis.d.ts +0 -3
  603. package/build/esnext/platform/node/globalThis.js +0 -19
  604. package/build/esnext/platform/node/globalThis.js.map +0 -1
  605. package/build/esnext/platform/node/index.d.ts +0 -2
  606. package/build/esnext/platform/node/index.js +0 -17
  607. package/build/esnext/platform/node/index.js.map +0 -1
  608. package/build/src/metrics/ObservableResult.d.ts +0 -31
  609. package/build/src/metrics/ObservableResult.js +0 -18
  610. package/build/src/metrics/ObservableResult.js.map +0 -1
  611. package/build/src/platform/browser/globalThis.d.ts +0 -10
  612. package/build/src/platform/browser/globalThis.js +0 -38
  613. package/build/src/platform/browser/globalThis.js.map +0 -1
  614. package/build/src/platform/browser/index.d.ts +0 -2
  615. package/build/src/platform/browser/index.js +0 -29
  616. package/build/src/platform/browser/index.js.map +0 -1
  617. package/build/src/platform/index.d.ts +0 -2
  618. package/build/src/platform/index.js +0 -29
  619. package/build/src/platform/index.js.map +0 -1
  620. package/build/src/platform/node/globalThis.d.ts +0 -3
  621. package/build/src/platform/node/globalThis.js +0 -22
  622. package/build/src/platform/node/globalThis.js.map +0 -1
  623. package/build/src/platform/node/index.d.ts +0 -2
  624. package/build/src/platform/node/index.js +0 -29
  625. package/build/src/platform/node/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SugaredTracer.js","sourceRoot":"","sources":["../../../../src/experimental/trace/SugaredTracer.ts"],"names":[],"mappings":";;;AAgBA,8BAAwE;AAExE,MAAM,kBAAkB,GAAG,CAAC,CAAQ,EAAE,IAAU,EAAE,EAAE;IAClD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,SAAS,CAAC;QACb,IAAI,EAAE,kBAAc,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAgB,UAAU,CAAC,MAA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B,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,2EAA2E;QAC3E,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC;KACvB;AACH,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 { SugaredSpanOptions } from './SugaredOptions';\nimport { context, Context, Span, SpanStatusCode, Tracer } from '../../';\n\nconst defaultOnException = (e: Error, span: Span) => {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n });\n};\n\n/**\n * return a new SugaredTracer created from the supplied one\n * @param tracer\n */\nexport function wrapTracer(tracer: Tracer): SugaredTracer {\n return new SugaredTracer(tracer);\n}\n\nexport class SugaredTracer implements Tracer {\n private readonly _tracer: Tracer;\n\n constructor(tracer: Tracer) {\n this._tracer = tracer;\n this.startSpan = tracer.startSpan.bind(this._tracer);\n this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);\n }\n\n startActiveSpan: Tracer['startActiveSpan'];\n startSpan: Tracer['startSpan'];\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 * The span will be closed after the function has executed.\n * If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.\n *\n * @param name The name of the span\n * @param [options] SugaredSpanOptions 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.withActiveSpan('op', span => {\n * // do some work\n * });\n * @example\n * const something = await tracer.withActiveSpan('op', span => {\n * // do some async work\n * });\n */\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n arg2: F | SugaredSpanOptions,\n arg3?: F | Context,\n arg4?: F\n ): ReturnType<F> {\n const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);\n\n return this._tracer.startActiveSpan(name, opts, ctx, (span: Span) =>\n handleFn(span, opts, fn)\n ) as ReturnType<F>;\n }\n\n /**\n * Starts a new {@link Span} and ends it after execution of fn without setting it on context.\n * The span will be closed after the function has executed.\n * If an exception occurs, it is recorded, the status is et to ERROR and rethrown.\n *\n * This method does NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SugaredSpanOptions 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 Span The newly created span\n * @example\n * const something = tracer.withSpan('op', span => {\n * // do some work\n * });\n * @example\n * const something = await tracer.withSpan('op', span => {\n * // do some async work\n * });\n */\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n arg2: SugaredSpanOptions | F,\n arg3?: Context | F,\n arg4?: F\n ): ReturnType<F> {\n const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);\n\n const span = this._tracer.startSpan(name, opts, ctx);\n return handleFn(span, opts, fn) as ReturnType<F>;\n }\n}\n\n/**\n * Massages parameters of withSpan and withActiveSpan to allow signature overwrites\n * @param arg\n * @param arg2\n * @param arg3\n */\nfunction massageParams<F extends (span: Span) => ReturnType<F>>(\n arg: F | SugaredSpanOptions,\n arg2?: F | Context,\n arg3?: F\n) {\n let opts: SugaredSpanOptions | undefined;\n let ctx: Context | undefined;\n let fn: F;\n\n if (!arg2 && !arg3) {\n fn = arg as F;\n } else if (!arg3) {\n opts = arg as SugaredSpanOptions;\n fn = arg2 as F;\n } else {\n opts = arg as SugaredSpanOptions;\n ctx = arg2 as Context;\n fn = arg3 as F;\n }\n opts = opts ?? {};\n ctx = ctx ?? context.active();\n\n return { opts, ctx, fn };\n}\n\n/**\n * Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling\n * @param span\n * @param opts\n * @param fn\n */\nfunction handleFn<F extends (span: Span) => ReturnType<F>>(\n span: Span,\n opts: SugaredSpanOptions,\n fn: F\n): ReturnType<F> {\n const onException = opts.onException ?? defaultOnException;\n const errorHandler = (e: Error) => {\n onException(e, span);\n span.end();\n throw e;\n };\n\n try {\n const ret = fn(span) as Promise<ReturnType<F>>;\n // if fn is an async function, attach a recordException and spanEnd callback to the promise\n if (typeof ret?.then === 'function') {\n return ret.then(val => {\n span.end();\n return val;\n }, errorHandler) as ReturnType<F>;\n }\n span.end();\n return ret as ReturnType<F>;\n } catch (e) {\n // add throw to signal the compiler that this will throw in the inner scope\n throw errorHandler(e);\n }\n}\n"]}
1
+ {"version":3,"file":"SugaredTracer.js","sourceRoot":"","sources":["../../../../src/experimental/trace/SugaredTracer.ts"],"names":[],"mappings":";;;AAMA,8BAA+D;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAQ,EAAE,IAAU,EAAE,EAAE;IAClD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,C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G,EAAE,CAAC;gBACX,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,YAAY,CAAkB,CAAC;SACnC;QACD,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,OAAO,GAAoB,CAAC;KAC7B;IAAC,OAAO,CAAC,EAAE;QACV,2EAA2E;QAC3E,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC;KACvB;AACH,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { SugaredSpanOptions } from './SugaredOptions';\nimport type { Context, Span, Tracer } from '../../';\nimport { context as contextApi, SpanStatusCode } from '../../';\n\nconst defaultOnException = (e: Error, span: Span) => {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n });\n};\n\n/**\n * return a new SugaredTracer created from the supplied one\n * @param tracer\n */\nexport function wrapTracer(tracer: Tracer): SugaredTracer {\n return new SugaredTracer(tracer);\n}\n\nexport class SugaredTracer implements Tracer {\n private readonly _tracer: Tracer;\n\n constructor(tracer: Tracer) {\n this._tracer = tracer;\n this.startSpan = tracer.startSpan.bind(this._tracer);\n this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);\n }\n\n startActiveSpan: Tracer['startActiveSpan'];\n startSpan: Tracer['startSpan'];\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 * The span will be closed after the function has executed.\n * If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.\n *\n * @param name The name of the span\n * @param [options] SugaredSpanOptions 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.withActiveSpan('op', span => {\n * // do some work\n * });\n * @example\n * const something = await tracer.withActiveSpan('op', span => {\n * // do some async work\n * });\n */\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withActiveSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n arg2: F | SugaredSpanOptions,\n arg3?: F | Context,\n arg4?: F\n ): ReturnType<F> {\n const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);\n\n return this._tracer.startActiveSpan(name, opts, ctx, (span: Span) =>\n handleFn(span, opts, fn)\n ) as ReturnType<F>;\n }\n\n /**\n * Starts a new {@link Span} and ends it after execution of fn without setting it on context.\n * The span will be closed after the function has executed.\n * If an exception occurs, it is recorded, the status is et to ERROR and rethrown.\n *\n * This method does NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SugaredSpanOptions 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 Span The newly created span\n * @example\n * const something = tracer.withSpan('op', span => {\n * // do some work\n * });\n * @example\n * const something = await tracer.withSpan('op', span => {\n * // do some async work\n * });\n */\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n options: SugaredSpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n withSpan<F extends (span: Span) => ReturnType<F>>(\n name: string,\n arg2: SugaredSpanOptions | F,\n arg3?: Context | F,\n arg4?: F\n ): ReturnType<F> {\n const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);\n\n const span = this._tracer.startSpan(name, opts, ctx);\n return handleFn(span, opts, fn) as ReturnType<F>;\n }\n}\n\n/**\n * Massages parameters of withSpan and withActiveSpan to allow signature overwrites\n * @param arg\n * @param arg2\n * @param arg3\n */\nfunction massageParams<F extends (span: Span) => ReturnType<F>>(\n arg: F | SugaredSpanOptions,\n arg2?: F | Context,\n arg3?: F\n) {\n let opts: SugaredSpanOptions | undefined;\n let ctx: Context | undefined;\n let fn: F;\n\n if (!arg2 && !arg3) {\n fn = arg as F;\n } else if (!arg3) {\n opts = arg as SugaredSpanOptions;\n fn = arg2 as F;\n } else {\n opts = arg as SugaredSpanOptions;\n ctx = arg2 as Context;\n fn = arg3 as F;\n }\n opts = opts ?? {};\n ctx = ctx ?? contextApi.active();\n\n return { opts, ctx, fn };\n}\n\n/**\n * Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling\n * @param span\n * @param opts\n * @param fn\n */\nfunction handleFn<F extends (span: Span) => ReturnType<F>>(\n span: Span,\n opts: SugaredSpanOptions,\n fn: F\n): ReturnType<F> {\n const onException = opts.onException ?? defaultOnException;\n const errorHandler = (e: Error) => {\n onException(e, span);\n span.end();\n throw e;\n };\n\n try {\n const ret = fn(span) as Promise<ReturnType<F>>;\n // if fn is an async function, attach a recordException and spanEnd callback to the promise\n if (typeof ret?.then === 'function') {\n return ret.then(val => {\n span.end();\n return val;\n }, errorHandler) as ReturnType<F>;\n }\n span.end();\n return ret as ReturnType<F>;\n } catch (e) {\n // add throw to signal the compiler that this will throw in the inner scope\n throw errorHandler(e);\n }\n}\n"]}
@@ -1,39 +1,44 @@
1
- export { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';
1
+ /**
2
+ * @module @opentelemetry/api
3
+ */
4
+ export type { BaggageEntry, BaggageEntryMetadata, Baggage, } from './baggage/types';
2
5
  export { baggageEntryMetadataFromString } from './baggage/utils';
3
- export { Exception } from './common/Exception';
4
- export { HrTime, TimeInput } from './common/Time';
5
- export { Attributes, AttributeValue } from './common/Attributes';
6
+ export type { Exception } from './common/Exception';
7
+ export type { HrTime, TimeInput } from './common/Time';
8
+ export type { Attributes, AttributeValue } from './common/Attributes';
6
9
  export { createContextKey, ROOT_CONTEXT } from './context/context';
7
- export { Context, ContextManager } from './context/types';
10
+ export type { Context, ContextManager } from './context/types';
8
11
  export type { ContextAPI } from './api/context';
9
12
  export { DiagConsoleLogger } from './diag/consoleLogger';
10
- export { DiagLogFunction, DiagLogger, DiagLogLevel, ComponentLoggerOptions, DiagLoggerOptions, } from './diag/types';
13
+ export { DiagLogLevel } from './diag/types';
14
+ export type { DiagLogFunction, DiagLogger, ComponentLoggerOptions, DiagLoggerOptions, } from './diag/types';
11
15
  export type { DiagAPI } from './api/diag';
12
16
  export { createNoopMeter } from './metrics/NoopMeter';
13
- export { MeterOptions, Meter } from './metrics/Meter';
14
- export { MeterProvider } from './metrics/MeterProvider';
15
- export { ValueType, Counter, Gauge, Histogram, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, BatchObservableCallback, MetricAdvice, MetricAttributes, MetricAttributeValue, ObservableCallback, } from './metrics/Metric';
16
- export { BatchObservableResult, ObservableResult, } from './metrics/ObservableResult';
17
+ export type { MeterOptions, Meter } from './metrics/Meter';
18
+ export type { MeterProvider } from './metrics/MeterProvider';
19
+ export { ValueType } from './metrics/Metric';
20
+ export type { Counter, Gauge, Histogram, MetricOptions, UpDownCounter, MetricAdvice, MetricAttributes, MetricAttributeValue, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, BatchObservableCallback, ObservableCallback, BatchObservableResult, ObservableResult, } from './metrics/Metric';
17
21
  export type { MetricsAPI } from './api/metrics';
18
- export { TextMapPropagator, TextMapSetter, TextMapGetter, defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';
22
+ export { defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';
23
+ export type { TextMapPropagator, TextMapSetter, TextMapGetter, } from './propagation/TextMapPropagator';
19
24
  export type { PropagationAPI } from './api/propagation';
20
- export { SpanAttributes, SpanAttributeValue } from './trace/attributes';
21
- export { Link } from './trace/link';
22
- export { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';
25
+ export type { SpanAttributes, SpanAttributeValue } from './trace/attributes';
26
+ export type { Link } from './trace/link';
27
+ export { ProxyTracer, type TracerDelegator } from './trace/ProxyTracer';
23
28
  export { ProxyTracerProvider } from './trace/ProxyTracerProvider';
24
- export { Sampler } from './trace/Sampler';
25
- export { SamplingDecision, SamplingResult } from './trace/SamplingResult';
26
- export { SpanContext } from './trace/span_context';
29
+ export type { Sampler } from './trace/Sampler';
30
+ export { SamplingDecision, type SamplingResult } from './trace/SamplingResult';
31
+ export type { SpanContext } from './trace/span_context';
27
32
  export { SpanKind } from './trace/span_kind';
28
- export { Span } from './trace/span';
29
- export { SpanOptions } from './trace/SpanOptions';
30
- export { SpanStatus, SpanStatusCode } from './trace/status';
33
+ export type { Span } from './trace/span';
34
+ export type { SpanOptions } from './trace/SpanOptions';
35
+ export { type SpanStatus, SpanStatusCode } from './trace/status';
31
36
  export { TraceFlags } from './trace/trace_flags';
32
- export { TraceState } from './trace/trace_state';
37
+ export type { TraceState } from './trace/trace_state';
33
38
  export { createTraceState } from './trace/internal/utils';
34
- export { TracerProvider } from './trace/tracer_provider';
35
- export { Tracer } from './trace/tracer';
36
- export { TracerOptions } from './trace/tracer_options';
39
+ export type { TracerProvider } from './trace/tracer_provider';
40
+ export type { Tracer } from './trace/tracer';
41
+ export type { TracerOptions } from './trace/tracer_options';
37
42
  export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
38
43
  export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';
39
44
  export type { TraceAPI } from './api/trace';
@@ -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.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0;
@@ -38,6 +27,7 @@ Object.defineProperty(exports, "defaultTextMapGetter", { enumerable: true, get:
38
27
  Object.defineProperty(exports, "defaultTextMapSetter", { enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } });
39
28
  var ProxyTracer_1 = require("./trace/ProxyTracer");
40
29
  Object.defineProperty(exports, "ProxyTracer", { enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } });
30
+ // TODO: Remove ProxyTracerProvider export in the next major version.
41
31
  var ProxyTracerProvider_1 = require("./trace/ProxyTracerProvider");
42
32
  Object.defineProperty(exports, "ProxyTracerProvider", { enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } });
43
33
  var SamplingResult_1 = require("./trace/SamplingResult");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,yCAAiE;AAAxD,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;IACX,KAAK,EAAL,iBAAK;CACN,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\nexport { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport { Exception } from './common/Exception';\nexport { HrTime, TimeInput } from './common/Time';\nexport { Attributes, AttributeValue } from './common/Attributes';\n\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\nexport { Context, ContextManager } from './context/types';\nexport type { ContextAPI } from './api/context';\n\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport {\n DiagLogFunction,\n DiagLogger,\n DiagLogLevel,\n ComponentLoggerOptions,\n DiagLoggerOptions,\n} from './diag/types';\nexport type { DiagAPI } from './api/diag';\n\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { MeterOptions, Meter } from './metrics/Meter';\nexport { MeterProvider } from './metrics/MeterProvider';\nexport {\n ValueType,\n Counter,\n Gauge,\n Histogram,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n BatchObservableCallback,\n MetricAdvice,\n MetricAttributes,\n MetricAttributeValue,\n ObservableCallback,\n} from './metrics/Metric';\nexport {\n BatchObservableResult,\n ObservableResult,\n} from './metrics/ObservableResult';\nexport type { MetricsAPI } from './api/metrics';\n\n// Propagation APIs\nexport {\n TextMapPropagator,\n TextMapSetter,\n TextMapGetter,\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from './propagation/TextMapPropagator';\nexport type { PropagationAPI } from './api/propagation';\n\n// Trace APIs\nexport { SpanAttributes, SpanAttributeValue } from './trace/attributes';\nexport { Link } from './trace/link';\nexport { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { Sampler } from './trace/Sampler';\nexport { SamplingDecision, SamplingResult } from './trace/SamplingResult';\nexport { SpanContext } from './trace/span_context';\nexport { SpanKind } from './trace/span_kind';\nexport { Span } from './trace/span';\nexport { SpanOptions } from './trace/SpanOptions';\nexport { SpanStatus, SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { TraceState } from './trace/trace_state';\nexport { createTraceState } from './trace/internal/utils';\nexport { TracerProvider } from './trace/tracer_provider';\nexport { Tracer } from './trace/tracer';\nexport { TracerOptions } from './trace/tracer_options';\nexport {\n isSpanContextValid,\n isValidTraceId,\n isValidSpanId,\n} from './trace/spancontext-utils';\nexport {\n INVALID_SPANID,\n INVALID_TRACEID,\n INVALID_SPAN_CONTEXT,\n} from './trace/invalid-span-constants';\nexport type { TraceAPI } from './api/trace';\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,yCAAiE;AAAxD,uHAAA,8BAA8B,OAAA;AAKvC,eAAe;AACf,6CAAmE;AAA1D,2GAAA,gBAAgB,OAAA;AAAE,uGAAA,YAAY,OAAA;AAIvC,YAAY;AACZ,sDAAyD;AAAhD,kHAAA,iBAAiB,OAAA;AAC1B,sCAA4C;AAAnC,qGAAA,YAAY,OAAA;AASrB,eAAe;AACf,iDAAsD;AAA7C,4GAAA,eAAe,OAAA;AAGxB,2CAA6C;AAApC,mGAAA,SAAS,OAAA;AAqBlB,mBAAmB;AACnB,qEAGyC;AAFvC,yHAAA,oBAAoB,OAAA;AACpB,yHAAA,oBAAoB,OAAA;AAYtB,mDAAwE;AAA/D,0GAAA,WAAW,OAAA;AACpB,qEAAqE;AACrE,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAE5B,yDAA+E;AAAtE,kHAAA,gBAAgB,OAAA;AAEzB,+CAA6C;AAApC,qGAAA,QAAQ,OAAA;AAGjB,yCAAiE;AAAvC,wGAAA,cAAc,OAAA;AACxC,mDAAiD;AAAxC,yGAAA,UAAU,OAAA;AAEnB,gDAA0D;AAAjD,yGAAA,gBAAgB,OAAA;AAIzB,+DAImC;AAHjC,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAEf,yEAIwC;AAHtC,wHAAA,cAAc,OAAA;AACd,yHAAA,eAAe,OAAA;AACf,8HAAA,oBAAoB,OAAA;AAItB,sEAAsE;AACtE,qCAAqC;AACrC,+CAAwC;AAO/B,wFAPA,qBAAO,OAOA;AANhB,yCAAkC;AAMhB,qFANT,eAAI,OAMS;AALtB,+CAAwC;AAKhB,wFALf,qBAAO,OAKe;AAJ/B,uDAAgD;AAIf,4FAJxB,6BAAW,OAIwB;AAH5C,2CAAoC;AAGU,sFAHrC,iBAAK,OAGqC;AACnD,kBAAkB;AAClB,kBAAe;IACb,OAAO,EAAP,qBAAO;IACP,IAAI,EAAJ,eAAI;IACJ,OAAO,EAAP,qBAAO;IACP,WAAW,EAAX,6BAAW;IACX,KAAK,EAAL,iBAAK;CACN,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @module @opentelemetry/api\n */\n\nexport type {\n BaggageEntry,\n BaggageEntryMetadata,\n Baggage,\n} from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport type { Exception } from './common/Exception';\nexport type { HrTime, TimeInput } from './common/Time';\nexport type { Attributes, AttributeValue } from './common/Attributes';\n\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\nexport type { Context, ContextManager } from './context/types';\nexport type { ContextAPI } from './api/context';\n\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport { DiagLogLevel } from './diag/types';\nexport type {\n DiagLogFunction,\n DiagLogger,\n ComponentLoggerOptions,\n DiagLoggerOptions,\n} from './diag/types';\nexport type { DiagAPI } from './api/diag';\n\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport type { MeterOptions, Meter } from './metrics/Meter';\nexport type { MeterProvider } from './metrics/MeterProvider';\nexport { ValueType } from './metrics/Metric';\nexport type {\n Counter,\n Gauge,\n Histogram,\n MetricOptions,\n UpDownCounter,\n MetricAdvice,\n MetricAttributes,\n MetricAttributeValue,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n BatchObservableCallback,\n ObservableCallback,\n BatchObservableResult,\n ObservableResult,\n} from './metrics/Metric';\nexport type { MetricsAPI } from './api/metrics';\n\n// Propagation APIs\nexport {\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from './propagation/TextMapPropagator';\nexport type {\n TextMapPropagator,\n TextMapSetter,\n TextMapGetter,\n} from './propagation/TextMapPropagator';\nexport type { PropagationAPI } from './api/propagation';\n\n// Trace APIs\nexport type { SpanAttributes, SpanAttributeValue } from './trace/attributes';\nexport type { Link } from './trace/link';\nexport { ProxyTracer, type TracerDelegator } from './trace/ProxyTracer';\n// TODO: Remove ProxyTracerProvider export in the next major version.\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport type { Sampler } from './trace/Sampler';\nexport { SamplingDecision, type SamplingResult } from './trace/SamplingResult';\nexport type { SpanContext } from './trace/span_context';\nexport { SpanKind } from './trace/span_kind';\nexport type { Span } from './trace/span';\nexport type { SpanOptions } from './trace/SpanOptions';\nexport { type SpanStatus, SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport type { TraceState } from './trace/trace_state';\nexport { createTraceState } from './trace/internal/utils';\nexport type { TracerProvider } from './trace/tracer_provider';\nexport type { Tracer } from './trace/tracer';\nexport type { TracerOptions } from './trace/tracer_options';\nexport {\n isSpanContextValid,\n isValidTraceId,\n isValidSpanId,\n} from './trace/spancontext-utils';\nexport {\n INVALID_SPANID,\n INVALID_TRACEID,\n INVALID_SPAN_CONTEXT,\n} from './trace/invalid-span-constants';\nexport type { TraceAPI } from './api/trace';\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n"]}
@@ -1,12 +1,12 @@
1
- import { MeterProvider } from '../metrics/MeterProvider';
2
- import { ContextManager } from '../context/types';
3
- import { DiagLogger } from '../diag/types';
4
- import { TextMapPropagator } from '../propagation/TextMapPropagator';
1
+ import type { MeterProvider } from '../metrics/MeterProvider';
2
+ import type { ContextManager } from '../context/types';
3
+ import type { DiagLogger } from '../diag/types';
4
+ import type { TextMapPropagator } from '../propagation/TextMapPropagator';
5
5
  import type { TracerProvider } from '../trace/tracer_provider';
6
6
  export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagLogger, allowOverride?: boolean): boolean;
7
7
  export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined;
8
8
  export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger): void;
9
- declare type OTelGlobalAPI = {
9
+ type OTelGlobalAPI = {
10
10
  version: string;
11
11
  diag?: DiagLogger;
12
12
  trace?: TracerProvider;
@@ -1,27 +1,23 @@
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.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0;
19
- const platform_1 = require("../platform");
20
8
  const version_1 = require("../version");
21
9
  const semver_1 = require("./semver");
22
10
  const major = version_1.VERSION.split('.')[0];
23
11
  const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
24
- const _global = platform_1._globalThis;
12
+ const _global = (typeof globalThis === 'object'
13
+ ? globalThis
14
+ : typeof self === 'object'
15
+ ? self
16
+ : typeof window === 'object'
17
+ ? window
18
+ : typeof global === 'object'
19
+ ? global
20
+ : {});
25
21
  function registerGlobal(type, instance, diag, allowOverride = false) {
26
22
  var _a;
27
23
  const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
@@ -1 +1 @@
1
- {"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../src/internal/global-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,0CAA0C;AAG1C,wCAAqC;AACrC,qCAAwC;AAExC,MAAM,KAAK,GAAG,iBAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,MAAM,CA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D,OAAO;KACR;IACD,OAAO,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAG,IAAI,CAAC,CAAC;AACvD,CAAC;AARD,8BAQC;AAED,SAAgB,gBAAgB,CAAC,IAAyB,EAAE,IAAgB;IAC1E,IAAI,CAAC,KAAK,CACR,kDAAkD,IAAI,KAAK,iBAAO,GAAG,CACtE,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAElD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;KAClB;AACH,CAAC;AATD,4CASC","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 { MeterProvider } from '../metrics/MeterProvider';\nimport { ContextManager } from '../context/types';\nimport { DiagLogger } from '../diag/types';\nimport { _globalThis } from '../platform';\nimport { TextMapPropagator } from '../propagation/TextMapPropagator';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\n\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\n `opentelemetry.js.api.${major}`\n);\n\nconst _global = _globalThis as OTelGlobal;\n\nexport function registerGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type,\n instance: OTelGlobalAPI[Type],\n diag: DiagLogger,\n allowOverride = false\n): boolean {\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[\n GLOBAL_OPENTELEMETRY_API_KEY\n ] ?? {\n version: VERSION,\n });\n\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(\n `@opentelemetry/api: Attempted duplicate registration of API: ${type}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(\n `@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n api[type] = instance;\n diag.debug(\n `@opentelemetry/api: Registered a global for ${type} v${VERSION}.`\n );\n\n return true;\n}\n\nexport function getGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type\n): OTelGlobalAPI[Type] | undefined {\n const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];\n}\n\nexport function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {\n diag.debug(\n `@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`\n );\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n\n if (api) {\n delete api[type];\n }\n}\n\ntype OTelGlobal = {\n [GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;\n};\n\ntype OTelGlobalAPI = {\n version: string;\n\n diag?: DiagLogger;\n trace?: TracerProvider;\n context?: ContextManager;\n metrics?: MeterProvider;\n propagation?: TextMapPropagator;\n};\n"]}
1
+ {"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../src/internal/global-utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,wCAAqC;AACrC,qCAAwC;AAExC,MAAM,KAAK,GAAG,iBAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAC7C,wBAAwB,KAAK,EAAE,CAChC,CAAC;AAMF,MAAM,OAAO,GAAG,CACd,OAAO,UAAU,KAAK,QAAQ;IAC5B,CAAC,CAAC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AU;;IAEV,MAAM,aAAa,GAAG,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAE,OAAO,CAAC;IACrE,IAAI,CAAC,aAAa,IAAI,CAAC,IAAA,qBAAY,EAAC,aAAa,CAAC,EAAE;QAClD,OAAO;KACR;IACD,OAAO,MAAA,OAAO,CAAC,4BAA4B,CAAC,0CAAG,IAAI,CAAC,CAAC;AACvD,CAAC;AARD,8BAQC;AAED,SAAgB,gBAAgB,CAAC,IAAyB,EAAE,IAAgB;IAC1E,IAAI,CAAC,KAAK,CACR,kDAAkD,IAAI,KAAK,iBAAO,GAAG,CACtE,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAElD,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;KAClB;AACH,CAAC;AATD,4CASC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '../metrics/MeterProvider';\nimport type { ContextManager } from '../context/types';\nimport type { DiagLogger } from '../diag/types';\nimport type { TextMapPropagator } from '../propagation/TextMapPropagator';\nimport type { TracerProvider } from '../trace/tracer_provider';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\n\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\n `opentelemetry.js.api.${major}`\n);\n\ndeclare const self: unknown;\ndeclare const window: unknown;\ndeclare const global: unknown;\n\nconst _global = (\n typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {}\n) as OTelGlobal;\n\nexport function registerGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type,\n instance: OTelGlobalAPI[Type],\n diag: DiagLogger,\n allowOverride = false\n): boolean {\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[\n GLOBAL_OPENTELEMETRY_API_KEY\n ] ?? {\n version: VERSION,\n });\n\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(\n `@opentelemetry/api: Attempted duplicate registration of API: ${type}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(\n `@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`\n );\n diag.error(err.stack || err.message);\n return false;\n }\n\n api[type] = instance;\n diag.debug(\n `@opentelemetry/api: Registered a global for ${type} v${VERSION}.`\n );\n\n return true;\n}\n\nexport function getGlobal<Type extends keyof OTelGlobalAPI>(\n type: Type\n): OTelGlobalAPI[Type] | undefined {\n const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];\n}\n\nexport function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {\n diag.debug(\n `@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`\n );\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n\n if (api) {\n delete api[type];\n }\n}\n\ntype OTelGlobal = {\n [GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;\n};\n\ntype OTelGlobalAPI = {\n version: string;\n\n diag?: DiagLogger;\n trace?: TracerProvider;\n context?: ContextManager;\n metrics?: MeterProvider;\n propagation?: TextMapPropagator;\n};\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.isCompatible = exports._makeCompatibilityCheck = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/internal/semver.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,wCAAqC;AAErC,MAAM,EAAE,GAAG,+BAA+B,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,uBAAuB,CACrC,UAAkB;IAElB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAE3C,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,EAAE;QACnB,6DAA6D;QAC7D,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;KACpB;IAED,MAAM,gBAAgB,GAAG;QACvB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;KAC9B,CAAC;IAEF,kEAAkE;IAClE,IAAI,gBAAgB,CAAC,UAAU,IAAI,IAAI,EAAE;QACvC,OAAO,SAAS,YAAY,CAAC,aAAqB;YAChD,OAAO,aAAa,KAAK,UAAU,CAAC;QACtC,CAAC,CAAC;KACH;IAED,SAAS,OAAO,CAAC,CAAS;QACxB,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,OAAO,CAAC,CAAS;QACxB,gBAAgB,CAAC,GAAG,CA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B,CAAC,KAAK,EAAE;YACvD,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;SAC/B;QAED,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC;AAtFD,0DAsFC;AAED;;;;;;;;;;;;;;GAcG;AACU,QAAA,YAAY,GAAG,uBAAuB,CAAC,iBAAO,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\nimport { VERSION } from '../version';\n\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(\n ownVersion: string\n): (globalVersion: string) => boolean {\n const acceptedVersions = new Set<string>([ownVersion]);\n const rejectedVersions = new Set<string>();\n\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion: string): boolean {\n return globalVersion === ownVersion;\n };\n }\n\n function _reject(v: string) {\n rejectedVersions.add(v);\n return false;\n }\n\n function _accept(v: string) {\n acceptedVersions.add(v);\n return true;\n }\n\n return function isCompatible(globalVersion: string): boolean {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.major === 0) {\n if (\n ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch\n ) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n };\n}\n\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n"]}
1
+ {"version":3,"file":"semver.js","sourceRoot":"","sources":["../../../src/internal/semver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,wCAAqC;AAErC,MAAM,EAAE,GAAG,+BAA+B,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,uBAAuB,CACrC,UAAkB;IAElB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAE3C,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,cAAc,EAAE;QACnB,6DAA6D;QAC7D,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;KACpB;IAED,MAAM,gBAAgB,GAAG;QACvB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QACzB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;KAC9B,CAAC;IAEF,kEAAkE;IAClE,IAAI,gBAAgB,CAAC,UAAU,IAAI,IAAI,EAAE;QACvC,OAAO,SAAS,YAAY,CAAC,aAAqB;YAChD,OAAO,aAAa,KAAK,UAAU,CAAC;QACtC,CAAC,CAAC;KACH;IAED,SAAS,OAAO,CAAC,CAAS;QACxB,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,OAAO,CAAC,CAAS;QACxB,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,SAAS,YAAY,CAAC,aAAqB;QAChD,IAAI,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC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AtFD,0DAsFC;AAED;;;;;;;;;;;;;;GAcG;AACU,QAAA,YAAY,GAAG,uBAAuB,CAAC,iBAAO,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { VERSION } from '../version';\n\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(\n ownVersion: string\n): (globalVersion: string) => boolean {\n const acceptedVersions = new Set<string>([ownVersion]);\n const rejectedVersions = new Set<string>();\n\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion: string): boolean {\n return globalVersion === ownVersion;\n };\n }\n\n function _reject(v: string) {\n rejectedVersions.add(v);\n return false;\n }\n\n function _accept(v: string) {\n acceptedVersions.add(v);\n return true;\n }\n\n return function isCompatible(globalVersion: string): boolean {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.major === 0) {\n if (\n ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch\n ) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n }\n\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n\n return _reject(globalVersion);\n };\n}\n\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n"]}
@@ -1,6 +1,8 @@
1
- import { BatchObservableCallback, Counter, Gauge, Histogram, MetricAttributes, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter } from './Metric';
1
+ import type { BatchObservableCallback, Counter, Gauge, Histogram, MetricAttributes, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter } from './Metric';
2
2
  /**
3
3
  * An interface describes additional metadata of a meter.
4
+ *
5
+ * @since 1.3.0
4
6
  */
5
7
  export interface MeterOptions {
6
8
  /**
@@ -14,6 +16,8 @@ export interface MeterOptions {
14
16
  * {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
15
17
  * or raw values (`Histogram`) in which the aggregation and attributes
16
18
  * for the exported metric are deferred.
19
+ *
20
+ * @since 1.3.0
17
21
  */
18
22
  export interface Meter {
19
23
  /**
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=Meter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Meter.js","sourceRoot":"","sources":["../../../src/metrics/Meter.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 {\n BatchObservableCallback,\n Counter,\n Gauge,\n Histogram,\n MetricAttributes,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n} from './Metric';\n\n/**\n * An interface describes additional metadata of a meter.\n */\nexport interface MeterOptions {\n /**\n * The schemaUrl of the meter or instrumentation library\n */\n schemaUrl?: string;\n}\n\n/**\n * An interface to allow the recording metrics.\n *\n * {@link Metric}s are used for recording pre-defined aggregation (`Counter`),\n * or raw values (`Histogram`) in which the aggregation and attributes\n * for the exported metric are deferred.\n */\nexport interface Meter {\n /**\n * Creates and returns a new `Gauge`.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Gauge<AttributesTypes>;\n\n /**\n * Creates and returns a new `Histogram`.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createHistogram<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Histogram<AttributesTypes>;\n\n /**\n * Creates a new `Counter` metric. Generally, this kind of metric when the\n * value is a quantity, the sum is of primary interest, and the event count\n * and value distribution are not of primary interest.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Counter<AttributesTypes>;\n\n /**\n * Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous\n * instrument and very similar to Counter except that Add(increment)\n * supports negative increments. It is generally useful for capturing changes\n * in an amount of resources used, or any quantity that rises and falls\n * during a request.\n * Example uses for UpDownCounter:\n * <ol>\n * <li> count the number of active requests. </li>\n * <li> count memory in use by instrumenting new and delete. </li>\n * <li> count queue size by instrumenting enqueue and dequeue. </li>\n * <li> count semaphore up and down operations. </li>\n * </ol>\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): UpDownCounter<AttributesTypes>;\n\n /**\n * Creates a new `ObservableGauge` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableGauge<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableGauge<AttributesTypes>;\n\n /**\n * Creates a new `ObservableCounter` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableCounter<AttributesTypes>;\n\n /**\n * Creates a new `ObservableUpDownCounter` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableUpDownCounter<AttributesTypes>;\n\n /**\n * Sets up a function that will be called whenever a metric collection is\n * initiated.\n *\n * If the function is already in the list of callbacks for this Observable,\n * the function is not added a second time.\n *\n * Only the associated observables can be observed in the callback.\n * Measurements of observables that are not associated observed in the\n * callback are dropped.\n *\n * @param callback the batch observable callback\n * @param observables the observables associated with this batch observable callback\n */\n addBatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n callback: BatchObservableCallback<AttributesTypes>,\n observables: Observable<AttributesTypes>[]\n ): void;\n\n /**\n * Removes a callback previously registered with {@link Meter.addBatchObservableCallback}.\n *\n * The callback to be removed is identified using a combination of the callback itself,\n * and the set of the observables associated with it.\n *\n * @param callback the batch observable callback\n * @param observables the observables associated with this batch observable callback\n */\n removeBatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n callback: BatchObservableCallback<AttributesTypes>,\n observables: Observable<AttributesTypes>[]\n ): void;\n}\n"]}
1
+ {"version":3,"file":"Meter.js","sourceRoot":"","sources":["../../../src/metrics/Meter.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n BatchObservableCallback,\n Counter,\n Gauge,\n Histogram,\n MetricAttributes,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n} from './Metric';\n\n/**\n * An interface describes additional metadata of a meter.\n *\n * @since 1.3.0\n */\nexport interface MeterOptions {\n /**\n * The schemaUrl of the meter or instrumentation library\n */\n schemaUrl?: string;\n}\n\n/**\n * An interface to allow the recording metrics.\n *\n * {@link Metric}s are used for recording pre-defined aggregation (`Counter`),\n * or raw values (`Histogram`) in which the aggregation and attributes\n * for the exported metric are deferred.\n *\n * @since 1.3.0\n */\nexport interface Meter {\n /**\n * Creates and returns a new `Gauge`.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Gauge<AttributesTypes>;\n\n /**\n * Creates and returns a new `Histogram`.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createHistogram<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Histogram<AttributesTypes>;\n\n /**\n * Creates a new `Counter` metric. Generally, this kind of metric when the\n * value is a quantity, the sum is of primary interest, and the event count\n * and value distribution are not of primary interest.\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(\n name: string,\n options?: MetricOptions\n ): Counter<AttributesTypes>;\n\n /**\n * Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous\n * instrument and very similar to Counter except that Add(increment)\n * supports negative increments. It is generally useful for capturing changes\n * in an amount of resources used, or any quantity that rises and falls\n * during a request.\n * Example uses for UpDownCounter:\n * <ol>\n * <li> count the number of active requests. </li>\n * <li> count memory in use by instrumenting new and delete. </li>\n * <li> count queue size by instrumenting enqueue and dequeue. </li>\n * <li> count semaphore up and down operations. </li>\n * </ol>\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): UpDownCounter<AttributesTypes>;\n\n /**\n * Creates a new `ObservableGauge` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableGauge<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableGauge<AttributesTypes>;\n\n /**\n * Creates a new `ObservableCounter` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableCounter<AttributesTypes>;\n\n /**\n * Creates a new `ObservableUpDownCounter` metric.\n *\n * The callback SHOULD be safe to be invoked concurrently.\n *\n * @param name the name of the metric.\n * @param [options] the metric options.\n */\n createObservableUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n name: string,\n options?: MetricOptions\n ): ObservableUpDownCounter<AttributesTypes>;\n\n /**\n * Sets up a function that will be called whenever a metric collection is\n * initiated.\n *\n * If the function is already in the list of callbacks for this Observable,\n * the function is not added a second time.\n *\n * Only the associated observables can be observed in the callback.\n * Measurements of observables that are not associated observed in the\n * callback are dropped.\n *\n * @param callback the batch observable callback\n * @param observables the observables associated with this batch observable callback\n */\n addBatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n callback: BatchObservableCallback<AttributesTypes>,\n observables: Observable<AttributesTypes>[]\n ): void;\n\n /**\n * Removes a callback previously registered with {@link Meter.addBatchObservableCallback}.\n *\n * The callback to be removed is identified using a combination of the callback itself,\n * and the set of the observables associated with it.\n *\n * @param callback the batch observable callback\n * @param observables the observables associated with this batch observable callback\n */\n removeBatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n >(\n callback: BatchObservableCallback<AttributesTypes>,\n observables: Observable<AttributesTypes>[]\n ): void;\n}\n"]}
@@ -1,6 +1,8 @@
1
- import { Meter, MeterOptions } from './Meter';
1
+ import type { Meter, MeterOptions } from './Meter';
2
2
  /**
3
3
  * A registry for creating named {@link Meter}s.
4
+ *
5
+ * @since 1.3.0
4
6
  */
5
7
  export interface MeterProvider {
6
8
  /**
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  //# sourceMappingURL=MeterProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/MeterProvider.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 { Meter, MeterOptions } from './Meter';\n\n/**\n * A registry for creating named {@link Meter}s.\n */\nexport interface MeterProvider {\n /**\n * Returns a Meter, creating one if one with the given name, version, and\n * schemaUrl pair is not already created.\n *\n * @param name The name of the meter or instrumentation library.\n * @param version The version of the meter or instrumentation library.\n * @param options The options of the meter or instrumentation library.\n * @returns Meter A Meter with the given name and version\n */\n getMeter(name: string, version?: string, options?: MeterOptions): Meter;\n}\n"]}
1
+ {"version":3,"file":"MeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/MeterProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Meter, MeterOptions } from './Meter';\n\n/**\n * A registry for creating named {@link Meter}s.\n *\n * @since 1.3.0\n */\nexport interface MeterProvider {\n /**\n * Returns a Meter, creating one if one with the given name, version, and\n * schemaUrl pair is not already created.\n *\n * @param name The name of the meter or instrumentation library.\n * @param version The version of the meter or instrumentation library.\n * @param options The options of the meter or instrumentation library.\n * @returns Meter A Meter with the given name and version\n */\n getMeter(name: string, version?: string, options?: MeterOptions): Meter;\n}\n"]}
@@ -1,8 +1,9 @@
1
- import { Attributes, AttributeValue } from '../common/Attributes';
2
- import { Context } from '../context/types';
3
- import { BatchObservableResult, ObservableResult } from './ObservableResult';
1
+ import type { Attributes, AttributeValue } from '../common/Attributes';
2
+ import type { Context } from '../context/types';
4
3
  /**
5
4
  * Advisory options influencing aggregation configuration parameters.
5
+ *
6
+ * @since 1.7.0
6
7
  * @experimental
7
8
  */
8
9
  export interface MetricAdvice {
@@ -14,6 +15,8 @@ export interface MetricAdvice {
14
15
  }
15
16
  /**
16
17
  * Options needed for metric creation
18
+ *
19
+ * @since 1.3.0
17
20
  */
18
21
  export interface MetricOptions {
19
22
  /**
@@ -34,10 +37,15 @@ export interface MetricOptions {
34
37
  /**
35
38
  * The advice influencing aggregation configuration parameters.
36
39
  * @experimental
40
+ * @since 1.7.0
37
41
  */
38
42
  advice?: MetricAdvice;
39
43
  }
40
- /** The Type of value. It describes how the data is reported. */
44
+ /**
45
+ * The Type of value. It describes how the data is reported.
46
+ *
47
+ * @since 1.3.0
48
+ */
41
49
  export declare enum ValueType {
42
50
  INT = 0,
43
51
  DOUBLE = 1
@@ -56,6 +64,8 @@ export declare enum ValueType {
56
64
  * <li> count the number of checkpoints run. </li>
57
65
  * <li> count the number of 5xx errors. </li>
58
66
  * <ol>
67
+ *
68
+ * @since 1.3.0
59
69
  */
60
70
  export interface Counter<AttributesTypes extends MetricAttributes = MetricAttributes> {
61
71
  /**
@@ -63,18 +73,27 @@ export interface Counter<AttributesTypes extends MetricAttributes = MetricAttrib
63
73
  */
64
74
  add(value: number, attributes?: AttributesTypes, context?: Context): void;
65
75
  }
76
+ /**
77
+ * @since 1.3.0
78
+ */
66
79
  export interface UpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> {
67
80
  /**
68
81
  * Increment value of counter by the input. Inputs may be negative.
69
82
  */
70
83
  add(value: number, attributes?: AttributesTypes, context?: Context): void;
71
84
  }
85
+ /**
86
+ * @since 1.9.0
87
+ */
72
88
  export interface Gauge<AttributesTypes extends MetricAttributes = MetricAttributes> {
73
89
  /**
74
90
  * Records a measurement.
75
91
  */
76
92
  record(value: number, attributes?: AttributesTypes, context?: Context): void;
77
93
  }
94
+ /**
95
+ * @since 1.3.0
96
+ */
78
97
  export interface Histogram<AttributesTypes extends MetricAttributes = MetricAttributes> {
79
98
  /**
80
99
  * Records a measurement. Value of the measurement must not be negative.
@@ -83,20 +102,60 @@ export interface Histogram<AttributesTypes extends MetricAttributes = MetricAttr
83
102
  }
84
103
  /**
85
104
  * @deprecated please use {@link Attributes}
105
+ * @since 1.3.0
86
106
  */
87
- export declare type MetricAttributes = Attributes;
107
+ export type MetricAttributes = Attributes;
88
108
  /**
89
109
  * @deprecated please use {@link AttributeValue}
110
+ * @since 1.3.0
90
111
  */
91
- export declare type MetricAttributeValue = AttributeValue;
112
+ export type MetricAttributeValue = AttributeValue;
113
+ /**
114
+ * Interface that is being used in callback function for Observable Metric.
115
+ *
116
+ * @since 1.3.0
117
+ */
118
+ export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
119
+ /**
120
+ * Observe a measurement of the value associated with the given attributes.
121
+ *
122
+ * @param value The value to be observed.
123
+ * @param attributes The attributes associated with the value. If more than
124
+ * one value is associated with the same attributes values, SDK may pick the
125
+ * last one or simply drop the entire observable result.
126
+ */
127
+ observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
128
+ }
129
+ /**
130
+ * Interface that is being used in batch observable callback function.
131
+ */
132
+ export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
133
+ /**
134
+ * Observe a measurement of the value associated with the given attributes.
135
+ *
136
+ * @param metric The observable metric to be observed.
137
+ * @param value The value to be observed.
138
+ * @param attributes The attributes associated with the value. If more than
139
+ * one value is associated with the same attributes values, SDK may pick the
140
+ * last one or simply drop the entire observable result.
141
+ */
142
+ observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
143
+ }
92
144
  /**
93
145
  * The observable callback for Observable instruments.
146
+ *
147
+ * @since 1.3.0
94
148
  */
95
- export declare type ObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: ObservableResult<AttributesTypes>) => void | Promise<void>;
149
+ export type ObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: ObservableResult<AttributesTypes>) => void | Promise<void>;
96
150
  /**
97
151
  * The observable callback for a batch of Observable instruments.
152
+ *
153
+ * @since 1.3.0
154
+ */
155
+ export type BatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: BatchObservableResult<AttributesTypes>) => void | Promise<void>;
156
+ /**
157
+ * @since 1.3.0
98
158
  */
99
- export declare type BatchObservableCallback<AttributesTypes extends MetricAttributes = MetricAttributes> = (observableResult: BatchObservableResult<AttributesTypes>) => void | Promise<void>;
100
159
  export interface Observable<AttributesTypes extends MetricAttributes = MetricAttributes> {
101
160
  /**
102
161
  * Sets up a function that will be called whenever a metric collection is initiated.
@@ -109,7 +168,16 @@ export interface Observable<AttributesTypes extends MetricAttributes = MetricAtt
109
168
  */
110
169
  removeCallback(callback: ObservableCallback<AttributesTypes>): void;
111
170
  }
112
- export declare type ObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
113
- export declare type ObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
114
- export declare type ObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
171
+ /**
172
+ * @since 1.3.0
173
+ */
174
+ export type ObservableCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
175
+ /**
176
+ * @since 1.3.0
177
+ */
178
+ export type ObservableUpDownCounter<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
179
+ /**
180
+ * @since 1.3.0
181
+ */
182
+ export type ObservableGauge<AttributesTypes extends MetricAttributes = MetricAttributes> = Observable<AttributesTypes>;
115
183
  //# sourceMappingURL=Metric.d.ts.map