@geekmidas/telescope 10.0.0-alpha.2 → 10.0.0-alpha.21

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 (391) hide show
  1. package/dist/{MetricsAggregator-4SqelGcG.d.cts → MetricsAggregator-BxBLQUPj.d.cts} +3 -6
  2. package/dist/MetricsAggregator-BxBLQUPj.d.cts.map +1 -0
  3. package/dist/{MetricsAggregator-DZrW8ls6.d.mts → MetricsAggregator-j9wmZ0K_.d.mts} +3 -6
  4. package/dist/MetricsAggregator-j9wmZ0K_.d.mts.map +1 -0
  5. package/dist/{Telescope-D4nmwDRA.d.cts → Telescope-BcrWTaar.d.mts} +4 -7
  6. package/dist/Telescope-BcrWTaar.d.mts.map +1 -0
  7. package/dist/{Telescope-Dl6VSfxd.d.mts → Telescope-DnCMZT7V.d.cts} +4 -7
  8. package/dist/Telescope-DnCMZT7V.d.cts.map +1 -0
  9. package/dist/Telescope.cjs +385 -4
  10. package/dist/Telescope.cjs.map +1 -0
  11. package/dist/Telescope.d.cts +1 -3
  12. package/dist/Telescope.d.mts +1 -3
  13. package/dist/Telescope.mjs +384 -4
  14. package/dist/Telescope.mjs.map +1 -0
  15. package/dist/adapters/index.d.cts +2 -2
  16. package/dist/adapters/index.d.mts +2 -2
  17. package/dist/adapters/index.mjs +1 -0
  18. package/dist/adapters/lambda.cjs +9 -10
  19. package/dist/adapters/lambda.cjs.map +1 -1
  20. package/dist/adapters/lambda.d.cts +9 -13
  21. package/dist/adapters/lambda.d.cts.map +1 -1
  22. package/dist/adapters/lambda.d.mts +9 -13
  23. package/dist/adapters/lambda.d.mts.map +1 -1
  24. package/dist/adapters/lambda.mjs +3 -4
  25. package/dist/adapters/lambda.mjs.map +1 -1
  26. package/dist/adapters/middy.cjs +236 -4
  27. package/dist/adapters/middy.cjs.map +1 -0
  28. package/dist/adapters/middy.d.cts +60 -5
  29. package/dist/adapters/middy.d.cts.map +1 -0
  30. package/dist/adapters/middy.d.mts +60 -5
  31. package/dist/adapters/middy.d.mts.map +1 -0
  32. package/dist/adapters/middy.mjs +234 -3
  33. package/dist/adapters/middy.mjs.map +1 -0
  34. package/dist/adapters/types.d.cts +162 -2
  35. package/dist/adapters/types.d.cts.map +1 -0
  36. package/dist/adapters/types.d.mts +162 -2
  37. package/dist/adapters/types.d.mts.map +1 -0
  38. package/dist/adapters/types.mjs +1 -0
  39. package/dist/core.cjs +22 -22
  40. package/dist/core.d.cts +4 -4
  41. package/dist/core.d.mts +4 -4
  42. package/dist/core.mjs +3 -4
  43. package/dist/index.cjs +8 -9
  44. package/dist/index.d.cts +5 -6
  45. package/dist/index.d.mts +5 -6
  46. package/dist/index.mjs +5 -7
  47. package/dist/instrumentation/core.cjs +147 -11
  48. package/dist/instrumentation/core.cjs.map +1 -0
  49. package/dist/instrumentation/core.d.cts +74 -3
  50. package/dist/instrumentation/core.d.cts.map +1 -0
  51. package/dist/instrumentation/core.d.mts +74 -3
  52. package/dist/instrumentation/core.d.mts.map +1 -0
  53. package/dist/instrumentation/core.mjs +137 -2
  54. package/dist/instrumentation/core.mjs.map +1 -0
  55. package/dist/instrumentation/hono.cjs +134 -6
  56. package/dist/instrumentation/hono.cjs.map +1 -0
  57. package/dist/instrumentation/hono.d.cts +67 -2
  58. package/dist/instrumentation/hono.d.cts.map +1 -0
  59. package/dist/instrumentation/hono.d.mts +67 -2
  60. package/dist/instrumentation/hono.d.mts.map +1 -0
  61. package/dist/instrumentation/hono.mjs +130 -3
  62. package/dist/instrumentation/hono.mjs.map +1 -0
  63. package/dist/instrumentation/http.cjs +164 -11
  64. package/dist/instrumentation/http.cjs.map +1 -0
  65. package/dist/instrumentation/http.d.cts +103 -2
  66. package/dist/instrumentation/http.d.cts.map +1 -0
  67. package/dist/instrumentation/http.d.mts +103 -2
  68. package/dist/instrumentation/http.d.mts.map +1 -0
  69. package/dist/instrumentation/http.mjs +154 -2
  70. package/dist/instrumentation/http.mjs.map +1 -0
  71. package/dist/instrumentation/index.cjs +47 -47
  72. package/dist/instrumentation/index.d.cts +9 -9
  73. package/dist/instrumentation/index.d.mts +9 -9
  74. package/dist/instrumentation/index.mjs +8 -9
  75. package/dist/instrumentation/middleware.cjs +162 -6
  76. package/dist/instrumentation/middleware.cjs.map +1 -0
  77. package/dist/instrumentation/middleware.d.cts +70 -2
  78. package/dist/instrumentation/middleware.d.cts.map +1 -0
  79. package/dist/instrumentation/middleware.d.mts +70 -2
  80. package/dist/instrumentation/middleware.d.mts.map +1 -0
  81. package/dist/instrumentation/middleware.mjs +158 -3
  82. package/dist/instrumentation/middleware.mjs.map +1 -0
  83. package/dist/instrumentation/otel.cjs +137 -3
  84. package/dist/instrumentation/otel.cjs.map +1 -0
  85. package/dist/instrumentation/otel.d.cts +97 -2
  86. package/dist/instrumentation/otel.d.cts.map +1 -0
  87. package/dist/instrumentation/otel.d.mts +97 -2
  88. package/dist/instrumentation/otel.d.mts.map +1 -0
  89. package/dist/instrumentation/otel.mjs +136 -3
  90. package/dist/instrumentation/otel.mjs.map +1 -0
  91. package/dist/instrumentation/setup.cjs +100 -4
  92. package/dist/instrumentation/setup.cjs.map +1 -0
  93. package/dist/instrumentation/setup.d.cts +83 -3
  94. package/dist/instrumentation/setup.d.cts.map +1 -0
  95. package/dist/instrumentation/setup.d.mts +83 -3
  96. package/dist/instrumentation/setup.d.mts.map +1 -0
  97. package/dist/instrumentation/setup.mjs +98 -3
  98. package/dist/instrumentation/setup.mjs.map +1 -0
  99. package/dist/instrumentation/tracing.cjs +114 -10
  100. package/dist/instrumentation/tracing.cjs.map +1 -0
  101. package/dist/instrumentation/tracing.d.cts +49 -2
  102. package/dist/instrumentation/tracing.d.cts.map +1 -0
  103. package/dist/instrumentation/tracing.d.mts +49 -2
  104. package/dist/instrumentation/tracing.d.mts.map +1 -0
  105. package/dist/instrumentation/tracing.mjs +105 -2
  106. package/dist/instrumentation/tracing.mjs.map +1 -0
  107. package/dist/logger/console.cjs +18 -12
  108. package/dist/logger/console.cjs.map +1 -1
  109. package/dist/logger/console.d.cts +7 -10
  110. package/dist/logger/console.d.cts.map +1 -1
  111. package/dist/logger/console.d.mts +7 -10
  112. package/dist/logger/console.d.mts.map +1 -1
  113. package/dist/logger/console.mjs +17 -11
  114. package/dist/logger/console.mjs.map +1 -1
  115. package/dist/logger/pino.cjs +6 -5
  116. package/dist/logger/pino.cjs.map +1 -1
  117. package/dist/logger/pino.d.cts +6 -10
  118. package/dist/logger/pino.d.cts.map +1 -1
  119. package/dist/logger/pino.d.mts +6 -10
  120. package/dist/logger/pino.d.mts.map +1 -1
  121. package/dist/logger/pino.mjs +2 -3
  122. package/dist/logger/pino.mjs.map +1 -1
  123. package/dist/metrics/MetricsAggregator.cjs +354 -2
  124. package/dist/metrics/MetricsAggregator.cjs.map +1 -0
  125. package/dist/metrics/MetricsAggregator.d.cts +1 -2
  126. package/dist/metrics/MetricsAggregator.d.mts +1 -2
  127. package/dist/metrics/MetricsAggregator.mjs +353 -2
  128. package/dist/metrics/MetricsAggregator.mjs.map +1 -0
  129. package/dist/metrics/index.cjs +3 -4
  130. package/dist/metrics/index.d.cts +2 -4
  131. package/dist/metrics/index.d.mts +2 -4
  132. package/dist/metrics/index.mjs +2 -4
  133. package/dist/metrics/storage/InMemoryMetricsStorage.cjs +240 -3
  134. package/dist/metrics/storage/InMemoryMetricsStorage.cjs.map +1 -0
  135. package/dist/metrics/storage/InMemoryMetricsStorage.d.cts +43 -4
  136. package/dist/metrics/storage/InMemoryMetricsStorage.d.cts.map +1 -0
  137. package/dist/metrics/storage/InMemoryMetricsStorage.d.mts +43 -4
  138. package/dist/metrics/storage/InMemoryMetricsStorage.d.mts.map +1 -0
  139. package/dist/metrics/storage/InMemoryMetricsStorage.mjs +239 -3
  140. package/dist/metrics/storage/InMemoryMetricsStorage.mjs.map +1 -0
  141. package/dist/metrics/storage/MetricsStorage.cjs +0 -1
  142. package/dist/metrics/storage/MetricsStorage.d.cts +56 -3
  143. package/dist/metrics/storage/MetricsStorage.d.cts.map +1 -0
  144. package/dist/metrics/storage/MetricsStorage.d.mts +56 -3
  145. package/dist/metrics/storage/MetricsStorage.d.mts.map +1 -0
  146. package/dist/metrics/storage/MetricsStorage.mjs +1 -1
  147. package/dist/metrics/storage/index.cjs +6 -6
  148. package/dist/metrics/storage/index.d.cts +3 -3
  149. package/dist/metrics/storage/index.d.mts +3 -3
  150. package/dist/metrics/storage/index.mjs +4 -5
  151. package/dist/metrics/storage/types.cjs +34 -2
  152. package/dist/metrics/storage/types.cjs.map +1 -0
  153. package/dist/metrics/storage/types.d.cts +207 -2
  154. package/dist/metrics/storage/types.d.cts.map +1 -0
  155. package/dist/metrics/storage/types.d.mts +207 -2
  156. package/dist/metrics/storage/types.d.mts.map +1 -0
  157. package/dist/metrics/storage/types.mjs +33 -2
  158. package/dist/metrics/storage/types.mjs.map +1 -0
  159. package/dist/otlp/hono.cjs +9 -15
  160. package/dist/otlp/hono.cjs.map +1 -1
  161. package/dist/otlp/hono.d.cts +3 -13
  162. package/dist/otlp/hono.d.cts.map +1 -1
  163. package/dist/otlp/hono.d.mts +3 -13
  164. package/dist/otlp/hono.d.mts.map +1 -1
  165. package/dist/otlp/hono.mjs +5 -11
  166. package/dist/otlp/hono.mjs.map +1 -1
  167. package/dist/otlp/index.cjs +11 -11
  168. package/dist/otlp/index.d.cts +4 -7
  169. package/dist/otlp/index.d.mts +4 -7
  170. package/dist/otlp/index.mjs +4 -5
  171. package/dist/otlp/receiver.cjs +88 -4
  172. package/dist/otlp/receiver.cjs.map +1 -0
  173. package/dist/otlp/receiver.d.cts +59 -7
  174. package/dist/otlp/receiver.d.cts.map +1 -0
  175. package/dist/otlp/receiver.d.mts +59 -7
  176. package/dist/otlp/receiver.d.mts.map +1 -0
  177. package/dist/otlp/receiver.mjs +87 -4
  178. package/dist/otlp/receiver.mjs.map +1 -0
  179. package/dist/otlp/transformer.cjs +214 -5
  180. package/dist/otlp/transformer.cjs.map +1 -0
  181. package/dist/otlp/transformer.d.cts +1 -3
  182. package/dist/otlp/transformer.d.mts +1 -3
  183. package/dist/otlp/transformer.mjs +211 -3
  184. package/dist/otlp/transformer.mjs.map +1 -0
  185. package/dist/otlp/types.cjs +57 -5
  186. package/dist/otlp/types.cjs.map +1 -0
  187. package/dist/otlp/types.d.cts +1 -1
  188. package/dist/otlp/types.d.mts +1 -1
  189. package/dist/otlp/types.mjs +53 -2
  190. package/dist/otlp/types.mjs.map +1 -0
  191. package/dist/redact.cjs +84 -3
  192. package/dist/redact.cjs.map +1 -0
  193. package/dist/redact.d.cts +4 -8
  194. package/dist/redact.d.cts.map +1 -1
  195. package/dist/redact.d.mts +4 -8
  196. package/dist/redact.d.mts.map +1 -1
  197. package/dist/redact.mjs +80 -2
  198. package/dist/redact.mjs.map +1 -0
  199. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-VH7oDXx4.cjs} +8 -10
  200. package/dist/server/hono.cjs +24 -33
  201. package/dist/server/hono.cjs.map +1 -1
  202. package/dist/server/hono.d.cts +10 -13
  203. package/dist/server/hono.d.cts.map +1 -1
  204. package/dist/server/hono.d.mts +10 -13
  205. package/dist/server/hono.d.mts.map +1 -1
  206. package/dist/server/hono.mjs +22 -31
  207. package/dist/server/hono.mjs.map +1 -1
  208. package/dist/storage/kysely.cjs +34 -32
  209. package/dist/storage/kysely.cjs.map +1 -1
  210. package/dist/storage/kysely.d.cts +8 -12
  211. package/dist/storage/kysely.d.cts.map +1 -1
  212. package/dist/storage/kysely.d.mts +8 -12
  213. package/dist/storage/kysely.d.mts.map +1 -1
  214. package/dist/storage/kysely.mjs +33 -31
  215. package/dist/storage/kysely.mjs.map +1 -1
  216. package/dist/storage/memory.cjs +122 -2
  217. package/dist/storage/memory.cjs.map +1 -0
  218. package/dist/storage/memory.d.cts +36 -3
  219. package/dist/storage/memory.d.cts.map +1 -0
  220. package/dist/storage/memory.d.mts +36 -3
  221. package/dist/storage/memory.d.mts.map +1 -0
  222. package/dist/storage/memory.mjs +121 -2
  223. package/dist/storage/memory.mjs.map +1 -0
  224. package/dist/{transformer-CTGsaVfV.d.mts → transformer-BBBXCjHP.d.mts} +4 -8
  225. package/dist/transformer-BBBXCjHP.d.mts.map +1 -0
  226. package/dist/{transformer-ICEbxpFf.d.cts → transformer-DlESim6Q.d.cts} +4 -8
  227. package/dist/transformer-DlESim6Q.d.cts.map +1 -0
  228. package/dist/{types-CmOB7CLO.d.cts → types-DVETVdpa.d.cts} +6 -7
  229. package/dist/types-DVETVdpa.d.cts.map +1 -0
  230. package/dist/{types-DBc0q5KD.d.mts → types-DVETVdpa.d.mts} +6 -7
  231. package/dist/types-DVETVdpa.d.mts.map +1 -0
  232. package/dist/{types-B1EIa_cQ.d.mts → types-a9Vistj1.d.cts} +2 -3
  233. package/dist/types-a9Vistj1.d.cts.map +1 -0
  234. package/dist/{types-l7Rlb5Mg.d.cts → types-a9Vistj1.d.mts} +2 -3
  235. package/dist/types-a9Vistj1.d.mts.map +1 -0
  236. package/dist/types.d.cts +1 -1
  237. package/dist/types.d.mts +1 -1
  238. package/dist/types.mjs +1 -0
  239. package/dist/ui-assets.cjs +31 -4
  240. package/dist/ui-assets.cjs.map +1 -0
  241. package/dist/ui-assets.d.cts +4 -6
  242. package/dist/ui-assets.d.cts.map +1 -1
  243. package/dist/ui-assets.d.mts +4 -6
  244. package/dist/ui-assets.d.mts.map +1 -1
  245. package/dist/ui-assets.mjs +28 -2
  246. package/dist/ui-assets.mjs.map +1 -0
  247. package/package.json +39 -37
  248. package/dist/InMemoryMetricsStorage-BbKCL3YL.d.mts +0 -47
  249. package/dist/InMemoryMetricsStorage-BbKCL3YL.d.mts.map +0 -1
  250. package/dist/InMemoryMetricsStorage-C4drxT7G.mjs +0 -247
  251. package/dist/InMemoryMetricsStorage-C4drxT7G.mjs.map +0 -1
  252. package/dist/InMemoryMetricsStorage-D0njWUSi.cjs +0 -252
  253. package/dist/InMemoryMetricsStorage-D0njWUSi.cjs.map +0 -1
  254. package/dist/InMemoryMetricsStorage-TvPdZjL0.d.cts +0 -47
  255. package/dist/InMemoryMetricsStorage-TvPdZjL0.d.cts.map +0 -1
  256. package/dist/MetricsAggregator-4SqelGcG.d.cts.map +0 -1
  257. package/dist/MetricsAggregator-B7lUICdH.cjs +0 -363
  258. package/dist/MetricsAggregator-B7lUICdH.cjs.map +0 -1
  259. package/dist/MetricsAggregator-DZrW8ls6.d.mts.map +0 -1
  260. package/dist/MetricsAggregator-S3DQWNas.mjs +0 -357
  261. package/dist/MetricsAggregator-S3DQWNas.mjs.map +0 -1
  262. package/dist/MetricsStorage-B86e4131.d.cts +0 -60
  263. package/dist/MetricsStorage-B86e4131.d.cts.map +0 -1
  264. package/dist/MetricsStorage-BWyP2_12.d.mts +0 -60
  265. package/dist/MetricsStorage-BWyP2_12.d.mts.map +0 -1
  266. package/dist/MetricsStorage-BypQXWiv.mjs +0 -0
  267. package/dist/MetricsStorage-Or8pVCe4.cjs +0 -0
  268. package/dist/Telescope-Cs3fv8jt.cjs +0 -395
  269. package/dist/Telescope-Cs3fv8jt.cjs.map +0 -1
  270. package/dist/Telescope-D4nmwDRA.d.cts.map +0 -1
  271. package/dist/Telescope-Dh5av3FC.mjs +0 -389
  272. package/dist/Telescope-Dh5av3FC.mjs.map +0 -1
  273. package/dist/Telescope-Dl6VSfxd.d.mts.map +0 -1
  274. package/dist/core--quSp5Qr.d.mts +0 -78
  275. package/dist/core--quSp5Qr.d.mts.map +0 -1
  276. package/dist/core-B4Jpia5H.d.cts +0 -78
  277. package/dist/core-B4Jpia5H.d.cts.map +0 -1
  278. package/dist/core-CtVHRJGv.cjs +0 -199
  279. package/dist/core-CtVHRJGv.cjs.map +0 -1
  280. package/dist/core-D6hJ6exL.mjs +0 -139
  281. package/dist/core-D6hJ6exL.mjs.map +0 -1
  282. package/dist/hono--uKQ7Jgi.d.mts +0 -71
  283. package/dist/hono--uKQ7Jgi.d.mts.map +0 -1
  284. package/dist/hono-Bw-ey6CT.mjs +0 -136
  285. package/dist/hono-Bw-ey6CT.mjs.map +0 -1
  286. package/dist/hono-CPHX7FAm.cjs +0 -160
  287. package/dist/hono-CPHX7FAm.cjs.map +0 -1
  288. package/dist/hono-CemCKU87.d.cts +0 -71
  289. package/dist/hono-CemCKU87.d.cts.map +0 -1
  290. package/dist/http-BIvr0YdI.mjs +0 -159
  291. package/dist/http-BIvr0YdI.mjs.map +0 -1
  292. package/dist/http-BiNtg85L.d.mts +0 -107
  293. package/dist/http-BiNtg85L.d.mts.map +0 -1
  294. package/dist/http-BsqmhurZ.cjs +0 -219
  295. package/dist/http-BsqmhurZ.cjs.map +0 -1
  296. package/dist/http-D1oTbfap.d.cts +0 -107
  297. package/dist/http-D1oTbfap.d.cts.map +0 -1
  298. package/dist/index-BL32-cvv.d.cts +0 -1
  299. package/dist/index-CsuikFeJ.d.mts +0 -1
  300. package/dist/memory--BK4iWiv.d.cts +0 -40
  301. package/dist/memory--BK4iWiv.d.cts.map +0 -1
  302. package/dist/memory-6S9H-IF5.mjs +0 -123
  303. package/dist/memory-6S9H-IF5.mjs.map +0 -1
  304. package/dist/memory-B0d_n1g5.cjs +0 -129
  305. package/dist/memory-B0d_n1g5.cjs.map +0 -1
  306. package/dist/memory-DCirEVFW.d.mts +0 -40
  307. package/dist/memory-DCirEVFW.d.mts.map +0 -1
  308. package/dist/metrics-D5YT-Rnq.mjs +0 -0
  309. package/dist/metrics-fhD3l3C3.cjs +0 -0
  310. package/dist/middleware-Bcq6XXGG.cjs +0 -184
  311. package/dist/middleware-Bcq6XXGG.cjs.map +0 -1
  312. package/dist/middleware-D1XEHvyy.mjs +0 -160
  313. package/dist/middleware-D1XEHvyy.mjs.map +0 -1
  314. package/dist/middleware-PeyS-9Ny.d.cts +0 -74
  315. package/dist/middleware-PeyS-9Ny.d.cts.map +0 -1
  316. package/dist/middleware-oHvo_ZgU.d.mts +0 -74
  317. package/dist/middleware-oHvo_ZgU.d.mts.map +0 -1
  318. package/dist/middy-B6Btl8XE.d.mts +0 -64
  319. package/dist/middy-B6Btl8XE.d.mts.map +0 -1
  320. package/dist/middy-Bq0defVg.d.cts +0 -64
  321. package/dist/middy-Bq0defVg.d.cts.map +0 -1
  322. package/dist/middy-DHWLmUAD.mjs +0 -236
  323. package/dist/middy-DHWLmUAD.mjs.map +0 -1
  324. package/dist/middy-DlWnZilH.cjs +0 -247
  325. package/dist/middy-DlWnZilH.cjs.map +0 -1
  326. package/dist/otel-B9bNoeZ2.mjs +0 -130
  327. package/dist/otel-B9bNoeZ2.mjs.map +0 -1
  328. package/dist/otel-Bk89b1lX.d.cts +0 -101
  329. package/dist/otel-Bk89b1lX.d.cts.map +0 -1
  330. package/dist/otel-BzjOtVxZ.cjs +0 -136
  331. package/dist/otel-BzjOtVxZ.cjs.map +0 -1
  332. package/dist/otel-lPMsM26e.d.mts +0 -101
  333. package/dist/otel-lPMsM26e.d.mts.map +0 -1
  334. package/dist/receiver-D46dfkYI.mjs +0 -89
  335. package/dist/receiver-D46dfkYI.mjs.map +0 -1
  336. package/dist/receiver-DLICx5uU.d.cts +0 -63
  337. package/dist/receiver-DLICx5uU.d.cts.map +0 -1
  338. package/dist/receiver-UeZT-H8u.d.mts +0 -63
  339. package/dist/receiver-UeZT-H8u.d.mts.map +0 -1
  340. package/dist/receiver-slCoAFat.cjs +0 -94
  341. package/dist/receiver-slCoAFat.cjs.map +0 -1
  342. package/dist/redact-BzkITCNW.mjs +0 -83
  343. package/dist/redact-BzkITCNW.mjs.map +0 -1
  344. package/dist/redact-DVaSSPZT.cjs +0 -95
  345. package/dist/redact-DVaSSPZT.cjs.map +0 -1
  346. package/dist/setup-Bkxm4g6b.d.mts +0 -87
  347. package/dist/setup-Bkxm4g6b.d.mts.map +0 -1
  348. package/dist/setup-D58N1f9O.d.cts +0 -87
  349. package/dist/setup-D58N1f9O.d.cts.map +0 -1
  350. package/dist/setup-DC9JMEYZ.mjs +0 -98
  351. package/dist/setup-DC9JMEYZ.mjs.map +0 -1
  352. package/dist/setup-DufxQpi9.cjs +0 -110
  353. package/dist/setup-DufxQpi9.cjs.map +0 -1
  354. package/dist/tracing-BX8uY2nR.d.cts +0 -53
  355. package/dist/tracing-BX8uY2nR.d.cts.map +0 -1
  356. package/dist/tracing-Bt1zWRlb.cjs +0 -167
  357. package/dist/tracing-Bt1zWRlb.cjs.map +0 -1
  358. package/dist/tracing-Cijm_5NI.mjs +0 -113
  359. package/dist/tracing-Cijm_5NI.mjs.map +0 -1
  360. package/dist/tracing-PnECEbEu.d.mts +0 -53
  361. package/dist/tracing-PnECEbEu.d.mts.map +0 -1
  362. package/dist/transformer-CFQ4WFk6.mjs +0 -215
  363. package/dist/transformer-CFQ4WFk6.mjs.map +0 -1
  364. package/dist/transformer-CTGsaVfV.d.mts.map +0 -1
  365. package/dist/transformer-Csl6fbgv.cjs +0 -232
  366. package/dist/transformer-Csl6fbgv.cjs.map +0 -1
  367. package/dist/transformer-ICEbxpFf.d.cts.map +0 -1
  368. package/dist/types-B1EIa_cQ.d.mts.map +0 -1
  369. package/dist/types-BMiHgsi4.cjs +0 -78
  370. package/dist/types-BMiHgsi4.cjs.map +0 -1
  371. package/dist/types-BRzW1NM8.d.cts +0 -166
  372. package/dist/types-BRzW1NM8.d.cts.map +0 -1
  373. package/dist/types-BS3Rx8Sk.d.cts +0 -209
  374. package/dist/types-BS3Rx8Sk.d.cts.map +0 -1
  375. package/dist/types-BzQ78Efw.d.mts +0 -166
  376. package/dist/types-BzQ78Efw.d.mts.map +0 -1
  377. package/dist/types-CbNGXnJE.d.mts +0 -209
  378. package/dist/types-CbNGXnJE.d.mts.map +0 -1
  379. package/dist/types-Cj59nqy7.mjs +0 -54
  380. package/dist/types-Cj59nqy7.mjs.map +0 -1
  381. package/dist/types-CmOB7CLO.d.cts.map +0 -1
  382. package/dist/types-DBc0q5KD.d.mts.map +0 -1
  383. package/dist/types-ZW-nfWf6.cjs +0 -40
  384. package/dist/types-ZW-nfWf6.cjs.map +0 -1
  385. package/dist/types-l7Rlb5Mg.d.cts.map +0 -1
  386. package/dist/types-ojhnLdwz.mjs +0 -34
  387. package/dist/types-ojhnLdwz.mjs.map +0 -1
  388. package/dist/ui-assets-BEXqOQLe.cjs +0 -48
  389. package/dist/ui-assets-BEXqOQLe.cjs.map +0 -1
  390. package/dist/ui-assets-BhTDUsrM.mjs +0 -30
  391. package/dist/ui-assets-BhTDUsrM.mjs.map +0 -1
@@ -1,3 +1,83 @@
1
- import "../types-BRzW1NM8.cjs";
2
- import { TelemetryOptions, setupTelemetry, shutdownTelemetry } from "../setup-D58N1f9O.cjs";
3
- export { TelemetryOptions, setupTelemetry, shutdownTelemetry };
1
+ import { SpanProcessorStrategy } from "../adapters/types.cjs";
2
+ //#region src/instrumentation/setup.d.ts
3
+ /**
4
+ * Options for configuring telemetry
5
+ */
6
+ export interface TelemetryOptions {
7
+ /**
8
+ * Service name for resource identification
9
+ */
10
+ serviceName: string;
11
+ /**
12
+ * Service version
13
+ */
14
+ serviceVersion?: string;
15
+ /**
16
+ * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')
17
+ * If not provided, traces will be logged to console
18
+ */
19
+ endpoint?: string;
20
+ /**
21
+ * Whether to instrument Pino for log correlation
22
+ * @default true
23
+ */
24
+ instrumentPino?: boolean;
25
+ /**
26
+ * Whether to enable auto-instrumentation for common libraries
27
+ * (http, fetch, express, etc.)
28
+ * @default true
29
+ */
30
+ autoInstrument?: boolean;
31
+ /**
32
+ * Enable debug logging for OTel SDK
33
+ * @default false
34
+ */
35
+ debug?: boolean;
36
+ /**
37
+ * Additional resource attributes
38
+ */
39
+ resourceAttributes?: Record<string, string>;
40
+ /**
41
+ * Headers to send with OTLP requests
42
+ */
43
+ headers?: Record<string, string>;
44
+ /**
45
+ * Span processor strategy.
46
+ * - 'batch': Efficient batching for long-running servers (default)
47
+ * - 'simple': Immediate export for serverless environments (Lambda, Edge)
48
+ *
49
+ * If not specified, automatically selected based on environment detection.
50
+ */
51
+ spanProcessorStrategy?: SpanProcessorStrategy;
52
+ /**
53
+ * Environment type for automatic configuration
54
+ * @default 'server'
55
+ */
56
+ environment?: 'server' | 'lambda' | 'edge' | 'custom';
57
+ }
58
+ /**
59
+ * Set up OpenTelemetry instrumentation.
60
+ * Call this BEFORE importing your application code.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * // instrumentation.ts (create this file)
65
+ * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';
66
+ *
67
+ * setupTelemetry({
68
+ * serviceName: 'my-api',
69
+ * endpoint: 'http://localhost:3000/__telescope/v1',
70
+ * });
71
+ *
72
+ * // Then in your entry point:
73
+ * // import './instrumentation';
74
+ * // import { app } from './app';
75
+ * ```
76
+ */
77
+ export declare function setupTelemetry(options: TelemetryOptions): void;
78
+ /**
79
+ * Shut down telemetry (for testing or graceful shutdown)
80
+ */
81
+ export declare function shutdownTelemetry(): Promise<void>;
82
+ //#endregion
83
+ //# sourceMappingURL=setup.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.cts","names":[],"sources":["../../src/instrumentation/setup.ts"],"mappings":";;;;;iBA8BiB;;;;EAIhB;;;;EAKA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;EAKA,qBAAqB;;;;EAKrB,UAAU;;;;;;;;EASV,wBAAwB;;;;;EAMxB;;;;;;;;;;;;;;;;;;;;;wBAwBe,eAAe,SAAS;;;;wBA0IlB,qBAAqB"}
@@ -1,3 +1,83 @@
1
- import "../types-BzQ78Efw.mjs";
2
- import { TelemetryOptions, setupTelemetry, shutdownTelemetry } from "../setup-Bkxm4g6b.mjs";
3
- export { TelemetryOptions, setupTelemetry, shutdownTelemetry };
1
+ import { SpanProcessorStrategy } from "../adapters/types.mjs";
2
+ //#region src/instrumentation/setup.d.ts
3
+ /**
4
+ * Options for configuring telemetry
5
+ */
6
+ export interface TelemetryOptions {
7
+ /**
8
+ * Service name for resource identification
9
+ */
10
+ serviceName: string;
11
+ /**
12
+ * Service version
13
+ */
14
+ serviceVersion?: string;
15
+ /**
16
+ * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')
17
+ * If not provided, traces will be logged to console
18
+ */
19
+ endpoint?: string;
20
+ /**
21
+ * Whether to instrument Pino for log correlation
22
+ * @default true
23
+ */
24
+ instrumentPino?: boolean;
25
+ /**
26
+ * Whether to enable auto-instrumentation for common libraries
27
+ * (http, fetch, express, etc.)
28
+ * @default true
29
+ */
30
+ autoInstrument?: boolean;
31
+ /**
32
+ * Enable debug logging for OTel SDK
33
+ * @default false
34
+ */
35
+ debug?: boolean;
36
+ /**
37
+ * Additional resource attributes
38
+ */
39
+ resourceAttributes?: Record<string, string>;
40
+ /**
41
+ * Headers to send with OTLP requests
42
+ */
43
+ headers?: Record<string, string>;
44
+ /**
45
+ * Span processor strategy.
46
+ * - 'batch': Efficient batching for long-running servers (default)
47
+ * - 'simple': Immediate export for serverless environments (Lambda, Edge)
48
+ *
49
+ * If not specified, automatically selected based on environment detection.
50
+ */
51
+ spanProcessorStrategy?: SpanProcessorStrategy;
52
+ /**
53
+ * Environment type for automatic configuration
54
+ * @default 'server'
55
+ */
56
+ environment?: 'server' | 'lambda' | 'edge' | 'custom';
57
+ }
58
+ /**
59
+ * Set up OpenTelemetry instrumentation.
60
+ * Call this BEFORE importing your application code.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * // instrumentation.ts (create this file)
65
+ * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';
66
+ *
67
+ * setupTelemetry({
68
+ * serviceName: 'my-api',
69
+ * endpoint: 'http://localhost:3000/__telescope/v1',
70
+ * });
71
+ *
72
+ * // Then in your entry point:
73
+ * // import './instrumentation';
74
+ * // import { app } from './app';
75
+ * ```
76
+ */
77
+ export declare function setupTelemetry(options: TelemetryOptions): void;
78
+ /**
79
+ * Shut down telemetry (for testing or graceful shutdown)
80
+ */
81
+ export declare function shutdownTelemetry(): Promise<void>;
82
+ //#endregion
83
+ //# sourceMappingURL=setup.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.mts","names":[],"sources":["../../src/instrumentation/setup.ts"],"mappings":";;;;;iBA8BiB;;;;EAIhB;;;;EAKA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;EAMA;;;;EAKA,qBAAqB;;;;EAKrB,UAAU;;;;;;;;EASV,wBAAwB;;;;;EAMxB;;;;;;;;;;;;;;;;;;;;;wBAwBe,eAAe,SAAS;;;;wBA0IlB,qBAAqB"}
@@ -1,4 +1,99 @@
1
- import "../core-D6hJ6exL.mjs";
2
- import { setupTelemetry, shutdownTelemetry } from "../setup-DC9JMEYZ.mjs";
1
+ import { createSpanProcessor, getRecommendedStrategy, setGlobalLogProcessor, setGlobalSpanProcessor } from "./core.mjs";
2
+ import { DiagConsoleLogger, DiagLogLevel, diag } from "@opentelemetry/api";
3
+ import { getNodeAutoInstrumentations } from "@opentelemetry/auto-instrumentations-node";
4
+ import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
5
+ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
6
+ import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino";
7
+ import { resourceFromAttributes } from "@opentelemetry/resources";
8
+ import { BatchLogRecordProcessor, LoggerProvider } from "@opentelemetry/sdk-logs";
9
+ import { NodeSDK } from "@opentelemetry/sdk-node";
10
+ import { ConsoleSpanExporter } from "@opentelemetry/sdk-trace-node";
11
+ import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
12
+ //#region src/instrumentation/setup.ts
13
+ let sdk = null;
14
+ /**
15
+ * Set up OpenTelemetry instrumentation.
16
+ * Call this BEFORE importing your application code.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // instrumentation.ts (create this file)
21
+ * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';
22
+ *
23
+ * setupTelemetry({
24
+ * serviceName: 'my-api',
25
+ * endpoint: 'http://localhost:3000/__telescope/v1',
26
+ * });
27
+ *
28
+ * // Then in your entry point:
29
+ * // import './instrumentation';
30
+ * // import { app } from './app';
31
+ * ```
32
+ */
33
+ function setupTelemetry(options) {
34
+ if (sdk) return;
35
+ const { serviceName, serviceVersion = "1.0.0", endpoint, instrumentPino = true, autoInstrument = true, debug = false, resourceAttributes = {}, headers = {}, spanProcessorStrategy, environment = "server" } = options;
36
+ if (debug) diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
37
+ const resource = resourceFromAttributes({
38
+ [ATTR_SERVICE_NAME]: serviceName,
39
+ [ATTR_SERVICE_VERSION]: serviceVersion,
40
+ ...resourceAttributes
41
+ });
42
+ const instrumentations = [];
43
+ if (instrumentPino) instrumentations.push(new PinoInstrumentation({ logHook: (span, record) => {
44
+ record.trace_id = span.spanContext().traceId;
45
+ record.span_id = span.spanContext().spanId;
46
+ record.trace_flags = span.spanContext().traceFlags;
47
+ } }));
48
+ if (autoInstrument) instrumentations.push(getNodeAutoInstrumentations({
49
+ "@opentelemetry/instrumentation-fs": { enabled: false },
50
+ "@opentelemetry/instrumentation-http": { ignoreIncomingRequestHook: (request) => {
51
+ const path = request.url || "";
52
+ return path.includes("/__health") || path.includes("/__telescope") || path.includes("/favicon");
53
+ } }
54
+ }));
55
+ let traceExporter;
56
+ if (endpoint) traceExporter = new OTLPTraceExporter({
57
+ url: `${endpoint}/traces`,
58
+ headers
59
+ });
60
+ else traceExporter = new ConsoleSpanExporter();
61
+ const strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);
62
+ const spanProcessor = createSpanProcessor(traceExporter, { strategy });
63
+ setGlobalSpanProcessor(spanProcessor);
64
+ sdk = new NodeSDK({
65
+ resource,
66
+ traceExporter,
67
+ spanProcessors: [spanProcessor],
68
+ instrumentations
69
+ });
70
+ if (endpoint) {
71
+ const logExporter = new OTLPLogExporter({
72
+ url: `${endpoint}/logs`,
73
+ headers
74
+ });
75
+ const logProcessor = new BatchLogRecordProcessor({ exporter: logExporter });
76
+ new LoggerProvider({
77
+ resource,
78
+ processors: [logProcessor]
79
+ });
80
+ setGlobalLogProcessor(logProcessor);
81
+ }
82
+ sdk.start();
83
+ process.on("SIGTERM", () => {
84
+ sdk?.shutdown().then(() => {}).catch((_error) => {}).finally(() => process.exit(0));
85
+ });
86
+ }
87
+ /**
88
+ * Shut down telemetry (for testing or graceful shutdown)
89
+ */
90
+ async function shutdownTelemetry() {
91
+ if (sdk) {
92
+ await sdk.shutdown();
93
+ sdk = null;
94
+ }
95
+ }
96
+ //#endregion
97
+ export { setupTelemetry, shutdownTelemetry };
3
98
 
4
- export { setupTelemetry, shutdownTelemetry };
99
+ //# sourceMappingURL=setup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.mjs","names":[],"sources":["../../src/instrumentation/setup.ts"],"sourcesContent":["import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';\nimport { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';\nimport { resourceFromAttributes } from '@opentelemetry/resources';\nimport {\n\tBatchLogRecordProcessor,\n\tLoggerProvider,\n} from '@opentelemetry/sdk-logs';\nimport { NodeSDK } from '@opentelemetry/sdk-node';\nimport {\n\tConsoleSpanExporter,\n\ttype SpanExporter,\n} from '@opentelemetry/sdk-trace-node';\nimport {\n\tATTR_SERVICE_NAME,\n\tATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport type { SpanProcessorStrategy } from '../adapters/types';\nimport {\n\tcreateSpanProcessor,\n\tgetRecommendedStrategy,\n\tsetGlobalLogProcessor,\n\tsetGlobalSpanProcessor,\n} from './core';\n\n/**\n * Options for configuring telemetry\n */\nexport interface TelemetryOptions {\n\t/**\n\t * Service name for resource identification\n\t */\n\tserviceName: string;\n\n\t/**\n\t * Service version\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')\n\t * If not provided, traces will be logged to console\n\t */\n\tendpoint?: string;\n\n\t/**\n\t * Whether to instrument Pino for log correlation\n\t * @default true\n\t */\n\tinstrumentPino?: boolean;\n\n\t/**\n\t * Whether to enable auto-instrumentation for common libraries\n\t * (http, fetch, express, etc.)\n\t * @default true\n\t */\n\tautoInstrument?: boolean;\n\n\t/**\n\t * Enable debug logging for OTel SDK\n\t * @default false\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Additional resource attributes\n\t */\n\tresourceAttributes?: Record<string, string>;\n\n\t/**\n\t * Headers to send with OTLP requests\n\t */\n\theaders?: Record<string, string>;\n\n\t/**\n\t * Span processor strategy.\n\t * - 'batch': Efficient batching for long-running servers (default)\n\t * - 'simple': Immediate export for serverless environments (Lambda, Edge)\n\t *\n\t * If not specified, automatically selected based on environment detection.\n\t */\n\tspanProcessorStrategy?: SpanProcessorStrategy;\n\n\t/**\n\t * Environment type for automatic configuration\n\t * @default 'server'\n\t */\n\tenvironment?: 'server' | 'lambda' | 'edge' | 'custom';\n}\n\nlet sdk: NodeSDK | null = null;\n\n/**\n * Set up OpenTelemetry instrumentation.\n * Call this BEFORE importing your application code.\n *\n * @example\n * ```typescript\n * // instrumentation.ts (create this file)\n * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';\n *\n * setupTelemetry({\n * serviceName: 'my-api',\n * endpoint: 'http://localhost:3000/__telescope/v1',\n * });\n *\n * // Then in your entry point:\n * // import './instrumentation';\n * // import { app } from './app';\n * ```\n */\nexport function setupTelemetry(options: TelemetryOptions): void {\n\tif (sdk) {\n\t\treturn;\n\t}\n\n\tconst {\n\t\tserviceName,\n\t\tserviceVersion = '1.0.0',\n\t\tendpoint,\n\t\tinstrumentPino = true,\n\t\tautoInstrument = true,\n\t\tdebug = false,\n\t\tresourceAttributes = {},\n\t\theaders = {},\n\t\tspanProcessorStrategy,\n\t\tenvironment = 'server',\n\t} = options;\n\n\t// Enable debug logging if requested\n\tif (debug) {\n\t\tdiag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);\n\t}\n\n\t// Create resource\n\t// `new Resource(...)` went in resources 2.x — a resource is now made from\n\t// attributes by a function, so a detector and a literal produce the same\n\t// thing rather than two shapes that had to be merged.\n\tconst resource = resourceFromAttributes({\n\t\t[ATTR_SERVICE_NAME]: serviceName,\n\t\t[ATTR_SERVICE_VERSION]: serviceVersion,\n\t\t...resourceAttributes,\n\t});\n\n\t// Build instrumentations list\n\tconst instrumentations = [];\n\n\t// Add Pino instrumentation for log correlation\n\tif (instrumentPino) {\n\t\tinstrumentations.push(\n\t\t\tnew PinoInstrumentation({\n\t\t\t\t// Inject trace context into log records\n\t\t\t\tlogHook: (span, record) => {\n\t\t\t\t\trecord.trace_id = span.spanContext().traceId;\n\t\t\t\t\trecord.span_id = span.spanContext().spanId;\n\t\t\t\t\trecord.trace_flags = span.spanContext().traceFlags;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Add auto-instrumentations for common libraries\n\tif (autoInstrument) {\n\t\tinstrumentations.push(\n\t\t\tgetNodeAutoInstrumentations({\n\t\t\t\t// Disable file system instrumentation (too noisy)\n\t\t\t\t'@opentelemetry/instrumentation-fs': { enabled: false },\n\t\t\t\t// Configure HTTP instrumentation\n\t\t\t\t'@opentelemetry/instrumentation-http': {\n\t\t\t\t\tignoreIncomingRequestHook: (request) => {\n\t\t\t\t\t\t// Ignore health checks and internal routes\n\t\t\t\t\t\tconst path = request.url || '';\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tpath.includes('/__health') ||\n\t\t\t\t\t\t\tpath.includes('/__telescope') ||\n\t\t\t\t\t\t\tpath.includes('/favicon')\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\n\t// Create exporters\n\tlet traceExporter: SpanExporter;\n\tif (endpoint) {\n\t\ttraceExporter = new OTLPTraceExporter({\n\t\t\turl: `${endpoint}/traces`,\n\t\t\theaders,\n\t\t});\n\t} else {\n\t\t// Fall back to console exporter for debugging\n\t\ttraceExporter = new ConsoleSpanExporter();\n\t}\n\n\t// Determine span processor strategy\n\tconst strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);\n\tconst spanProcessor = createSpanProcessor(traceExporter, { strategy });\n\n\t// Register globally for flush operations\n\tsetGlobalSpanProcessor(spanProcessor);\n\n\t// Create and configure SDK\n\tsdk = new NodeSDK({\n\t\tresource,\n\t\ttraceExporter,\n\t\tspanProcessors: [spanProcessor],\n\t\tinstrumentations,\n\t});\n\n\t// Set up log exporter if endpoint is provided\n\tif (endpoint) {\n\t\tconst logExporter = new OTLPLogExporter({\n\t\t\turl: `${endpoint}/logs`,\n\t\t\theaders,\n\t\t});\n\n\t\t// Both changed in sdk-logs 2.x, and for the same reason the trace SDK\n\t\t// changed: a provider whose processors could be swapped after it had begun\n\t\t// emitting was never safe, so processors are constructor-only and the\n\t\t// exporter is named rather than positional.\n\t\tconst logProcessor = new BatchLogRecordProcessor({\n\t\t\texporter: logExporter,\n\t\t});\n\t\tconst loggerProvider = new LoggerProvider({\n\t\t\tresource,\n\t\t\tprocessors: [logProcessor],\n\t\t});\n\n\t\t// Register for flush operations\n\t\tsetGlobalLogProcessor(logProcessor);\n\t}\n\n\t// Start the SDK\n\tsdk.start();\n\n\t// Graceful shutdown\n\tprocess.on('SIGTERM', () => {\n\t\tsdk\n\t\t\t?.shutdown()\n\t\t\t.then(() => {})\n\t\t\t.catch((_error) => {})\n\t\t\t.finally(() => process.exit(0));\n\t});\n}\n\n/**\n * Shut down telemetry (for testing or graceful shutdown)\n */\nexport async function shutdownTelemetry(): Promise<void> {\n\tif (sdk) {\n\t\tawait sdk.shutdown();\n\t\tsdk = null;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AA4FA,IAAI,MAAsB;;;;;;;;;;;;;;;;;;;;AAqB1B,SAAgB,eAAe,SAAiC;CAC/D,IAAI,KACH;CAGD,MAAM,EACL,aACA,iBAAiB,SACjB,UACA,iBAAiB,MACjB,iBAAiB,MACjB,QAAQ,OACR,qBAAqB,CAAC,GACtB,UAAU,CAAC,GACX,uBACA,cAAc,aACX;CAGJ,IAAI,OACH,KAAK,UAAU,IAAI,kBAAkB,GAAG,aAAa,KAAK;CAO3D,MAAM,WAAW,uBAAuB;GACtC,oBAAoB;GACpB,uBAAuB;EACxB,GAAG;CACJ,CAAC;CAGD,MAAM,mBAAmB,CAAC;CAG1B,IAAI,gBACH,iBAAiB,KAChB,IAAI,oBAAoB,EAEvB,UAAU,MAAM,WAAW;EAC1B,OAAO,WAAW,KAAK,YAAY,CAAC,CAAC;EACrC,OAAO,UAAU,KAAK,YAAY,CAAC,CAAC;EACpC,OAAO,cAAc,KAAK,YAAY,CAAC,CAAC;CACzC,EACD,CAAC,CACF;CAID,IAAI,gBACH,iBAAiB,KAChB,4BAA4B;EAE3B,qCAAqC,EAAE,SAAS,MAAM;EAEtD,uCAAuC,EACtC,4BAA4B,YAAY;GAEvC,MAAM,OAAO,QAAQ,OAAO;GAC5B,OACC,KAAK,SAAS,WAAW,KACzB,KAAK,SAAS,cAAc,KAC5B,KAAK,SAAS,UAAU;EAE1B,EACD;CACD,CAAC,CACF;CAID,IAAI;CACJ,IAAI,UACH,gBAAgB,IAAI,kBAAkB;EACrC,KAAK,GAAG,SAAS;EACjB;CACD,CAAC;MAGD,gBAAgB,IAAI,oBAAoB;CAIzC,MAAM,WAAW,yBAAyB,uBAAuB,WAAW;CAC5E,MAAM,gBAAgB,oBAAoB,eAAe,EAAE,SAAS,CAAC;CAGrE,uBAAuB,aAAa;CAGpC,MAAM,IAAI,QAAQ;EACjB;EACA;EACA,gBAAgB,CAAC,aAAa;EAC9B;CACD,CAAC;CAGD,IAAI,UAAU;EACb,MAAM,cAAc,IAAI,gBAAgB;GACvC,KAAK,GAAG,SAAS;GACjB;EACD,CAAC;EAMD,MAAM,eAAe,IAAI,wBAAwB,EAChD,UAAU,YACX,CAAC;EACsB,IAAI,eAAe;GACzC;GACA,YAAY,CAAC,YAAY;EAC1B,CAAC;EAGD,sBAAsB,YAAY;CACnC;CAGA,IAAI,MAAM;CAGV,QAAQ,GAAG,iBAAiB;EAC3B,KACG,SAAS,CAAC,CACX,WAAW,CAAC,CAAC,CAAC,CACd,OAAO,WAAW,CAAC,CAAC,CAAC,CACrB,cAAc,QAAQ,KAAK,CAAC,CAAC;CAChC,CAAC;AACF;;;;AAKA,eAAsB,oBAAmC;CACxD,IAAI,KAAK;EACR,MAAM,IAAI,SAAS;EACnB,MAAM;CACP;AACD"}
@@ -1,11 +1,115 @@
1
- const require_tracing = require('../tracing-Bt1zWRlb.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _opentelemetry_api = require("@opentelemetry/api");
3
+ //#region src/instrumentation/tracing.ts
4
+ /**
5
+ * Get the currently active span
6
+ */
7
+ function getActiveSpan() {
8
+ return _opentelemetry_api.trace.getActiveSpan();
9
+ }
10
+ /**
11
+ * Set attributes on the active span
12
+ */
13
+ function setSpanAttributes(attributes) {
14
+ const span = getActiveSpan();
15
+ if (span) span.setAttributes(attributes);
16
+ }
17
+ /**
18
+ * Create a new span as a child of the current span
19
+ */
20
+ function createSpan(name, attributes) {
21
+ return _opentelemetry_api.trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
22
+ }
23
+ /**
24
+ * Execute a function within a new span context
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const result = await withSpan('processOrder', async (span) => {
29
+ * span.setAttribute('order.id', orderId);
30
+ * const order = await processOrder(orderId);
31
+ * return order;
32
+ * });
33
+ * ```
34
+ */
35
+ async function withSpan(name, fn, attributes) {
36
+ const span = _opentelemetry_api.trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
37
+ try {
38
+ const result = await _opentelemetry_api.context.with(_opentelemetry_api.trace.setSpan(_opentelemetry_api.context.active(), span), () => fn(span));
39
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.OK });
40
+ return result;
41
+ } catch (error) {
42
+ span.setStatus({
43
+ code: _opentelemetry_api.SpanStatusCode.ERROR,
44
+ message: error instanceof Error ? error.message : "Unknown error"
45
+ });
46
+ span.recordException(error instanceof Error ? error : new Error(String(error)));
47
+ throw error;
48
+ } finally {
49
+ span.end();
50
+ }
51
+ }
52
+ /**
53
+ * Synchronous version of withSpan
54
+ */
55
+ function withSpanSync(name, fn, attributes) {
56
+ const span = _opentelemetry_api.trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
57
+ try {
58
+ const result = _opentelemetry_api.context.with(_opentelemetry_api.trace.setSpan(_opentelemetry_api.context.active(), span), () => fn(span));
59
+ span.setStatus({ code: _opentelemetry_api.SpanStatusCode.OK });
60
+ return result;
61
+ } catch (error) {
62
+ span.setStatus({
63
+ code: _opentelemetry_api.SpanStatusCode.ERROR,
64
+ message: error instanceof Error ? error.message : "Unknown error"
65
+ });
66
+ span.recordException(error instanceof Error ? error : new Error(String(error)));
67
+ throw error;
68
+ } finally {
69
+ span.end();
70
+ }
71
+ }
72
+ /**
73
+ * Get the current trace ID (useful for log correlation)
74
+ */
75
+ function getTraceId() {
76
+ return getActiveSpan()?.spanContext().traceId;
77
+ }
78
+ /**
79
+ * Get the current span ID
80
+ */
81
+ function getSpanId() {
82
+ return getActiveSpan()?.spanContext().spanId;
83
+ }
84
+ /**
85
+ * Record an exception on the current span
86
+ */
87
+ function recordException(error) {
88
+ const span = getActiveSpan();
89
+ if (span) {
90
+ span.recordException(error);
91
+ span.setStatus({
92
+ code: _opentelemetry_api.SpanStatusCode.ERROR,
93
+ message: error.message
94
+ });
95
+ }
96
+ }
97
+ /**
98
+ * Add an event to the current span
99
+ */
100
+ function addSpanEvent(name, attributes) {
101
+ const span = getActiveSpan();
102
+ if (span) span.addEvent(name, attributes);
103
+ }
104
+ //#endregion
105
+ exports.addSpanEvent = addSpanEvent;
106
+ exports.createSpan = createSpan;
107
+ exports.getActiveSpan = getActiveSpan;
108
+ exports.getSpanId = getSpanId;
109
+ exports.getTraceId = getTraceId;
110
+ exports.recordException = recordException;
111
+ exports.setSpanAttributes = setSpanAttributes;
112
+ exports.withSpan = withSpan;
113
+ exports.withSpanSync = withSpanSync;
2
114
 
3
- exports.addSpanEvent = require_tracing.addSpanEvent;
4
- exports.createSpan = require_tracing.createSpan;
5
- exports.getActiveSpan = require_tracing.getActiveSpan;
6
- exports.getSpanId = require_tracing.getSpanId;
7
- exports.getTraceId = require_tracing.getTraceId;
8
- exports.recordException = require_tracing.recordException;
9
- exports.setSpanAttributes = require_tracing.setSpanAttributes;
10
- exports.withSpan = require_tracing.withSpan;
11
- exports.withSpanSync = require_tracing.withSpanSync;
115
+ //# sourceMappingURL=tracing.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.cjs","names":["trace","context","SpanStatusCode"],"sources":["../../src/instrumentation/tracing.ts"],"sourcesContent":["import {\n\ttype Attributes,\n\tcontext,\n\ttype Span,\n\tSpanStatusCode,\n\ttrace,\n} from '@opentelemetry/api';\n\n/**\n * Get the currently active span\n */\nexport function getActiveSpan(): Span | undefined {\n\treturn trace.getActiveSpan();\n}\n\n/**\n * Set attributes on the active span\n */\nexport function setSpanAttributes(attributes: Attributes): void {\n\tconst span = getActiveSpan();\n\tif (span) {\n\t\tspan.setAttributes(attributes);\n\t}\n}\n\n/**\n * Create a new span as a child of the current span\n */\nexport function createSpan(name: string, attributes?: Attributes): Span {\n\tconst tracer = trace.getTracer('@geekmidas/telescope');\n\tconst span = tracer.startSpan(name, { attributes });\n\treturn span;\n}\n\n/**\n * Execute a function within a new span context\n *\n * @example\n * ```typescript\n * const result = await withSpan('processOrder', async (span) => {\n * span.setAttribute('order.id', orderId);\n * const order = await processOrder(orderId);\n * return order;\n * });\n * ```\n */\nexport async function withSpan<T>(\n\tname: string,\n\tfn: (span: Span) => Promise<T>,\n\tattributes?: Attributes,\n): Promise<T> {\n\tconst tracer = trace.getTracer('@geekmidas/telescope');\n\tconst span = tracer.startSpan(name, { attributes });\n\n\ttry {\n\t\tconst result = await context.with(\n\t\t\ttrace.setSpan(context.active(), span),\n\t\t\t() => fn(span),\n\t\t);\n\t\tspan.setStatus({ code: SpanStatusCode.OK });\n\t\treturn result;\n\t} catch (error) {\n\t\tspan.setStatus({\n\t\t\tcode: SpanStatusCode.ERROR,\n\t\t\tmessage: error instanceof Error ? error.message : 'Unknown error',\n\t\t});\n\t\tspan.recordException(\n\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t);\n\t\tthrow error;\n\t} finally {\n\t\tspan.end();\n\t}\n}\n\n/**\n * Synchronous version of withSpan\n */\nexport function withSpanSync<T>(\n\tname: string,\n\tfn: (span: Span) => T,\n\tattributes?: Attributes,\n): T {\n\tconst tracer = trace.getTracer('@geekmidas/telescope');\n\tconst span = tracer.startSpan(name, { attributes });\n\n\ttry {\n\t\tconst result = context.with(trace.setSpan(context.active(), span), () =>\n\t\t\tfn(span),\n\t\t);\n\t\tspan.setStatus({ code: SpanStatusCode.OK });\n\t\treturn result;\n\t} catch (error) {\n\t\tspan.setStatus({\n\t\t\tcode: SpanStatusCode.ERROR,\n\t\t\tmessage: error instanceof Error ? error.message : 'Unknown error',\n\t\t});\n\t\tspan.recordException(\n\t\t\terror instanceof Error ? error : new Error(String(error)),\n\t\t);\n\t\tthrow error;\n\t} finally {\n\t\tspan.end();\n\t}\n}\n\n/**\n * Get the current trace ID (useful for log correlation)\n */\nexport function getTraceId(): string | undefined {\n\tconst span = getActiveSpan();\n\treturn span?.spanContext().traceId;\n}\n\n/**\n * Get the current span ID\n */\nexport function getSpanId(): string | undefined {\n\tconst span = getActiveSpan();\n\treturn span?.spanContext().spanId;\n}\n\n/**\n * Record an exception on the current span\n */\nexport function recordException(error: Error): void {\n\tconst span = getActiveSpan();\n\tif (span) {\n\t\tspan.recordException(error);\n\t\tspan.setStatus({\n\t\t\tcode: SpanStatusCode.ERROR,\n\t\t\tmessage: error.message,\n\t\t});\n\t}\n}\n\n/**\n * Add an event to the current span\n */\nexport function addSpanEvent(name: string, attributes?: Attributes): void {\n\tconst span = getActiveSpan();\n\tif (span) {\n\t\tspan.addEvent(name, attributes);\n\t}\n}\n"],"mappings":";;;;;;AAWA,SAAgB,gBAAkC;CACjD,OAAOA,mBAAAA,MAAM,cAAc;AAC5B;;;;AAKA,SAAgB,kBAAkB,YAA8B;CAC/D,MAAM,OAAO,cAAc;CAC3B,IAAI,MACH,KAAK,cAAc,UAAU;AAE/B;;;;AAKA,SAAgB,WAAW,MAAc,YAA+B;CAGvE,OAFeA,mBAAAA,MAAM,UAAU,sBACb,CAAC,CAAC,UAAU,MAAM,EAAE,WAAW,CACvC;AACX;;;;;;;;;;;;;AAcA,eAAsB,SACrB,MACA,IACA,YACa;CAEb,MAAM,OADSA,mBAAAA,MAAM,UAAU,sBACb,CAAC,CAAC,UAAU,MAAM,EAAE,WAAW,CAAC;CAElD,IAAI;EACH,MAAM,SAAS,MAAMC,mBAAAA,QAAQ,KAC5BD,mBAAAA,MAAM,QAAQC,mBAAAA,QAAQ,OAAO,GAAG,IAAI,SAC9B,GAAG,IAAI,CACd;EACA,KAAK,UAAU,EAAE,MAAMC,mBAAAA,eAAe,GAAG,CAAC;EAC1C,OAAO;CACR,SAAS,OAAO;EACf,KAAK,UAAU;GACd,MAAMA,mBAAAA,eAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EACnD,CAAC;EACD,KAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,CACzD;EACA,MAAM;CACP,UAAU;EACT,KAAK,IAAI;CACV;AACD;;;;AAKA,SAAgB,aACf,MACA,IACA,YACI;CAEJ,MAAM,OADSF,mBAAAA,MAAM,UAAU,sBACb,CAAC,CAAC,UAAU,MAAM,EAAE,WAAW,CAAC;CAElD,IAAI;EACH,MAAM,SAASC,mBAAAA,QAAQ,KAAKD,mBAAAA,MAAM,QAAQC,mBAAAA,QAAQ,OAAO,GAAG,IAAI,SAC/D,GAAG,IAAI,CACR;EACA,KAAK,UAAU,EAAE,MAAMC,mBAAAA,eAAe,GAAG,CAAC;EAC1C,OAAO;CACR,SAAS,OAAO;EACf,KAAK,UAAU;GACd,MAAMA,mBAAAA,eAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EACnD,CAAC;EACD,KAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,CACzD;EACA,MAAM;CACP,UAAU;EACT,KAAK,IAAI;CACV;AACD;;;;AAKA,SAAgB,aAAiC;CAEhD,OADa,cACH,CAAC,EAAE,YAAY,CAAC,CAAC;AAC5B;;;;AAKA,SAAgB,YAAgC;CAE/C,OADa,cACH,CAAC,EAAE,YAAY,CAAC,CAAC;AAC5B;;;;AAKA,SAAgB,gBAAgB,OAAoB;CACnD,MAAM,OAAO,cAAc;CAC3B,IAAI,MAAM;EACT,KAAK,gBAAgB,KAAK;EAC1B,KAAK,UAAU;GACd,MAAMA,mBAAAA,eAAe;GACrB,SAAS,MAAM;EAChB,CAAC;CACF;AACD;;;;AAKA,SAAgB,aAAa,MAAc,YAA+B;CACzE,MAAM,OAAO,cAAc;CAC3B,IAAI,MACH,KAAK,SAAS,MAAM,UAAU;AAEhC"}
@@ -1,2 +1,49 @@
1
- import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-BX8uY2nR.cjs";
2
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
1
+ import { Attributes, Span } from "@opentelemetry/api";
2
+ //#region src/instrumentation/tracing.d.ts
3
+ /**
4
+ * Get the currently active span
5
+ */
6
+ export declare function getActiveSpan(): Span | undefined;
7
+ /**
8
+ * Set attributes on the active span
9
+ */
10
+ export declare function setSpanAttributes(attributes: Attributes): void;
11
+ /**
12
+ * Create a new span as a child of the current span
13
+ */
14
+ export declare function createSpan(name: string, attributes?: Attributes): Span;
15
+ /**
16
+ * Execute a function within a new span context
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const result = await withSpan('processOrder', async (span) => {
21
+ * span.setAttribute('order.id', orderId);
22
+ * const order = await processOrder(orderId);
23
+ * return order;
24
+ * });
25
+ * ```
26
+ */
27
+ export declare function withSpan<T>(name: string, fn: (span: Span) => Promise<T>, attributes?: Attributes): Promise<T>;
28
+ /**
29
+ * Synchronous version of withSpan
30
+ */
31
+ export declare function withSpanSync<T>(name: string, fn: (span: Span) => T, attributes?: Attributes): T;
32
+ /**
33
+ * Get the current trace ID (useful for log correlation)
34
+ */
35
+ export declare function getTraceId(): string | undefined;
36
+ /**
37
+ * Get the current span ID
38
+ */
39
+ export declare function getSpanId(): string | undefined;
40
+ /**
41
+ * Record an exception on the current span
42
+ */
43
+ export declare function recordException(error: Error): void;
44
+ /**
45
+ * Add an event to the current span
46
+ */
47
+ export declare function addSpanEvent(name: string, attributes?: Attributes): void;
48
+ //#endregion
49
+ //# sourceMappingURL=tracing.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.d.cts","names":[],"sources":["../../src/instrumentation/tracing.ts"],"mappings":";;;;;wBAWgB,iBAAiB;;;;wBAOjB,kBAAkB,YAAY;;;;wBAU9B,WAAW,cAAc,aAAa,aAAa;;;;;;;;;;;;;wBAkB7C,SAAS,GAC9B,cACA,KAAK,MAAM,SAAS,QAAQ,IAC5B,aAAa,aACX,QAAQ;;;;wBA4BK,aAAa,GAC5B,cACA,KAAK,MAAM,SAAS,GACpB,aAAa,aACX;;;;wBA2Ba;;;;wBAQA;;;;wBAQA,gBAAgB,OAAO;;;;wBAcvB,aAAa,cAAc,aAAa"}
@@ -1,2 +1,49 @@
1
- import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-PnECEbEu.mjs";
2
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
1
+ import { Attributes, Span } from "@opentelemetry/api";
2
+ //#region src/instrumentation/tracing.d.ts
3
+ /**
4
+ * Get the currently active span
5
+ */
6
+ export declare function getActiveSpan(): Span | undefined;
7
+ /**
8
+ * Set attributes on the active span
9
+ */
10
+ export declare function setSpanAttributes(attributes: Attributes): void;
11
+ /**
12
+ * Create a new span as a child of the current span
13
+ */
14
+ export declare function createSpan(name: string, attributes?: Attributes): Span;
15
+ /**
16
+ * Execute a function within a new span context
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const result = await withSpan('processOrder', async (span) => {
21
+ * span.setAttribute('order.id', orderId);
22
+ * const order = await processOrder(orderId);
23
+ * return order;
24
+ * });
25
+ * ```
26
+ */
27
+ export declare function withSpan<T>(name: string, fn: (span: Span) => Promise<T>, attributes?: Attributes): Promise<T>;
28
+ /**
29
+ * Synchronous version of withSpan
30
+ */
31
+ export declare function withSpanSync<T>(name: string, fn: (span: Span) => T, attributes?: Attributes): T;
32
+ /**
33
+ * Get the current trace ID (useful for log correlation)
34
+ */
35
+ export declare function getTraceId(): string | undefined;
36
+ /**
37
+ * Get the current span ID
38
+ */
39
+ export declare function getSpanId(): string | undefined;
40
+ /**
41
+ * Record an exception on the current span
42
+ */
43
+ export declare function recordException(error: Error): void;
44
+ /**
45
+ * Add an event to the current span
46
+ */
47
+ export declare function addSpanEvent(name: string, attributes?: Attributes): void;
48
+ //#endregion
49
+ //# sourceMappingURL=tracing.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing.d.mts","names":[],"sources":["../../src/instrumentation/tracing.ts"],"mappings":";;;;;wBAWgB,iBAAiB;;;;wBAOjB,kBAAkB,YAAY;;;;wBAU9B,WAAW,cAAc,aAAa,aAAa;;;;;;;;;;;;;wBAkB7C,SAAS,GAC9B,cACA,KAAK,MAAM,SAAS,QAAQ,IAC5B,aAAa,aACX,QAAQ;;;;wBA4BK,aAAa,GAC5B,cACA,KAAK,MAAM,SAAS,GACpB,aAAa,aACX;;;;wBA2Ba;;;;wBAQA;;;;wBAQA,gBAAgB,OAAO;;;;wBAcvB,aAAa,cAAc,aAAa"}
@@ -1,3 +1,106 @@
1
- import { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync } from "../tracing-Cijm_5NI.mjs";
1
+ import { SpanStatusCode, context, trace } from "@opentelemetry/api";
2
+ //#region src/instrumentation/tracing.ts
3
+ /**
4
+ * Get the currently active span
5
+ */
6
+ function getActiveSpan() {
7
+ return trace.getActiveSpan();
8
+ }
9
+ /**
10
+ * Set attributes on the active span
11
+ */
12
+ function setSpanAttributes(attributes) {
13
+ const span = getActiveSpan();
14
+ if (span) span.setAttributes(attributes);
15
+ }
16
+ /**
17
+ * Create a new span as a child of the current span
18
+ */
19
+ function createSpan(name, attributes) {
20
+ return trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
21
+ }
22
+ /**
23
+ * Execute a function within a new span context
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * const result = await withSpan('processOrder', async (span) => {
28
+ * span.setAttribute('order.id', orderId);
29
+ * const order = await processOrder(orderId);
30
+ * return order;
31
+ * });
32
+ * ```
33
+ */
34
+ async function withSpan(name, fn, attributes) {
35
+ const span = trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
36
+ try {
37
+ const result = await context.with(trace.setSpan(context.active(), span), () => fn(span));
38
+ span.setStatus({ code: SpanStatusCode.OK });
39
+ return result;
40
+ } catch (error) {
41
+ span.setStatus({
42
+ code: SpanStatusCode.ERROR,
43
+ message: error instanceof Error ? error.message : "Unknown error"
44
+ });
45
+ span.recordException(error instanceof Error ? error : new Error(String(error)));
46
+ throw error;
47
+ } finally {
48
+ span.end();
49
+ }
50
+ }
51
+ /**
52
+ * Synchronous version of withSpan
53
+ */
54
+ function withSpanSync(name, fn, attributes) {
55
+ const span = trace.getTracer("@geekmidas/telescope").startSpan(name, { attributes });
56
+ try {
57
+ const result = context.with(trace.setSpan(context.active(), span), () => fn(span));
58
+ span.setStatus({ code: SpanStatusCode.OK });
59
+ return result;
60
+ } catch (error) {
61
+ span.setStatus({
62
+ code: SpanStatusCode.ERROR,
63
+ message: error instanceof Error ? error.message : "Unknown error"
64
+ });
65
+ span.recordException(error instanceof Error ? error : new Error(String(error)));
66
+ throw error;
67
+ } finally {
68
+ span.end();
69
+ }
70
+ }
71
+ /**
72
+ * Get the current trace ID (useful for log correlation)
73
+ */
74
+ function getTraceId() {
75
+ return getActiveSpan()?.spanContext().traceId;
76
+ }
77
+ /**
78
+ * Get the current span ID
79
+ */
80
+ function getSpanId() {
81
+ return getActiveSpan()?.spanContext().spanId;
82
+ }
83
+ /**
84
+ * Record an exception on the current span
85
+ */
86
+ function recordException(error) {
87
+ const span = getActiveSpan();
88
+ if (span) {
89
+ span.recordException(error);
90
+ span.setStatus({
91
+ code: SpanStatusCode.ERROR,
92
+ message: error.message
93
+ });
94
+ }
95
+ }
96
+ /**
97
+ * Add an event to the current span
98
+ */
99
+ function addSpanEvent(name, attributes) {
100
+ const span = getActiveSpan();
101
+ if (span) span.addEvent(name, attributes);
102
+ }
103
+ //#endregion
104
+ export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
2
105
 
3
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
106
+ //# sourceMappingURL=tracing.mjs.map