@geekmidas/telescope 10.0.0-alpha.4 → 10.0.0-alpha.41

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 +5 -3
  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-BsqmhurZ.cjs +0 -219
  293. package/dist/http-BsqmhurZ.cjs.map +0 -1
  294. package/dist/http-D5kn3_Mt.d.mts +0 -107
  295. package/dist/http-D5kn3_Mt.d.mts.map +0 -1
  296. package/dist/http-Dvca6fC3.d.cts +0 -107
  297. package/dist/http-Dvca6fC3.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-CbqELCtm.cjs +0 -112
  349. package/dist/setup-CbqELCtm.cjs.map +0 -1
  350. package/dist/setup-D58N1f9O.d.cts +0 -87
  351. package/dist/setup-D58N1f9O.d.cts.map +0 -1
  352. package/dist/setup-P7dAjwih.mjs +0 -100
  353. package/dist/setup-P7dAjwih.mjs.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 +0,0 @@
1
- {"version":3,"file":"setup-CbqELCtm.cjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","DiagConsoleLogger","DiagLogLevel","ATTR_SERVICE_NAME","ATTR_SERVICE_VERSION","PinoInstrumentation","traceExporter: SpanExporter","OTLPTraceExporter","ConsoleSpanExporter","NodeSDK","OTLPLogExporter","BatchLogRecordProcessor","LoggerProvider"],"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,IAAIA,MAAsB;;;;;;;;;;;;;;;;;;;;AAqB1B,SAAgB,eAAeC,SAAiC;AAC/D,KAAI,IACH;CAGD,MAAM,EACL,aACA,iBAAiB,SACjB,UACA,iBAAiB,MACjB,iBAAiB,MACjB,QAAQ,OACR,qBAAqB,CAAE,GACvB,UAAU,CAAE,GACZ,uBACA,cAAc,UACd,GAAG;AAGJ,KAAI,MACH,0BAAK,UAAU,IAAIC,yCAAqBC,iCAAa,MAAM;CAO5D,MAAM,WAAW,sDAAuB;GACtCC,yDAAoB;GACpBC,4DAAuB;EACxB,GAAG;CACH,EAAC;CAGF,MAAM,mBAAmB,CAAE;AAG3B,KAAI,eACH,kBAAiB,KAChB,IAAIC,yDAAoB,EAEvB,SAAS,CAAC,MAAM,WAAW;AAC1B,SAAO,WAAW,KAAK,aAAa,CAAC;AACrC,SAAO,UAAU,KAAK,aAAa,CAAC;AACpC,SAAO,cAAc,KAAK,aAAa,CAAC;CACxC,EACD,GACD;AAIF,KAAI,eACH,kBAAiB,KAChB,4EAA4B;EAE3B,qCAAqC,EAAE,SAAS,MAAO;EAEvD,uCAAuC,EACtC,2BAA2B,CAAC,YAAY;GAEvC,MAAM,OAAO,QAAQ,OAAO;AAC5B,UACC,KAAK,SAAS,YAAY,IAC1B,KAAK,SAAS,eAAe,IAC7B,KAAK,SAAS,WAAW;EAE1B,EACD;CACD,EAAC,CACF;CAIF,IAAIC;AACJ,KAAI,SACH,iBAAgB,IAAIC,2DAAkB;EACrC,MAAM,EAAE,SAAS;EACjB;CACA;KAGD,iBAAgB,IAAIC;CAIrB,MAAM,WAAW,yBAAyB,oCAAuB,YAAY;CAC7E,MAAM,gBAAgB,iCAAoB,eAAe,EAAE,SAAU,EAAC;AAGtE,qCAAuB,cAAc;AAGrC,OAAM,IAAIC,iCAAQ;EACjB;EACA;EACA,gBAAgB,CAAC,aAAc;EAC/B;CACA;AAGD,KAAI,UAAU;EACb,MAAM,cAAc,IAAIC,wDAAgB;GACvC,MAAM,EAAE,SAAS;GACjB;EACA;EAMD,MAAM,eAAe,IAAIC,iDAAwB,EAChD,UAAU,YACV;EACD,MAAM,iBAAiB,IAAIC,wCAAe;GACzC;GACA,YAAY,CAAC,YAAa;EAC1B;AAGD,qCAAsB,aAAa;CACnC;AAGD,KAAI,OAAO;AAGX,SAAQ,GAAG,WAAW,MAAM;AAC3B,OACG,UAAU,CACX,KAAK,MAAM,CAAE,EAAC,CACd,MAAM,CAAC,WAAW,CAAE,EAAC,CACrB,QAAQ,MAAM,QAAQ,KAAK,EAAE,CAAC;CAChC,EAAC;AACF;;;;AAKD,eAAsB,oBAAmC;AACxD,KAAI,KAAK;AACR,QAAM,IAAI,UAAU;AACpB,QAAM;CACN;AACD"}
@@ -1,87 +0,0 @@
1
- import { SpanProcessorStrategy } from "./types-BRzW1NM8.cjs";
2
-
3
- //#region src/instrumentation/setup.d.ts
4
-
5
- /**
6
- * Options for configuring telemetry
7
- */
8
- interface TelemetryOptions {
9
- /**
10
- * Service name for resource identification
11
- */
12
- serviceName: string;
13
- /**
14
- * Service version
15
- */
16
- serviceVersion?: string;
17
- /**
18
- * OTLP endpoint URL (e.g., 'http://localhost:3000/__telescope/v1')
19
- * If not provided, traces will be logged to console
20
- */
21
- endpoint?: string;
22
- /**
23
- * Whether to instrument Pino for log correlation
24
- * @default true
25
- */
26
- instrumentPino?: boolean;
27
- /**
28
- * Whether to enable auto-instrumentation for common libraries
29
- * (http, fetch, express, etc.)
30
- * @default true
31
- */
32
- autoInstrument?: boolean;
33
- /**
34
- * Enable debug logging for OTel SDK
35
- * @default false
36
- */
37
- debug?: boolean;
38
- /**
39
- * Additional resource attributes
40
- */
41
- resourceAttributes?: Record<string, string>;
42
- /**
43
- * Headers to send with OTLP requests
44
- */
45
- headers?: Record<string, string>;
46
- /**
47
- * Span processor strategy.
48
- * - 'batch': Efficient batching for long-running servers (default)
49
- * - 'simple': Immediate export for serverless environments (Lambda, Edge)
50
- *
51
- * If not specified, automatically selected based on environment detection.
52
- */
53
- spanProcessorStrategy?: SpanProcessorStrategy;
54
- /**
55
- * Environment type for automatic configuration
56
- * @default 'server'
57
- */
58
- environment?: 'server' | 'lambda' | 'edge' | 'custom';
59
- }
60
- /**
61
- * Set up OpenTelemetry instrumentation.
62
- * Call this BEFORE importing your application code.
63
- *
64
- * @example
65
- * ```typescript
66
- * // instrumentation.ts (create this file)
67
- * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';
68
- *
69
- * setupTelemetry({
70
- * serviceName: 'my-api',
71
- * endpoint: 'http://localhost:3000/__telescope/v1',
72
- * });
73
- *
74
- * // Then in your entry point:
75
- * // import './instrumentation';
76
- * // import { app } from './app';
77
- * ```
78
- */
79
- declare function setupTelemetry(options: TelemetryOptions): void;
80
- /**
81
- * Shut down telemetry (for testing or graceful shutdown)
82
- */
83
- declare function shutdownTelemetry(): Promise<void>;
84
- //# sourceMappingURL=setup.d.ts.map
85
- //#endregion
86
- export { TelemetryOptions, setupTelemetry, shutdownTelemetry };
87
- //# sourceMappingURL=setup-D58N1f9O.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup-D58N1f9O.d.cts","names":[],"sources":["../src/instrumentation/setup.ts"],"sourcesContent":[],"mappings":";;;;;;AA8BA;AAAiC,UAAhB,gBAAA,CAAgB;EAAA;;;EAqDa,WAAA,EAAA,MAAA;EA8B9B;AA0IhB;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAtLsB;;;;YAKX;;;;;;;;0BASc;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BT,cAAA,UAAwB;;;;iBA0IlB,iBAAA,CAAA,GAAqB"}
@@ -1,100 +0,0 @@
1
- import { createSpanProcessor, getRecommendedStrategy, setGlobalLogProcessor, setGlobalSpanProcessor } from "./core-D6hJ6exL.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
-
13
- //#region src/instrumentation/setup.ts
14
- let sdk = null;
15
- /**
16
- * Set up OpenTelemetry instrumentation.
17
- * Call this BEFORE importing your application code.
18
- *
19
- * @example
20
- * ```typescript
21
- * // instrumentation.ts (create this file)
22
- * import { setupTelemetry } from '@geekmidas/telescope/instrumentation';
23
- *
24
- * setupTelemetry({
25
- * serviceName: 'my-api',
26
- * endpoint: 'http://localhost:3000/__telescope/v1',
27
- * });
28
- *
29
- * // Then in your entry point:
30
- * // import './instrumentation';
31
- * // import { app } from './app';
32
- * ```
33
- */
34
- function setupTelemetry(options) {
35
- if (sdk) return;
36
- const { serviceName, serviceVersion = "1.0.0", endpoint, instrumentPino = true, autoInstrument = true, debug = false, resourceAttributes = {}, headers = {}, spanProcessorStrategy, environment = "server" } = options;
37
- if (debug) diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
38
- const resource = resourceFromAttributes({
39
- [ATTR_SERVICE_NAME]: serviceName,
40
- [ATTR_SERVICE_VERSION]: serviceVersion,
41
- ...resourceAttributes
42
- });
43
- const instrumentations = [];
44
- if (instrumentPino) instrumentations.push(new PinoInstrumentation({ logHook: (span, record) => {
45
- record.trace_id = span.spanContext().traceId;
46
- record.span_id = span.spanContext().spanId;
47
- record.trace_flags = span.spanContext().traceFlags;
48
- } }));
49
- if (autoInstrument) instrumentations.push(getNodeAutoInstrumentations({
50
- "@opentelemetry/instrumentation-fs": { enabled: false },
51
- "@opentelemetry/instrumentation-http": { ignoreIncomingRequestHook: (request) => {
52
- const path = request.url || "";
53
- return path.includes("/__health") || path.includes("/__telescope") || path.includes("/favicon");
54
- } }
55
- }));
56
- let traceExporter;
57
- if (endpoint) traceExporter = new OTLPTraceExporter({
58
- url: `${endpoint}/traces`,
59
- headers
60
- });
61
- else traceExporter = new ConsoleSpanExporter();
62
- const strategy = spanProcessorStrategy ?? getRecommendedStrategy(environment);
63
- const spanProcessor = createSpanProcessor(traceExporter, { strategy });
64
- setGlobalSpanProcessor(spanProcessor);
65
- sdk = new NodeSDK({
66
- resource,
67
- traceExporter,
68
- spanProcessors: [spanProcessor],
69
- instrumentations
70
- });
71
- if (endpoint) {
72
- const logExporter = new OTLPLogExporter({
73
- url: `${endpoint}/logs`,
74
- headers
75
- });
76
- const logProcessor = new BatchLogRecordProcessor({ exporter: logExporter });
77
- const loggerProvider = new LoggerProvider({
78
- resource,
79
- processors: [logProcessor]
80
- });
81
- setGlobalLogProcessor(logProcessor);
82
- }
83
- sdk.start();
84
- process.on("SIGTERM", () => {
85
- sdk?.shutdown().then(() => {}).catch((_error) => {}).finally(() => process.exit(0));
86
- });
87
- }
88
- /**
89
- * Shut down telemetry (for testing or graceful shutdown)
90
- */
91
- async function shutdownTelemetry() {
92
- if (sdk) {
93
- await sdk.shutdown();
94
- sdk = null;
95
- }
96
- }
97
-
98
- //#endregion
99
- export { setupTelemetry, shutdownTelemetry };
100
- //# sourceMappingURL=setup-P7dAjwih.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup-P7dAjwih.mjs","names":["sdk: NodeSDK | null","options: TelemetryOptions","traceExporter: SpanExporter"],"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,IAAIA,MAAsB;;;;;;;;;;;;;;;;;;;;AAqB1B,SAAgB,eAAeC,SAAiC;AAC/D,KAAI,IACH;CAGD,MAAM,EACL,aACA,iBAAiB,SACjB,UACA,iBAAiB,MACjB,iBAAiB,MACjB,QAAQ,OACR,qBAAqB,CAAE,GACvB,UAAU,CAAE,GACZ,uBACA,cAAc,UACd,GAAG;AAGJ,KAAI,MACH,MAAK,UAAU,IAAI,qBAAqB,aAAa,MAAM;CAO5D,MAAM,WAAW,uBAAuB;GACtC,oBAAoB;GACpB,uBAAuB;EACxB,GAAG;CACH,EAAC;CAGF,MAAM,mBAAmB,CAAE;AAG3B,KAAI,eACH,kBAAiB,KAChB,IAAI,oBAAoB,EAEvB,SAAS,CAAC,MAAM,WAAW;AAC1B,SAAO,WAAW,KAAK,aAAa,CAAC;AACrC,SAAO,UAAU,KAAK,aAAa,CAAC;AACpC,SAAO,cAAc,KAAK,aAAa,CAAC;CACxC,EACD,GACD;AAIF,KAAI,eACH,kBAAiB,KAChB,4BAA4B;EAE3B,qCAAqC,EAAE,SAAS,MAAO;EAEvD,uCAAuC,EACtC,2BAA2B,CAAC,YAAY;GAEvC,MAAM,OAAO,QAAQ,OAAO;AAC5B,UACC,KAAK,SAAS,YAAY,IAC1B,KAAK,SAAS,eAAe,IAC7B,KAAK,SAAS,WAAW;EAE1B,EACD;CACD,EAAC,CACF;CAIF,IAAIC;AACJ,KAAI,SACH,iBAAgB,IAAI,kBAAkB;EACrC,MAAM,EAAE,SAAS;EACjB;CACA;KAGD,iBAAgB,IAAI;CAIrB,MAAM,WAAW,yBAAyB,uBAAuB,YAAY;CAC7E,MAAM,gBAAgB,oBAAoB,eAAe,EAAE,SAAU,EAAC;AAGtE,wBAAuB,cAAc;AAGrC,OAAM,IAAI,QAAQ;EACjB;EACA;EACA,gBAAgB,CAAC,aAAc;EAC/B;CACA;AAGD,KAAI,UAAU;EACb,MAAM,cAAc,IAAI,gBAAgB;GACvC,MAAM,EAAE,SAAS;GACjB;EACA;EAMD,MAAM,eAAe,IAAI,wBAAwB,EAChD,UAAU,YACV;EACD,MAAM,iBAAiB,IAAI,eAAe;GACzC;GACA,YAAY,CAAC,YAAa;EAC1B;AAGD,wBAAsB,aAAa;CACnC;AAGD,KAAI,OAAO;AAGX,SAAQ,GAAG,WAAW,MAAM;AAC3B,OACG,UAAU,CACX,KAAK,MAAM,CAAE,EAAC,CACd,MAAM,CAAC,WAAW,CAAE,EAAC,CACrB,QAAQ,MAAM,QAAQ,KAAK,EAAE,CAAC;CAChC,EAAC;AACF;;;;AAKD,eAAsB,oBAAmC;AACxD,KAAI,KAAK;AACR,QAAM,IAAI,UAAU;AACpB,QAAM;CACN;AACD"}
@@ -1,53 +0,0 @@
1
- import { Attributes, Span } from "@opentelemetry/api";
2
-
3
- //#region src/instrumentation/tracing.d.ts
4
-
5
- /**
6
- * Get the currently active span
7
- */
8
- declare function getActiveSpan(): Span | undefined;
9
- /**
10
- * Set attributes on the active span
11
- */
12
- declare function setSpanAttributes(attributes: Attributes): void;
13
- /**
14
- * Create a new span as a child of the current span
15
- */
16
- declare function createSpan(name: string, attributes?: Attributes): Span;
17
- /**
18
- * Execute a function within a new span context
19
- *
20
- * @example
21
- * ```typescript
22
- * const result = await withSpan('processOrder', async (span) => {
23
- * span.setAttribute('order.id', orderId);
24
- * const order = await processOrder(orderId);
25
- * return order;
26
- * });
27
- * ```
28
- */
29
- declare function withSpan<T>(name: string, fn: (span: Span) => Promise<T>, attributes?: Attributes): Promise<T>;
30
- /**
31
- * Synchronous version of withSpan
32
- */
33
- declare function withSpanSync<T>(name: string, fn: (span: Span) => T, attributes?: Attributes): T;
34
- /**
35
- * Get the current trace ID (useful for log correlation)
36
- */
37
- declare function getTraceId(): string | undefined;
38
- /**
39
- * Get the current span ID
40
- */
41
- declare function getSpanId(): string | undefined;
42
- /**
43
- * Record an exception on the current span
44
- */
45
- declare function recordException(error: Error): void;
46
- /**
47
- * Add an event to the current span
48
- */
49
- declare function addSpanEvent(name: string, attributes?: Attributes): void;
50
- //# sourceMappingURL=tracing.d.ts.map
51
- //#endregion
52
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
53
- //# sourceMappingURL=tracing-BX8uY2nR.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing-BX8uY2nR.d.cts","names":[],"sources":["../src/instrumentation/tracing.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;AAOgB,iBAPA,aAAA,CAAA,CAO8B,EAPb,IAOa,GAAU,SAAA;AAUxD;;;AAAmE,iBAVnD,iBAAA,CAUmD,UAAA,EAVrB,UAUqB,CAAA,EAAA,IAAA;AAAI;AAkBvE;;AAEY,iBApBI,UAAA,CAoBJ,IAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EApB0C,UAoB1C,CAAA,EApBuD,IAoBvD;;;;;;AAEF;AA4BV;;;;;;AAII,iBApCkB,QAoClB,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EAlCQ,IAkCR,EAAA,GAlCiB,OAkCjB,CAlCyB,CAkCzB,CAAA,EAAA,UAAA,CAAA,EAjCU,UAiCV,CAAA,EAhCD,OAgCC,CAhCO,CAgCP,CAAA;AA2BJ;AAQA;AAQA;AAcgB,iBA7DA,YA6DwC,CAAA,CAAA,CAAA,CAAA,IAAU,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EA3DtD,IA2DsD,EAAA,GA3D7C,CA2D6C,EAAA,UAAA,CAAA,EA1DpD,UA0DoD,CAAA,EAzD/D,CAyD+D;;;;iBA9BlD,UAAA,CAAA;;;;iBAQA,SAAA,CAAA;;;;iBAQA,eAAA,QAAuB;;;;iBAcvB,YAAA,4BAAwC"}
@@ -1,167 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
3
-
4
- //#region src/instrumentation/tracing.ts
5
- /**
6
- * Get the currently active span
7
- */
8
- function getActiveSpan() {
9
- return __opentelemetry_api.trace.getActiveSpan();
10
- }
11
- /**
12
- * Set attributes on the active span
13
- */
14
- function setSpanAttributes(attributes) {
15
- const span = getActiveSpan();
16
- if (span) span.setAttributes(attributes);
17
- }
18
- /**
19
- * Create a new span as a child of the current span
20
- */
21
- function createSpan(name, attributes) {
22
- const tracer = __opentelemetry_api.trace.getTracer("@geekmidas/telescope");
23
- const span = tracer.startSpan(name, { attributes });
24
- return span;
25
- }
26
- /**
27
- * Execute a function within a new span context
28
- *
29
- * @example
30
- * ```typescript
31
- * const result = await withSpan('processOrder', async (span) => {
32
- * span.setAttribute('order.id', orderId);
33
- * const order = await processOrder(orderId);
34
- * return order;
35
- * });
36
- * ```
37
- */
38
- async function withSpan(name, fn, attributes) {
39
- const tracer = __opentelemetry_api.trace.getTracer("@geekmidas/telescope");
40
- const span = tracer.startSpan(name, { attributes });
41
- try {
42
- const result = await __opentelemetry_api.context.with(__opentelemetry_api.trace.setSpan(__opentelemetry_api.context.active(), span), () => fn(span));
43
- span.setStatus({ code: __opentelemetry_api.SpanStatusCode.OK });
44
- return result;
45
- } catch (error) {
46
- span.setStatus({
47
- code: __opentelemetry_api.SpanStatusCode.ERROR,
48
- message: error instanceof Error ? error.message : "Unknown error"
49
- });
50
- span.recordException(error instanceof Error ? error : new Error(String(error)));
51
- throw error;
52
- } finally {
53
- span.end();
54
- }
55
- }
56
- /**
57
- * Synchronous version of withSpan
58
- */
59
- function withSpanSync(name, fn, attributes) {
60
- const tracer = __opentelemetry_api.trace.getTracer("@geekmidas/telescope");
61
- const span = tracer.startSpan(name, { attributes });
62
- try {
63
- const result = __opentelemetry_api.context.with(__opentelemetry_api.trace.setSpan(__opentelemetry_api.context.active(), span), () => fn(span));
64
- span.setStatus({ code: __opentelemetry_api.SpanStatusCode.OK });
65
- return result;
66
- } catch (error) {
67
- span.setStatus({
68
- code: __opentelemetry_api.SpanStatusCode.ERROR,
69
- message: error instanceof Error ? error.message : "Unknown error"
70
- });
71
- span.recordException(error instanceof Error ? error : new Error(String(error)));
72
- throw error;
73
- } finally {
74
- span.end();
75
- }
76
- }
77
- /**
78
- * Get the current trace ID (useful for log correlation)
79
- */
80
- function getTraceId() {
81
- const span = getActiveSpan();
82
- return span?.spanContext().traceId;
83
- }
84
- /**
85
- * Get the current span ID
86
- */
87
- function getSpanId() {
88
- const span = getActiveSpan();
89
- return span?.spanContext().spanId;
90
- }
91
- /**
92
- * Record an exception on the current span
93
- */
94
- function recordException(error) {
95
- const span = getActiveSpan();
96
- if (span) {
97
- span.recordException(error);
98
- span.setStatus({
99
- code: __opentelemetry_api.SpanStatusCode.ERROR,
100
- message: error.message
101
- });
102
- }
103
- }
104
- /**
105
- * Add an event to the current span
106
- */
107
- function addSpanEvent(name, attributes) {
108
- const span = getActiveSpan();
109
- if (span) span.addEvent(name, attributes);
110
- }
111
-
112
- //#endregion
113
- Object.defineProperty(exports, 'addSpanEvent', {
114
- enumerable: true,
115
- get: function () {
116
- return addSpanEvent;
117
- }
118
- });
119
- Object.defineProperty(exports, 'createSpan', {
120
- enumerable: true,
121
- get: function () {
122
- return createSpan;
123
- }
124
- });
125
- Object.defineProperty(exports, 'getActiveSpan', {
126
- enumerable: true,
127
- get: function () {
128
- return getActiveSpan;
129
- }
130
- });
131
- Object.defineProperty(exports, 'getSpanId', {
132
- enumerable: true,
133
- get: function () {
134
- return getSpanId;
135
- }
136
- });
137
- Object.defineProperty(exports, 'getTraceId', {
138
- enumerable: true,
139
- get: function () {
140
- return getTraceId;
141
- }
142
- });
143
- Object.defineProperty(exports, 'recordException', {
144
- enumerable: true,
145
- get: function () {
146
- return recordException;
147
- }
148
- });
149
- Object.defineProperty(exports, 'setSpanAttributes', {
150
- enumerable: true,
151
- get: function () {
152
- return setSpanAttributes;
153
- }
154
- });
155
- Object.defineProperty(exports, 'withSpan', {
156
- enumerable: true,
157
- get: function () {
158
- return withSpan;
159
- }
160
- });
161
- Object.defineProperty(exports, 'withSpanSync', {
162
- enumerable: true,
163
- get: function () {
164
- return withSpanSync;
165
- }
166
- });
167
- //# sourceMappingURL=tracing-Bt1zWRlb.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing-Bt1zWRlb.cjs","names":["attributes: Attributes","name: string","attributes?: Attributes","fn: (span: Span) => Promise<T>","SpanStatusCode","fn: (span: Span) => T","error: Error"],"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;AACjD,QAAO,0BAAM,eAAe;AAC5B;;;;AAKD,SAAgB,kBAAkBA,YAA8B;CAC/D,MAAM,OAAO,eAAe;AAC5B,KAAI,KACH,MAAK,cAAc,WAAW;AAE/B;;;;AAKD,SAAgB,WAAWC,MAAcC,YAA+B;CACvE,MAAM,SAAS,0BAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AACnD,QAAO;AACP;;;;;;;;;;;;;AAcD,eAAsB,SACrBD,MACAE,IACAD,YACa;CACb,MAAM,SAAS,0BAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AAEnD,KAAI;EACH,MAAM,SAAS,MAAM,4BAAQ,KAC5B,0BAAM,QAAQ,4BAAQ,QAAQ,EAAE,KAAK,EACrC,MAAM,GAAG,KAAK,CACd;AACD,OAAK,UAAU,EAAE,MAAME,mCAAe,GAAI,EAAC;AAC3C,SAAO;CACP,SAAQ,OAAO;AACf,OAAK,UAAU;GACd,MAAMA,mCAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD,EAAC;AACF,OAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,EACxD;AACD,QAAM;CACN,UAAS;AACT,OAAK,KAAK;CACV;AACD;;;;AAKD,SAAgB,aACfH,MACAI,IACAH,YACI;CACJ,MAAM,SAAS,0BAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AAEnD,KAAI;EACH,MAAM,SAAS,4BAAQ,KAAK,0BAAM,QAAQ,4BAAQ,QAAQ,EAAE,KAAK,EAAE,MAClE,GAAG,KAAK,CACR;AACD,OAAK,UAAU,EAAE,MAAME,mCAAe,GAAI,EAAC;AAC3C,SAAO;CACP,SAAQ,OAAO;AACf,OAAK,UAAU;GACd,MAAMA,mCAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD,EAAC;AACF,OAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,EACxD;AACD,QAAM;CACN,UAAS;AACT,OAAK,KAAK;CACV;AACD;;;;AAKD,SAAgB,aAAiC;CAChD,MAAM,OAAO,eAAe;AAC5B,QAAO,MAAM,aAAa,CAAC;AAC3B;;;;AAKD,SAAgB,YAAgC;CAC/C,MAAM,OAAO,eAAe;AAC5B,QAAO,MAAM,aAAa,CAAC;AAC3B;;;;AAKD,SAAgB,gBAAgBE,OAAoB;CACnD,MAAM,OAAO,eAAe;AAC5B,KAAI,MAAM;AACT,OAAK,gBAAgB,MAAM;AAC3B,OAAK,UAAU;GACd,MAAMF,mCAAe;GACrB,SAAS,MAAM;EACf,EAAC;CACF;AACD;;;;AAKD,SAAgB,aAAaH,MAAcC,YAA+B;CACzE,MAAM,OAAO,eAAe;AAC5B,KAAI,KACH,MAAK,SAAS,MAAM,WAAW;AAEhC"}
@@ -1,113 +0,0 @@
1
- import { SpanStatusCode, context, trace } from "@opentelemetry/api";
2
-
3
- //#region src/instrumentation/tracing.ts
4
- /**
5
- * Get the currently active span
6
- */
7
- function getActiveSpan() {
8
- return 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
- const tracer = trace.getTracer("@geekmidas/telescope");
22
- const span = tracer.startSpan(name, { attributes });
23
- return span;
24
- }
25
- /**
26
- * Execute a function within a new span context
27
- *
28
- * @example
29
- * ```typescript
30
- * const result = await withSpan('processOrder', async (span) => {
31
- * span.setAttribute('order.id', orderId);
32
- * const order = await processOrder(orderId);
33
- * return order;
34
- * });
35
- * ```
36
- */
37
- async function withSpan(name, fn, attributes) {
38
- const tracer = trace.getTracer("@geekmidas/telescope");
39
- const span = tracer.startSpan(name, { attributes });
40
- try {
41
- const result = await context.with(trace.setSpan(context.active(), span), () => fn(span));
42
- span.setStatus({ code: SpanStatusCode.OK });
43
- return result;
44
- } catch (error) {
45
- span.setStatus({
46
- code: SpanStatusCode.ERROR,
47
- message: error instanceof Error ? error.message : "Unknown error"
48
- });
49
- span.recordException(error instanceof Error ? error : new Error(String(error)));
50
- throw error;
51
- } finally {
52
- span.end();
53
- }
54
- }
55
- /**
56
- * Synchronous version of withSpan
57
- */
58
- function withSpanSync(name, fn, attributes) {
59
- const tracer = trace.getTracer("@geekmidas/telescope");
60
- const span = tracer.startSpan(name, { attributes });
61
- try {
62
- const result = context.with(trace.setSpan(context.active(), span), () => fn(span));
63
- span.setStatus({ code: SpanStatusCode.OK });
64
- return result;
65
- } catch (error) {
66
- span.setStatus({
67
- code: SpanStatusCode.ERROR,
68
- message: error instanceof Error ? error.message : "Unknown error"
69
- });
70
- span.recordException(error instanceof Error ? error : new Error(String(error)));
71
- throw error;
72
- } finally {
73
- span.end();
74
- }
75
- }
76
- /**
77
- * Get the current trace ID (useful for log correlation)
78
- */
79
- function getTraceId() {
80
- const span = getActiveSpan();
81
- return span?.spanContext().traceId;
82
- }
83
- /**
84
- * Get the current span ID
85
- */
86
- function getSpanId() {
87
- const span = getActiveSpan();
88
- return span?.spanContext().spanId;
89
- }
90
- /**
91
- * Record an exception on the current span
92
- */
93
- function recordException(error) {
94
- const span = getActiveSpan();
95
- if (span) {
96
- span.recordException(error);
97
- span.setStatus({
98
- code: SpanStatusCode.ERROR,
99
- message: error.message
100
- });
101
- }
102
- }
103
- /**
104
- * Add an event to the current span
105
- */
106
- function addSpanEvent(name, attributes) {
107
- const span = getActiveSpan();
108
- if (span) span.addEvent(name, attributes);
109
- }
110
-
111
- //#endregion
112
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
113
- //# sourceMappingURL=tracing-Cijm_5NI.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing-Cijm_5NI.mjs","names":["attributes: Attributes","name: string","attributes?: Attributes","fn: (span: Span) => Promise<T>","fn: (span: Span) => T","error: Error"],"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;AACjD,QAAO,MAAM,eAAe;AAC5B;;;;AAKD,SAAgB,kBAAkBA,YAA8B;CAC/D,MAAM,OAAO,eAAe;AAC5B,KAAI,KACH,MAAK,cAAc,WAAW;AAE/B;;;;AAKD,SAAgB,WAAWC,MAAcC,YAA+B;CACvE,MAAM,SAAS,MAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AACnD,QAAO;AACP;;;;;;;;;;;;;AAcD,eAAsB,SACrBD,MACAE,IACAD,YACa;CACb,MAAM,SAAS,MAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AAEnD,KAAI;EACH,MAAM,SAAS,MAAM,QAAQ,KAC5B,MAAM,QAAQ,QAAQ,QAAQ,EAAE,KAAK,EACrC,MAAM,GAAG,KAAK,CACd;AACD,OAAK,UAAU,EAAE,MAAM,eAAe,GAAI,EAAC;AAC3C,SAAO;CACP,SAAQ,OAAO;AACf,OAAK,UAAU;GACd,MAAM,eAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD,EAAC;AACF,OAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,EACxD;AACD,QAAM;CACN,UAAS;AACT,OAAK,KAAK;CACV;AACD;;;;AAKD,SAAgB,aACfD,MACAG,IACAF,YACI;CACJ,MAAM,SAAS,MAAM,UAAU,uBAAuB;CACtD,MAAM,OAAO,OAAO,UAAU,MAAM,EAAE,WAAY,EAAC;AAEnD,KAAI;EACH,MAAM,SAAS,QAAQ,KAAK,MAAM,QAAQ,QAAQ,QAAQ,EAAE,KAAK,EAAE,MAClE,GAAG,KAAK,CACR;AACD,OAAK,UAAU,EAAE,MAAM,eAAe,GAAI,EAAC;AAC3C,SAAO;CACP,SAAQ,OAAO;AACf,OAAK,UAAU;GACd,MAAM,eAAe;GACrB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD,EAAC;AACF,OAAK,gBACJ,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,EACxD;AACD,QAAM;CACN,UAAS;AACT,OAAK,KAAK;CACV;AACD;;;;AAKD,SAAgB,aAAiC;CAChD,MAAM,OAAO,eAAe;AAC5B,QAAO,MAAM,aAAa,CAAC;AAC3B;;;;AAKD,SAAgB,YAAgC;CAC/C,MAAM,OAAO,eAAe;AAC5B,QAAO,MAAM,aAAa,CAAC;AAC3B;;;;AAKD,SAAgB,gBAAgBG,OAAoB;CACnD,MAAM,OAAO,eAAe;AAC5B,KAAI,MAAM;AACT,OAAK,gBAAgB,MAAM;AAC3B,OAAK,UAAU;GACd,MAAM,eAAe;GACrB,SAAS,MAAM;EACf,EAAC;CACF;AACD;;;;AAKD,SAAgB,aAAaJ,MAAcC,YAA+B;CACzE,MAAM,OAAO,eAAe;AAC5B,KAAI,KACH,MAAK,SAAS,MAAM,WAAW;AAEhC"}
@@ -1,53 +0,0 @@
1
- import { Attributes, Span } from "@opentelemetry/api";
2
-
3
- //#region src/instrumentation/tracing.d.ts
4
-
5
- /**
6
- * Get the currently active span
7
- */
8
- declare function getActiveSpan(): Span | undefined;
9
- /**
10
- * Set attributes on the active span
11
- */
12
- declare function setSpanAttributes(attributes: Attributes): void;
13
- /**
14
- * Create a new span as a child of the current span
15
- */
16
- declare function createSpan(name: string, attributes?: Attributes): Span;
17
- /**
18
- * Execute a function within a new span context
19
- *
20
- * @example
21
- * ```typescript
22
- * const result = await withSpan('processOrder', async (span) => {
23
- * span.setAttribute('order.id', orderId);
24
- * const order = await processOrder(orderId);
25
- * return order;
26
- * });
27
- * ```
28
- */
29
- declare function withSpan<T>(name: string, fn: (span: Span) => Promise<T>, attributes?: Attributes): Promise<T>;
30
- /**
31
- * Synchronous version of withSpan
32
- */
33
- declare function withSpanSync<T>(name: string, fn: (span: Span) => T, attributes?: Attributes): T;
34
- /**
35
- * Get the current trace ID (useful for log correlation)
36
- */
37
- declare function getTraceId(): string | undefined;
38
- /**
39
- * Get the current span ID
40
- */
41
- declare function getSpanId(): string | undefined;
42
- /**
43
- * Record an exception on the current span
44
- */
45
- declare function recordException(error: Error): void;
46
- /**
47
- * Add an event to the current span
48
- */
49
- declare function addSpanEvent(name: string, attributes?: Attributes): void;
50
- //# sourceMappingURL=tracing.d.ts.map
51
- //#endregion
52
- export { addSpanEvent, createSpan, getActiveSpan, getSpanId, getTraceId, recordException, setSpanAttributes, withSpan, withSpanSync };
53
- //# sourceMappingURL=tracing-PnECEbEu.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing-PnECEbEu.d.mts","names":[],"sources":["../src/instrumentation/tracing.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;AAOgB,iBAPA,aAAA,CAAA,CAO8B,EAPb,IAOuB,GAAA,SAAA;AAUxD;;;AAAmE,iBAVnD,iBAAA,CAUmD,UAAA,EAVrB,UAUqB,CAAA,EAAA,IAAA;AAAI;AAkBvE;;AAEY,iBApBI,UAAA,CAoBJ,IAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EApB0C,UAoB1C,CAAA,EApBuD,IAoBvD;;;;;;AAEF;AA4BV;;;;;;AAII,iBApCkB,QAoClB,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EAlCQ,IAkCR,EAAA,GAlCiB,OAkCjB,CAlCyB,CAkCzB,CAAA,EAAA,UAAA,CAAA,EAjCU,UAiCV,CAAA,EAhCD,OAgCC,CAhCO,CAgCP,CAAA;AA2BJ;AAQA;AAQA;AAcgB,iBA7DA,YA6DwC,CAAA,CAAA,CAAU,CAAA,IAAA,EAAA,MAAA,EAAA,EAAA,EAAA,CAAA,IAAA,EA3DtD,IA2DsD,EAAA,GA3D7C,CA2D6C,EAAA,UAAA,CAAA,EA1DpD,UA0DoD,CAAA,EAzD/D,CAyD+D;;;;iBA9BlD,UAAA,CAAA;;;;iBAQA,SAAA,CAAA;;;;iBAQA,eAAA,QAAuB;;;;iBAcvB,YAAA,4BAAwC"}