autotel 3.5.0 → 3.7.0

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 (591) hide show
  1. package/dist/attribute-redacting-processor-DtTS9xxh.d.cts +175 -0
  2. package/dist/attribute-redacting-processor-DtTS9xxh.d.cts.map +1 -0
  3. package/dist/attribute-redacting-processor-DtTS9xxh.d.ts +175 -0
  4. package/dist/attribute-redacting-processor-DtTS9xxh.d.ts.map +1 -0
  5. package/dist/attribute-redacting-processor.cjs +374 -33
  6. package/dist/attribute-redacting-processor.cjs.map +1 -1
  7. package/dist/attribute-redacting-processor.d.cts +2 -207
  8. package/dist/attribute-redacting-processor.d.ts +2 -207
  9. package/dist/attribute-redacting-processor.js +368 -2
  10. package/dist/attribute-redacting-processor.js.map +1 -1
  11. package/dist/attributes-D3etyRVc.cjs +713 -0
  12. package/dist/attributes-D3etyRVc.cjs.map +1 -0
  13. package/dist/attributes-ksn4HVbd.js +600 -0
  14. package/dist/attributes-ksn4HVbd.js.map +1 -0
  15. package/dist/attributes.cjs +21 -85
  16. package/dist/attributes.d.cts +2 -20
  17. package/dist/attributes.d.ts +2 -20
  18. package/dist/attributes.js +3 -5
  19. package/dist/auto.cjs +50 -28
  20. package/dist/auto.cjs.map +1 -1
  21. package/dist/auto.d.cts +1 -2
  22. package/dist/auto.d.ts +1 -2
  23. package/dist/auto.js +49 -23
  24. package/dist/auto.js.map +1 -1
  25. package/dist/business-baggage.cjs +357 -13
  26. package/dist/business-baggage.cjs.map +1 -1
  27. package/dist/business-baggage.d.cts +106 -139
  28. package/dist/business-baggage.d.cts.map +1 -0
  29. package/dist/business-baggage.d.ts +106 -139
  30. package/dist/business-baggage.d.ts.map +1 -0
  31. package/dist/business-baggage.js +357 -2
  32. package/dist/business-baggage.js.map +1 -1
  33. package/dist/canonical-log-line-processor--RlFDHhm.cjs +377 -0
  34. package/dist/canonical-log-line-processor--RlFDHhm.cjs.map +1 -0
  35. package/dist/canonical-log-line-processor-BcRuAdRk.d.ts +147 -0
  36. package/dist/canonical-log-line-processor-BcRuAdRk.d.ts.map +1 -0
  37. package/dist/canonical-log-line-processor-DbBQT5vY.js +366 -0
  38. package/dist/canonical-log-line-processor-DbBQT5vY.js.map +1 -0
  39. package/dist/canonical-log-line-processor-xvjMgtpF.d.cts +147 -0
  40. package/dist/canonical-log-line-processor-xvjMgtpF.d.cts.map +1 -0
  41. package/dist/config.cjs +118 -22
  42. package/dist/config.cjs.map +1 -1
  43. package/dist/config.d.cts +33 -45
  44. package/dist/config.d.cts.map +1 -0
  45. package/dist/config.d.ts +33 -45
  46. package/dist/config.d.ts.map +1 -0
  47. package/dist/config.js +116 -3
  48. package/dist/config.js.map +1 -1
  49. package/dist/correlated-events-Bzh5y-UB.js +28 -0
  50. package/dist/correlated-events-Bzh5y-UB.js.map +1 -0
  51. package/dist/correlated-events-kSwLo3mi.cjs +34 -0
  52. package/dist/correlated-events-kSwLo3mi.cjs.map +1 -0
  53. package/dist/correlation-id.cjs +11 -53
  54. package/dist/correlation-id.d.cts +6 -5
  55. package/dist/correlation-id.d.cts.map +1 -0
  56. package/dist/correlation-id.d.ts +6 -5
  57. package/dist/correlation-id.d.ts.map +1 -0
  58. package/dist/correlation-id.js +3 -16
  59. package/dist/db.cjs +244 -209
  60. package/dist/db.cjs.map +1 -1
  61. package/dist/db.d.cts +28 -26
  62. package/dist/db.d.cts.map +1 -0
  63. package/dist/db.d.ts +28 -26
  64. package/dist/db.d.ts.map +1 -0
  65. package/dist/db.js +243 -207
  66. package/dist/db.js.map +1 -1
  67. package/dist/decorators.cjs +39 -65
  68. package/dist/decorators.cjs.map +1 -1
  69. package/dist/decorators.d.cts +10 -37
  70. package/dist/decorators.d.cts.map +1 -0
  71. package/dist/decorators.d.ts +10 -37
  72. package/dist/decorators.d.ts.map +1 -0
  73. package/dist/decorators.js +38 -63
  74. package/dist/decorators.js.map +1 -1
  75. package/dist/define-event-CreknLm3.d.ts +25 -0
  76. package/dist/define-event-CreknLm3.d.ts.map +1 -0
  77. package/dist/define-event-HZRizPwz.d.cts +25 -0
  78. package/dist/define-event-HZRizPwz.d.cts.map +1 -0
  79. package/dist/drain-pipeline.cjs +111 -9
  80. package/dist/drain-pipeline.cjs.map +1 -1
  81. package/dist/drain-pipeline.d.cts +27 -32
  82. package/dist/drain-pipeline.d.cts.map +1 -0
  83. package/dist/drain-pipeline.d.ts +27 -32
  84. package/dist/drain-pipeline.d.ts.map +1 -0
  85. package/dist/drain-pipeline.js +111 -2
  86. package/dist/drain-pipeline.js.map +1 -1
  87. package/dist/enrichers.cjs +59 -66
  88. package/dist/enrichers.cjs.map +1 -1
  89. package/dist/enrichers.d.cts +15 -13
  90. package/dist/enrichers.d.cts.map +1 -0
  91. package/dist/enrichers.d.ts +15 -13
  92. package/dist/enrichers.d.ts.map +1 -0
  93. package/dist/enrichers.js +58 -65
  94. package/dist/enrichers.js.map +1 -1
  95. package/dist/event-Dlqr4ZNL.cjs +778 -0
  96. package/dist/event-Dlqr4ZNL.cjs.map +1 -0
  97. package/dist/event-_58ryBjh.js +761 -0
  98. package/dist/event-_58ryBjh.js.map +1 -0
  99. package/dist/event-subscriber-D1XLkPzi.d.cts +223 -0
  100. package/dist/event-subscriber-D1XLkPzi.d.cts.map +1 -0
  101. package/dist/event-subscriber-D1XLkPzi.d.ts +223 -0
  102. package/dist/event-subscriber-D1XLkPzi.d.ts.map +1 -0
  103. package/dist/event-subscriber.cjs +0 -6
  104. package/dist/event-subscriber.d.cts +2 -221
  105. package/dist/event-subscriber.d.ts +2 -221
  106. package/dist/event-subscriber.js +1 -3
  107. package/dist/event-testing-BqRnI0z4.d.cts +106 -0
  108. package/dist/event-testing-BqRnI0z4.d.cts.map +1 -0
  109. package/dist/event-testing-CfFs3to2.d.ts +106 -0
  110. package/dist/event-testing-CfFs3to2.d.ts.map +1 -0
  111. package/dist/event-testing.cjs +93 -17
  112. package/dist/event-testing.cjs.map +1 -1
  113. package/dist/event-testing.d.cts +2 -110
  114. package/dist/event-testing.d.ts +2 -110
  115. package/dist/event-testing.js +91 -2
  116. package/dist/event-testing.js.map +1 -1
  117. package/dist/event.cjs +5 -36
  118. package/dist/event.d.cts +295 -340
  119. package/dist/event.d.cts.map +1 -0
  120. package/dist/event.d.ts +295 -340
  121. package/dist/event.d.ts.map +1 -0
  122. package/dist/event.js +3 -20
  123. package/dist/exporters.cjs +12 -16
  124. package/dist/exporters.d.cts +86 -111
  125. package/dist/exporters.d.cts.map +1 -0
  126. package/dist/exporters.d.ts +86 -111
  127. package/dist/exporters.d.ts.map +1 -0
  128. package/dist/exporters.js +4 -4
  129. package/dist/filtering-span-processor-B8R8B7Uk.d.cts +59 -0
  130. package/dist/filtering-span-processor-B8R8B7Uk.d.cts.map +1 -0
  131. package/dist/filtering-span-processor-B8R8B7Uk.d.ts +59 -0
  132. package/dist/filtering-span-processor-B8R8B7Uk.d.ts.map +1 -0
  133. package/dist/filtering-span-processor.cjs +49 -9
  134. package/dist/filtering-span-processor.cjs.map +1 -1
  135. package/dist/filtering-span-processor.d.cts +2 -80
  136. package/dist/filtering-span-processor.d.ts +2 -80
  137. package/dist/filtering-span-processor.js +49 -2
  138. package/dist/filtering-span-processor.js.map +1 -1
  139. package/dist/functional-BGkT8J-h.js +1265 -0
  140. package/dist/functional-BGkT8J-h.js.map +1 -0
  141. package/dist/functional-C4CzoVrX.cjs +1312 -0
  142. package/dist/functional-C4CzoVrX.cjs.map +1 -0
  143. package/dist/functional.cjs +11 -56
  144. package/dist/functional.d.cts +96 -97
  145. package/dist/functional.d.cts.map +1 -0
  146. package/dist/functional.d.ts +96 -97
  147. package/dist/functional.d.ts.map +1 -0
  148. package/dist/functional.js +3 -19
  149. package/dist/http.cjs +276 -175
  150. package/dist/http.cjs.map +1 -1
  151. package/dist/http.d.cts +17 -37
  152. package/dist/http.d.cts.map +1 -0
  153. package/dist/http.d.ts +17 -37
  154. package/dist/http.d.ts.map +1 -0
  155. package/dist/http.js +275 -173
  156. package/dist/http.js.map +1 -1
  157. package/dist/index-CX0aG1Uh.d.ts +708 -0
  158. package/dist/index-CX0aG1Uh.d.ts.map +1 -0
  159. package/dist/index-DIWZFKUS.d.cts +708 -0
  160. package/dist/index-DIWZFKUS.d.cts.map +1 -0
  161. package/dist/index.cjs +1050 -1184
  162. package/dist/index.cjs.map +1 -1
  163. package/dist/index.d.cts +401 -570
  164. package/dist/index.d.cts.map +1 -0
  165. package/dist/index.d.ts +401 -570
  166. package/dist/index.d.ts.map +1 -0
  167. package/dist/index.js +913 -725
  168. package/dist/index.js.map +1 -1
  169. package/dist/init-CNp-ee80.d.cts +1157 -0
  170. package/dist/init-CNp-ee80.d.cts.map +1 -0
  171. package/dist/init-Ch6t7MNI.js +1015 -0
  172. package/dist/init-Ch6t7MNI.js.map +1 -0
  173. package/dist/init-DJQOdVlN.d.ts +1157 -0
  174. package/dist/init-DJQOdVlN.d.ts.map +1 -0
  175. package/dist/init-DvapOXCc.cjs +1092 -0
  176. package/dist/init-DvapOXCc.cjs.map +1 -0
  177. package/dist/instrumentation.cjs +159 -185
  178. package/dist/instrumentation.cjs.map +1 -1
  179. package/dist/instrumentation.d.cts +42 -40
  180. package/dist/instrumentation.d.cts.map +1 -0
  181. package/dist/instrumentation.d.ts +42 -40
  182. package/dist/instrumentation.d.ts.map +1 -0
  183. package/dist/instrumentation.js +158 -183
  184. package/dist/instrumentation.js.map +1 -1
  185. package/dist/logger-BauSUhUv.d.cts +313 -0
  186. package/dist/logger-BauSUhUv.d.cts.map +1 -0
  187. package/dist/logger-BauSUhUv.d.ts +313 -0
  188. package/dist/logger-BauSUhUv.d.ts.map +1 -0
  189. package/dist/logger.cjs +225 -25
  190. package/dist/logger.cjs.map +1 -1
  191. package/dist/logger.d.cts +2 -348
  192. package/dist/logger.d.ts +2 -348
  193. package/dist/logger.js +204 -4
  194. package/dist/logger.js.map +1 -1
  195. package/dist/messaging-adapters.cjs +292 -187
  196. package/dist/messaging-adapters.cjs.map +1 -1
  197. package/dist/messaging-adapters.d.cts +28 -66
  198. package/dist/messaging-adapters.d.cts.map +1 -0
  199. package/dist/messaging-adapters.d.ts +28 -66
  200. package/dist/messaging-adapters.d.ts.map +1 -0
  201. package/dist/messaging-adapters.js +291 -185
  202. package/dist/messaging-adapters.js.map +1 -1
  203. package/dist/messaging-testing.cjs +306 -372
  204. package/dist/messaging-testing.cjs.map +1 -1
  205. package/dist/messaging-testing.d.cts +194 -223
  206. package/dist/messaging-testing.d.cts.map +1 -0
  207. package/dist/messaging-testing.d.ts +194 -223
  208. package/dist/messaging-testing.d.ts.map +1 -0
  209. package/dist/messaging-testing.js +305 -371
  210. package/dist/messaging-testing.js.map +1 -1
  211. package/dist/messaging.cjs +757 -35
  212. package/dist/messaging.cjs.map +1 -1
  213. package/dist/messaging.d.cts +603 -644
  214. package/dist/messaging.d.cts.map +1 -0
  215. package/dist/messaging.d.ts +603 -644
  216. package/dist/messaging.d.ts.map +1 -0
  217. package/dist/messaging.js +756 -20
  218. package/dist/messaging.js.map +1 -1
  219. package/dist/metric-helpers.cjs +27 -27
  220. package/dist/metric-helpers.cjs.map +1 -1
  221. package/dist/metric-helpers.d.cts +4 -2
  222. package/dist/metric-helpers.d.cts.map +1 -0
  223. package/dist/metric-helpers.d.ts +4 -2
  224. package/dist/metric-helpers.d.ts.map +1 -0
  225. package/dist/metric-helpers.js +24 -4
  226. package/dist/metric-helpers.js.map +1 -1
  227. package/dist/metric-testing-DXdK3-Q3.d.ts +106 -0
  228. package/dist/metric-testing-DXdK3-Q3.d.ts.map +1 -0
  229. package/dist/metric-testing-MxvzChDp.d.cts +106 -0
  230. package/dist/metric-testing-MxvzChDp.d.cts.map +1 -0
  231. package/dist/metric-testing.cjs +93 -17
  232. package/dist/metric-testing.cjs.map +1 -1
  233. package/dist/metric-testing.d.cts +2 -110
  234. package/dist/metric-testing.d.ts +2 -110
  235. package/dist/metric-testing.js +91 -2
  236. package/dist/metric-testing.js.map +1 -1
  237. package/dist/metric.cjs +306 -22
  238. package/dist/metric.cjs.map +1 -1
  239. package/dist/metric.d.cts +170 -198
  240. package/dist/metric.d.cts.map +1 -0
  241. package/dist/metric.d.ts +170 -198
  242. package/dist/metric.d.ts.map +1 -0
  243. package/dist/metric.js +277 -7
  244. package/dist/metric.js.map +1 -1
  245. package/dist/node-require-DF5QBX6z.cjs +99 -0
  246. package/dist/node-require-DF5QBX6z.cjs.map +1 -0
  247. package/dist/node-require-Db1oDpLj.js +88 -0
  248. package/dist/node-require-Db1oDpLj.js.map +1 -0
  249. package/dist/operation-context-C-2hmmtP.js +59 -0
  250. package/dist/operation-context-C-2hmmtP.js.map +1 -0
  251. package/dist/operation-context-n4_obUwq.cjs +70 -0
  252. package/dist/operation-context-n4_obUwq.cjs.map +1 -0
  253. package/dist/parse-error.cjs +55 -9
  254. package/dist/parse-error.cjs.map +1 -1
  255. package/dist/parse-error.d.cts +12 -10
  256. package/dist/parse-error.d.cts.map +1 -0
  257. package/dist/parse-error.d.ts +12 -10
  258. package/dist/parse-error.d.ts.map +1 -0
  259. package/dist/parse-error.js +55 -2
  260. package/dist/parse-error.js.map +1 -1
  261. package/dist/pretty-console-exporter-CMzlrRNg.cjs +232 -0
  262. package/dist/pretty-console-exporter-CMzlrRNg.cjs.map +1 -0
  263. package/dist/pretty-console-exporter-DqKl_q9z.js +227 -0
  264. package/dist/pretty-console-exporter-DqKl_q9z.js.map +1 -0
  265. package/dist/processors.cjs +13 -17
  266. package/dist/processors.d.cts +3 -171
  267. package/dist/processors.d.ts +3 -171
  268. package/dist/processors.js +4 -4
  269. package/dist/register.cjs +35 -6
  270. package/dist/register.cjs.map +1 -1
  271. package/dist/register.d.cts +1 -2
  272. package/dist/register.d.ts +1 -2
  273. package/dist/register.js +36 -3
  274. package/dist/register.js.map +1 -1
  275. package/dist/registry-DfXA3R1L.js +184 -0
  276. package/dist/registry-DfXA3R1L.js.map +1 -0
  277. package/dist/registry-JZg2J3RZ.cjs +334 -0
  278. package/dist/registry-JZg2J3RZ.cjs.map +1 -0
  279. package/dist/sampling-CR0Va1VB.d.ts +351 -0
  280. package/dist/sampling-CR0Va1VB.d.ts.map +1 -0
  281. package/dist/sampling-DfYhDJij.d.cts +351 -0
  282. package/dist/sampling-DfYhDJij.d.cts.map +1 -0
  283. package/dist/sampling.cjs +452 -60
  284. package/dist/sampling.cjs.map +1 -1
  285. package/dist/sampling.d.cts +2 -379
  286. package/dist/sampling.d.ts +2 -379
  287. package/dist/sampling.js +441 -5
  288. package/dist/sampling.js.map +1 -1
  289. package/dist/security-schema.cjs +65 -46
  290. package/dist/security-schema.cjs.map +1 -1
  291. package/dist/security-schema.d.cts +23 -26
  292. package/dist/security-schema.d.cts.map +1 -0
  293. package/dist/security-schema.d.ts +23 -26
  294. package/dist/security-schema.d.ts.map +1 -0
  295. package/dist/security-schema.js +64 -45
  296. package/dist/security-schema.js.map +1 -1
  297. package/dist/semantic-conventions-FhSxv-bK.d.cts +32 -0
  298. package/dist/semantic-conventions-FhSxv-bK.d.cts.map +1 -0
  299. package/dist/semantic-conventions-FhSxv-bK.d.ts +32 -0
  300. package/dist/semantic-conventions-FhSxv-bK.d.ts.map +1 -0
  301. package/dist/semantic-conventions.cjs +15 -26
  302. package/dist/semantic-conventions.cjs.map +1 -1
  303. package/dist/semantic-conventions.d.cts +2 -29
  304. package/dist/semantic-conventions.d.ts +2 -29
  305. package/dist/semantic-conventions.js +12 -3
  306. package/dist/semantic-conventions.js.map +1 -1
  307. package/dist/semantic-helpers.cjs +440 -38
  308. package/dist/semantic-helpers.cjs.map +1 -1
  309. package/dist/semantic-helpers.d.cts +38 -45
  310. package/dist/semantic-helpers.d.cts.map +1 -0
  311. package/dist/semantic-helpers.d.ts +38 -45
  312. package/dist/semantic-helpers.d.ts.map +1 -0
  313. package/dist/semantic-helpers.js +438 -19
  314. package/dist/semantic-helpers.js.map +1 -1
  315. package/dist/span-name-normalizer-8ZOGJuwv.d.cts +70 -0
  316. package/dist/span-name-normalizer-8ZOGJuwv.d.cts.map +1 -0
  317. package/dist/span-name-normalizer-8ZOGJuwv.d.ts +70 -0
  318. package/dist/span-name-normalizer-8ZOGJuwv.d.ts.map +1 -0
  319. package/dist/span-name-normalizer.cjs +95 -17
  320. package/dist/span-name-normalizer.cjs.map +1 -1
  321. package/dist/span-name-normalizer.d.cts +2 -94
  322. package/dist/span-name-normalizer.d.ts +2 -94
  323. package/dist/span-name-normalizer.js +93 -2
  324. package/dist/span-name-normalizer.js.map +1 -1
  325. package/dist/stable-hash-BNTMrmdB.cjs +28 -0
  326. package/dist/stable-hash-BNTMrmdB.cjs.map +1 -0
  327. package/dist/stable-hash-Cg5cT34Q.js +23 -0
  328. package/dist/stable-hash-Cg5cT34Q.js.map +1 -0
  329. package/dist/structured-error-9--cxBay.js +143 -0
  330. package/dist/structured-error-9--cxBay.js.map +1 -0
  331. package/dist/structured-error-CHg7DoIQ.cjs +178 -0
  332. package/dist/structured-error-CHg7DoIQ.cjs.map +1 -0
  333. package/dist/tail-sampling-processor.cjs +26 -13
  334. package/dist/tail-sampling-processor.cjs.map +1 -1
  335. package/dist/tail-sampling-processor.d.cts +11 -23
  336. package/dist/tail-sampling-processor.d.cts.map +1 -0
  337. package/dist/tail-sampling-processor.d.ts +11 -23
  338. package/dist/tail-sampling-processor.d.ts.map +1 -0
  339. package/dist/tail-sampling-processor.js +27 -6
  340. package/dist/tail-sampling-processor.js.map +1 -1
  341. package/dist/test-span-collector.cjs +70 -72
  342. package/dist/test-span-collector.cjs.map +1 -1
  343. package/dist/test-span-collector.d.cts +25 -43
  344. package/dist/test-span-collector.d.cts.map +1 -0
  345. package/dist/test-span-collector.d.ts +25 -43
  346. package/dist/test-span-collector.d.ts.map +1 -0
  347. package/dist/test-span-collector.js +69 -70
  348. package/dist/test-span-collector.js.map +1 -1
  349. package/dist/testing.cjs +389 -278
  350. package/dist/testing.cjs.map +1 -1
  351. package/dist/testing.d.cts +39 -62
  352. package/dist/testing.d.cts.map +1 -0
  353. package/dist/testing.d.ts +39 -62
  354. package/dist/testing.d.ts.map +1 -0
  355. package/dist/testing.js +386 -265
  356. package/dist/testing.js.map +1 -1
  357. package/dist/trace-context-Cijqoi6e.d.cts +212 -0
  358. package/dist/trace-context-Cijqoi6e.d.cts.map +1 -0
  359. package/dist/trace-context-Cijqoi6e.d.ts +212 -0
  360. package/dist/trace-context-Cijqoi6e.d.ts.map +1 -0
  361. package/dist/trace-helpers.cjs +634 -54
  362. package/dist/trace-helpers.cjs.map +1 -1
  363. package/dist/trace-helpers.d.cts +17 -49
  364. package/dist/trace-helpers.d.cts.map +1 -0
  365. package/dist/trace-helpers.d.ts +17 -49
  366. package/dist/trace-helpers.d.ts.map +1 -0
  367. package/dist/trace-helpers.js +624 -3
  368. package/dist/trace-helpers.js.map +1 -1
  369. package/dist/tracer-provider.cjs +227 -16
  370. package/dist/tracer-provider.cjs.map +1 -1
  371. package/dist/tracer-provider.d.cts +5 -4
  372. package/dist/tracer-provider.d.cts.map +1 -0
  373. package/dist/tracer-provider.d.ts +5 -4
  374. package/dist/tracer-provider.d.ts.map +1 -0
  375. package/dist/tracer-provider.js +227 -2
  376. package/dist/tracer-provider.js.map +1 -1
  377. package/dist/track-3HY4NGV-.cjs +1212 -0
  378. package/dist/track-3HY4NGV-.cjs.map +1 -0
  379. package/dist/track-nsKVy-pj.js +1111 -0
  380. package/dist/track-nsKVy-pj.js.map +1 -0
  381. package/dist/validate.cjs +201 -0
  382. package/dist/validate.cjs.map +1 -0
  383. package/dist/validate.d.cts +105 -0
  384. package/dist/validate.d.cts.map +1 -0
  385. package/dist/validate.d.ts +105 -0
  386. package/dist/validate.d.ts.map +1 -0
  387. package/dist/validate.js +197 -0
  388. package/dist/validate.js.map +1 -0
  389. package/dist/validation-attributes.cjs +45 -0
  390. package/dist/validation-attributes.cjs.map +1 -0
  391. package/dist/validation-attributes.d.cts +33 -0
  392. package/dist/validation-attributes.d.cts.map +1 -0
  393. package/dist/validation-attributes.d.ts +33 -0
  394. package/dist/validation-attributes.d.ts.map +1 -0
  395. package/dist/validation-attributes.js +41 -0
  396. package/dist/validation-attributes.js.map +1 -0
  397. package/dist/webhook.cjs +286 -255
  398. package/dist/webhook.cjs.map +1 -1
  399. package/dist/webhook.d.cts +157 -192
  400. package/dist/webhook.d.cts.map +1 -0
  401. package/dist/webhook.d.ts +157 -192
  402. package/dist/webhook.d.ts.map +1 -0
  403. package/dist/webhook.js +285 -253
  404. package/dist/webhook.js.map +1 -1
  405. package/dist/workflow-distributed.cjs +498 -411
  406. package/dist/workflow-distributed.cjs.map +1 -1
  407. package/dist/workflow-distributed.d.cts +163 -173
  408. package/dist/workflow-distributed.d.cts.map +1 -0
  409. package/dist/workflow-distributed.d.ts +163 -173
  410. package/dist/workflow-distributed.d.ts.map +1 -0
  411. package/dist/workflow-distributed.js +497 -409
  412. package/dist/workflow-distributed.js.map +1 -1
  413. package/dist/workflow.cjs +405 -39
  414. package/dist/workflow.cjs.map +1 -1
  415. package/dist/workflow.d.cts +78 -131
  416. package/dist/workflow.d.cts.map +1 -0
  417. package/dist/workflow.d.ts +78 -131
  418. package/dist/workflow.d.ts.map +1 -0
  419. package/dist/workflow.js +403 -20
  420. package/dist/workflow.js.map +1 -1
  421. package/dist/yaml-config-B3dQ82GR.cjs +272 -0
  422. package/dist/yaml-config-B3dQ82GR.cjs.map +1 -0
  423. package/dist/yaml-config.cjs +5 -24
  424. package/dist/yaml-config.d.cts +30 -64
  425. package/dist/yaml-config.d.cts.map +1 -0
  426. package/dist/yaml-config.d.ts +30 -64
  427. package/dist/yaml-config.d.ts.map +1 -0
  428. package/dist/yaml-config.js +226 -7
  429. package/dist/yaml-config.js.map +1 -1
  430. package/package.json +14 -4
  431. package/src/define-event.ts +2 -21
  432. package/src/index.ts +3 -0
  433. package/src/request-logger.test.ts +53 -1
  434. package/src/request-logger.ts +58 -0
  435. package/src/stable-hash.ts +27 -0
  436. package/src/validate.test.ts +287 -0
  437. package/src/validate.ts +307 -0
  438. package/src/validation-attributes.ts +43 -0
  439. package/dist/attributes.cjs.map +0 -1
  440. package/dist/attributes.js.map +0 -1
  441. package/dist/chunk-2ZKEORFN.cjs +0 -14
  442. package/dist/chunk-2ZKEORFN.cjs.map +0 -1
  443. package/dist/chunk-3QXBFGKP.js +0 -344
  444. package/dist/chunk-3QXBFGKP.js.map +0 -1
  445. package/dist/chunk-454CH4OV.js +0 -744
  446. package/dist/chunk-454CH4OV.js.map +0 -1
  447. package/dist/chunk-4A53YIAX.js +0 -180
  448. package/dist/chunk-4A53YIAX.js.map +0 -1
  449. package/dist/chunk-4IFSYQVX.js +0 -337
  450. package/dist/chunk-4IFSYQVX.js.map +0 -1
  451. package/dist/chunk-4P6ZOARG.cjs +0 -33
  452. package/dist/chunk-4P6ZOARG.cjs.map +0 -1
  453. package/dist/chunk-55ER2KD5.js +0 -228
  454. package/dist/chunk-55ER2KD5.js.map +0 -1
  455. package/dist/chunk-5ZN622AO.js +0 -73
  456. package/dist/chunk-5ZN622AO.js.map +0 -1
  457. package/dist/chunk-6S5RUKU3.cjs +0 -347
  458. package/dist/chunk-6S5RUKU3.cjs.map +0 -1
  459. package/dist/chunk-6UQRVUN3.js +0 -222
  460. package/dist/chunk-6UQRVUN3.js.map +0 -1
  461. package/dist/chunk-7552UTQW.js +0 -11
  462. package/dist/chunk-7552UTQW.js.map +0 -1
  463. package/dist/chunk-7EQ4G4SI.cjs +0 -146
  464. package/dist/chunk-7EQ4G4SI.cjs.map +0 -1
  465. package/dist/chunk-7SAWIN74.js +0 -285
  466. package/dist/chunk-7SAWIN74.js.map +0 -1
  467. package/dist/chunk-A4E5AQFK.js +0 -30
  468. package/dist/chunk-A4E5AQFK.js.map +0 -1
  469. package/dist/chunk-AC5GNZKB.cjs +0 -344
  470. package/dist/chunk-AC5GNZKB.cjs.map +0 -1
  471. package/dist/chunk-ALPYR2GC.js +0 -1061
  472. package/dist/chunk-ALPYR2GC.js.map +0 -1
  473. package/dist/chunk-BZHG5IZ4.js +0 -73
  474. package/dist/chunk-BZHG5IZ4.js.map +0 -1
  475. package/dist/chunk-CEAQK2QY.cjs +0 -32
  476. package/dist/chunk-CEAQK2QY.cjs.map +0 -1
  477. package/dist/chunk-CMHVQR6P.js +0 -170
  478. package/dist/chunk-CMHVQR6P.js.map +0 -1
  479. package/dist/chunk-CU6IDACR.cjs +0 -224
  480. package/dist/chunk-CU6IDACR.cjs.map +0 -1
  481. package/dist/chunk-DPSA4QLA.js +0 -344
  482. package/dist/chunk-DPSA4QLA.js.map +0 -1
  483. package/dist/chunk-DQEHQNQE.js +0 -795
  484. package/dist/chunk-DQEHQNQE.js.map +0 -1
  485. package/dist/chunk-ESLWRGAG.cjs +0 -92
  486. package/dist/chunk-ESLWRGAG.cjs.map +0 -1
  487. package/dist/chunk-ESMHTKLJ.cjs +0 -206
  488. package/dist/chunk-ESMHTKLJ.cjs.map +0 -1
  489. package/dist/chunk-FGNDN2FD.cjs +0 -1242
  490. package/dist/chunk-FGNDN2FD.cjs.map +0 -1
  491. package/dist/chunk-FU6R566Y.cjs +0 -236
  492. package/dist/chunk-FU6R566Y.cjs.map +0 -1
  493. package/dist/chunk-GBFTC7Q7.cjs +0 -837
  494. package/dist/chunk-GBFTC7Q7.cjs.map +0 -1
  495. package/dist/chunk-GYR5K654.js +0 -91
  496. package/dist/chunk-GYR5K654.js.map +0 -1
  497. package/dist/chunk-HA2WBOGQ.js +0 -57
  498. package/dist/chunk-HA2WBOGQ.js.map +0 -1
  499. package/dist/chunk-HT5JQKN2.js +0 -118
  500. package/dist/chunk-HT5JQKN2.js.map +0 -1
  501. package/dist/chunk-INJD3G4K.cjs +0 -340
  502. package/dist/chunk-INJD3G4K.cjs.map +0 -1
  503. package/dist/chunk-IOYFAFHJ.cjs +0 -95
  504. package/dist/chunk-IOYFAFHJ.cjs.map +0 -1
  505. package/dist/chunk-J5QENANM.js +0 -87
  506. package/dist/chunk-J5QENANM.js.map +0 -1
  507. package/dist/chunk-J7VGRIAJ.js +0 -64
  508. package/dist/chunk-J7VGRIAJ.js.map +0 -1
  509. package/dist/chunk-KFOHQK7X.js +0 -144
  510. package/dist/chunk-KFOHQK7X.js.map +0 -1
  511. package/dist/chunk-KIL5CUN6.js +0 -31
  512. package/dist/chunk-KIL5CUN6.js.map +0 -1
  513. package/dist/chunk-LITNXTTT.js +0 -3
  514. package/dist/chunk-LITNXTTT.js.map +0 -1
  515. package/dist/chunk-M3LFHHTN.cjs +0 -764
  516. package/dist/chunk-M3LFHHTN.cjs.map +0 -1
  517. package/dist/chunk-NEIB3TLD.cjs +0 -360
  518. package/dist/chunk-NEIB3TLD.cjs.map +0 -1
  519. package/dist/chunk-NVAI5CCN.cjs +0 -39
  520. package/dist/chunk-NVAI5CCN.cjs.map +0 -1
  521. package/dist/chunk-NVGPMGI4.js +0 -95
  522. package/dist/chunk-NVGPMGI4.js.map +0 -1
  523. package/dist/chunk-NZ72VDNY.cjs +0 -4
  524. package/dist/chunk-NZ72VDNY.cjs.map +0 -1
  525. package/dist/chunk-O4JZUCUE.js +0 -1174
  526. package/dist/chunk-O4JZUCUE.js.map +0 -1
  527. package/dist/chunk-O7JOKRN2.js +0 -833
  528. package/dist/chunk-O7JOKRN2.js.map +0 -1
  529. package/dist/chunk-OPPXYVEZ.cjs +0 -131
  530. package/dist/chunk-OPPXYVEZ.cjs.map +0 -1
  531. package/dist/chunk-Q4EULJQY.js +0 -35
  532. package/dist/chunk-Q4EULJQY.js.map +0 -1
  533. package/dist/chunk-QWW3E3JM.cjs +0 -178
  534. package/dist/chunk-QWW3E3JM.cjs.map +0 -1
  535. package/dist/chunk-R7QYGZUP.cjs +0 -1075
  536. package/dist/chunk-R7QYGZUP.cjs.map +0 -1
  537. package/dist/chunk-RUPKBKUF.js +0 -352
  538. package/dist/chunk-RUPKBKUF.js.map +0 -1
  539. package/dist/chunk-SEO6NAQT.js +0 -14
  540. package/dist/chunk-SEO6NAQT.js.map +0 -1
  541. package/dist/chunk-T4B5LB6E.cjs +0 -66
  542. package/dist/chunk-T4B5LB6E.cjs.map +0 -1
  543. package/dist/chunk-TC5ZPWM4.cjs +0 -289
  544. package/dist/chunk-TC5ZPWM4.cjs.map +0 -1
  545. package/dist/chunk-TQ5UWA7S.js +0 -26
  546. package/dist/chunk-TQ5UWA7S.js.map +0 -1
  547. package/dist/chunk-URHPSJW2.js +0 -339
  548. package/dist/chunk-URHPSJW2.js.map +0 -1
  549. package/dist/chunk-UY3UYPBZ.cjs +0 -77
  550. package/dist/chunk-UY3UYPBZ.cjs.map +0 -1
  551. package/dist/chunk-VG2ABKJX.cjs +0 -100
  552. package/dist/chunk-VG2ABKJX.cjs.map +0 -1
  553. package/dist/chunk-VH77IPJN.cjs +0 -358
  554. package/dist/chunk-VH77IPJN.cjs.map +0 -1
  555. package/dist/chunk-VQTCQKHQ.cjs +0 -17
  556. package/dist/chunk-VQTCQKHQ.cjs.map +0 -1
  557. package/dist/chunk-WGWSHJ2N.js +0 -38
  558. package/dist/chunk-WGWSHJ2N.js.map +0 -1
  559. package/dist/chunk-WJH6IYU2.cjs +0 -32
  560. package/dist/chunk-WJH6IYU2.cjs.map +0 -1
  561. package/dist/chunk-YREV3LGG.cjs +0 -61
  562. package/dist/chunk-YREV3LGG.cjs.map +0 -1
  563. package/dist/chunk-YTXEZ4SD.cjs +0 -77
  564. package/dist/chunk-YTXEZ4SD.cjs.map +0 -1
  565. package/dist/chunk-YWCESU4Y.js +0 -1233
  566. package/dist/chunk-YWCESU4Y.js.map +0 -1
  567. package/dist/chunk-Z6HRSM2Y.cjs +0 -799
  568. package/dist/chunk-Z6HRSM2Y.cjs.map +0 -1
  569. package/dist/chunk-Z7PW3KHL.cjs +0 -1198
  570. package/dist/chunk-Z7PW3KHL.cjs.map +0 -1
  571. package/dist/chunk-ZNMBW67B.cjs +0 -40
  572. package/dist/chunk-ZNMBW67B.cjs.map +0 -1
  573. package/dist/correlation-id.cjs.map +0 -1
  574. package/dist/correlation-id.js.map +0 -1
  575. package/dist/event-subscriber.cjs.map +0 -1
  576. package/dist/event-subscriber.js.map +0 -1
  577. package/dist/event.cjs.map +0 -1
  578. package/dist/event.js.map +0 -1
  579. package/dist/exporters.cjs.map +0 -1
  580. package/dist/exporters.js.map +0 -1
  581. package/dist/functional.cjs.map +0 -1
  582. package/dist/functional.js.map +0 -1
  583. package/dist/init-DIowiiCh.d.ts +0 -1167
  584. package/dist/init-j-A1zI16.d.cts +0 -1167
  585. package/dist/processors.cjs.map +0 -1
  586. package/dist/processors.js.map +0 -1
  587. package/dist/trace-context-DbGKd1Rn.d.cts +0 -213
  588. package/dist/trace-context-DbGKd1Rn.d.ts +0 -213
  589. package/dist/utils-BahBCFtJ.d.cts +0 -712
  590. package/dist/utils-CLKwaUlG.d.ts +0 -712
  591. package/dist/yaml-config.cjs.map +0 -1
@@ -1,799 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
4
- var chunkFGNDN2FD_cjs = require('./chunk-FGNDN2FD.cjs');
5
- var chunkVH77IPJN_cjs = require('./chunk-VH77IPJN.cjs');
6
- var api = require('@opentelemetry/api');
7
-
8
- function traceProducer(config) {
9
- const spanName = `${config.system}.publish ${config.destination}`;
10
- return (fnFactory) => {
11
- return chunkFGNDN2FD_cjs.trace(
12
- { name: spanName, spanKind: api.SpanKind.PRODUCER },
13
- (baseCtx) => {
14
- const ctx = extendContextForProducer(baseCtx, config);
15
- setProducerAttributes(ctx, config);
16
- return (...args) => {
17
- setDynamicProducerAttributes(ctx, config, args);
18
- if (config.customAttributes) {
19
- const customAttrs = config.customAttributes(ctx, args);
20
- for (const [key, value] of Object.entries(customAttrs)) {
21
- if (value !== void 0 && value !== null) {
22
- ctx.setAttribute(key, value);
23
- }
24
- }
25
- }
26
- if (config.beforeSend) {
27
- config.beforeSend(ctx, args);
28
- }
29
- const userFn = fnFactory(ctx);
30
- return userFn(...args).catch((error) => {
31
- if (config.onError) {
32
- config.onError(error, ctx);
33
- }
34
- throw error;
35
- });
36
- };
37
- }
38
- );
39
- };
40
- }
41
- function traceConsumer(config) {
42
- const operation = config.batchMode ? "receive" : "process";
43
- const spanName = `${config.system}.${operation} ${config.destination}`;
44
- return (fnFactory) => {
45
- return chunkFGNDN2FD_cjs.trace(
46
- { name: spanName, spanKind: api.SpanKind.CONSUMER },
47
- (baseCtx) => {
48
- const linkStorage = { links: [] };
49
- const orderingState = {
50
- sequenceNumber: null,
51
- partitionKey: null,
52
- messageId: null,
53
- isDuplicate: false,
54
- outOfOrderInfo: null
55
- };
56
- const groupTracking = config.consumerGroupTracking;
57
- const groupState = {
58
- memberId: typeof groupTracking?.memberId === "function" ? groupTracking.memberId() ?? null : groupTracking?.memberId ?? null,
59
- groupInstanceId: typeof groupTracking?.groupInstanceId === "function" ? groupTracking.groupInstanceId() ?? null : groupTracking?.groupInstanceId ?? null,
60
- assignedPartitions: [],
61
- generation: null,
62
- isActive: true,
63
- lastHeartbeat: null,
64
- state: null
65
- };
66
- const ctx = extendContextForConsumer(
67
- baseCtx,
68
- config,
69
- linkStorage,
70
- orderingState,
71
- groupState
72
- );
73
- setConsumerAttributes(ctx, config);
74
- return async (...args) => {
75
- await extractAndAddLinks(ctx, config, args, linkStorage);
76
- if (config.ordering) {
77
- extractAndProcessOrdering(ctx, config, args, orderingState);
78
- }
79
- if (config.lagMetrics) {
80
- await extractLagMetrics(ctx, config.lagMetrics, args);
81
- }
82
- if (config.customAttributes) {
83
- const batch = args[0];
84
- const msg = config.batchMode && Array.isArray(batch) && batch.length > 0 ? batch[0] : batch;
85
- if (msg !== void 0) {
86
- const customAttrs = config.customAttributes(ctx, msg);
87
- for (const [key, value] of Object.entries(customAttrs)) {
88
- if (value !== void 0 && value !== null) {
89
- ctx.setAttribute(key, value);
90
- }
91
- }
92
- }
93
- }
94
- const userFn = fnFactory(ctx);
95
- return userFn(...args).catch((error) => {
96
- if (config.onError) {
97
- config.onError(error, ctx);
98
- }
99
- throw error;
100
- });
101
- };
102
- }
103
- );
104
- };
105
- }
106
- function extendContextForProducer(baseCtx, config) {
107
- const producerCtx = {
108
- ...baseCtx,
109
- getTraceHeaders() {
110
- const headers = {};
111
- api.propagation.inject(api.context.active(), headers);
112
- const result = {
113
- traceparent: headers["traceparent"] || ""
114
- };
115
- if (headers["tracestate"]) {
116
- result.tracestate = headers["tracestate"];
117
- }
118
- return result;
119
- },
120
- getAllPropagationHeaders() {
121
- const headers = {};
122
- api.propagation.inject(api.context.active(), headers);
123
- if (config.propagateBaggage) {
124
- const baggage = api.propagation.getBaggage(api.context.active());
125
- if (baggage) {
126
- const entries = [];
127
- for (const [key, value] of baggage.getAllEntries()) {
128
- entries.push(
129
- `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`
130
- );
131
- }
132
- if (entries.length > 0) {
133
- headers["baggage"] = entries.join(",");
134
- }
135
- }
136
- }
137
- return headers;
138
- },
139
- getFullHeaders() {
140
- const headers = producerCtx.getAllPropagationHeaders();
141
- if (config.customHeaders) {
142
- const customHeaders = config.customHeaders(producerCtx);
143
- Object.assign(headers, customHeaders);
144
- }
145
- return headers;
146
- }
147
- };
148
- return producerCtx;
149
- }
150
- var sequenceTrackers = /* @__PURE__ */ new Map();
151
- var deduplicationWindow = /* @__PURE__ */ new Map();
152
- var DEFAULT_DEDUP_WINDOW_SIZE = 1e3;
153
- function trimDeduplicationWindow(maxSize) {
154
- if (deduplicationWindow.size > maxSize) {
155
- const excess = deduplicationWindow.size - maxSize;
156
- const iterator = deduplicationWindow.keys();
157
- for (let i = 0; i < excess; i++) {
158
- const key = iterator.next().value;
159
- if (key) deduplicationWindow.delete(key);
160
- }
161
- }
162
- }
163
- function extendContextForConsumer(baseCtx, config, linkStorage, orderingState, groupState) {
164
- const consumerCtx = {
165
- ...baseCtx,
166
- recordDLQ(reason, dlqNameOrOptions, optionsParam) {
167
- let dlqName;
168
- let options;
169
- if (typeof dlqNameOrOptions === "string") {
170
- dlqName = dlqNameOrOptions;
171
- options = optionsParam;
172
- } else if (typeof dlqNameOrOptions === "object") {
173
- options = dlqNameOrOptions;
174
- }
175
- const linkToProducer = options?.linkToProducer ?? true;
176
- baseCtx.setAttribute("messaging.dlq.reason", reason);
177
- if (dlqName) {
178
- baseCtx.setAttribute("messaging.dlq.name", dlqName);
179
- }
180
- if (options?.reasonCategory) {
181
- baseCtx.setAttribute(
182
- "messaging.dlq.reason_category",
183
- options.reasonCategory
184
- );
185
- }
186
- if (options?.attemptCount !== void 0) {
187
- baseCtx.setAttribute(
188
- "messaging.dlq.attempt_count",
189
- options.attemptCount
190
- );
191
- }
192
- if (options?.originalError) {
193
- baseCtx.setAttribute(
194
- "messaging.dlq.error.type",
195
- options.originalError.name
196
- );
197
- baseCtx.setAttribute(
198
- "messaging.dlq.error.message",
199
- options.originalError.message
200
- );
201
- }
202
- if (options?.metadata) {
203
- for (const [key, value] of Object.entries(options.metadata)) {
204
- baseCtx.setAttribute(`messaging.dlq.metadata.${key}`, value);
205
- }
206
- }
207
- const producerLink = linkStorage.links[0];
208
- if (linkToProducer && producerLink) {
209
- baseCtx.setAttribute(
210
- "messaging.dlq.producer_trace_id",
211
- producerLink.context.traceId
212
- );
213
- baseCtx.setAttribute(
214
- "messaging.dlq.producer_span_id",
215
- producerLink.context.spanId
216
- );
217
- }
218
- const eventAttrs = {
219
- "messaging.dlq.reason": reason,
220
- ...dlqName && { "messaging.dlq.name": dlqName },
221
- ...options?.reasonCategory && {
222
- "messaging.dlq.reason_category": options.reasonCategory
223
- },
224
- ...options?.attemptCount !== void 0 && {
225
- "messaging.dlq.attempt_count": options.attemptCount
226
- },
227
- ...options?.originalError && {
228
- "messaging.dlq.error.type": options.originalError.name,
229
- "messaging.dlq.error.message": options.originalError.message
230
- }
231
- };
232
- if (linkToProducer && producerLink) {
233
- eventAttrs["messaging.dlq.producer_trace_id"] = producerLink.context.traceId;
234
- eventAttrs["messaging.dlq.producer_span_id"] = producerLink.context.spanId;
235
- }
236
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, "dlq_routed", eventAttrs);
237
- if (config.onDLQ) {
238
- config.onDLQ(consumerCtx, reason);
239
- }
240
- },
241
- recordReplay(options) {
242
- baseCtx.setAttribute("messaging.replay", true);
243
- if (options?.replayAttempt !== void 0) {
244
- baseCtx.setAttribute("messaging.replay.attempt", options.replayAttempt);
245
- }
246
- if (options?.dlqDwellTimeMs !== void 0) {
247
- baseCtx.setAttribute(
248
- "messaging.replay.dwell_time_ms",
249
- options.dlqDwellTimeMs
250
- );
251
- }
252
- if (options?.originalDLQSpanContext) {
253
- baseCtx.addLinks([
254
- {
255
- context: options.originalDLQSpanContext,
256
- attributes: { "messaging.link.source": "dlq_replay" }
257
- }
258
- ]);
259
- }
260
- const eventAttrs = {
261
- "messaging.replay": true,
262
- ...options?.replayAttempt !== void 0 && {
263
- "messaging.replay.attempt": options.replayAttempt
264
- },
265
- ...options?.dlqDwellTimeMs !== void 0 && {
266
- "messaging.replay.dwell_time_ms": options.dlqDwellTimeMs
267
- }
268
- };
269
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, "dlq_replay", eventAttrs);
270
- },
271
- recordRetry(attemptNumber, maxAttempts) {
272
- baseCtx.setAttribute("messaging.retry.count", attemptNumber);
273
- if (maxAttempts !== void 0) {
274
- baseCtx.setAttribute("messaging.retry.max_attempts", maxAttempts);
275
- }
276
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, "retry_attempt", {
277
- "messaging.retry.count": attemptNumber,
278
- ...maxAttempts !== void 0 && {
279
- "messaging.retry.max_attempts": maxAttempts
280
- }
281
- });
282
- },
283
- getProducerLinks() {
284
- return [...linkStorage.links];
285
- },
286
- // ---- Ordering Methods ----
287
- isDuplicate() {
288
- return orderingState.isDuplicate;
289
- },
290
- getOutOfOrderInfo() {
291
- return orderingState.outOfOrderInfo;
292
- },
293
- getSequenceNumber() {
294
- return orderingState.sequenceNumber;
295
- },
296
- getPartitionKey() {
297
- return orderingState.partitionKey;
298
- },
299
- // ---- Consumer Group Methods ----
300
- recordRebalance(event) {
301
- if (event.type === "assigned") {
302
- groupState.assignedPartitions = event.partitions;
303
- groupState.isActive = true;
304
- groupState.state = "stable";
305
- } else if (event.type === "revoked" || event.type === "lost") {
306
- const revokedSet = new Set(
307
- event.partitions.map((p) => `${p.topic}:${p.partition}`)
308
- );
309
- groupState.assignedPartitions = groupState.assignedPartitions.filter(
310
- (p) => !revokedSet.has(`${p.topic}:${p.partition}`)
311
- );
312
- if (event.type === "lost") {
313
- groupState.isActive = false;
314
- groupState.state = "dead";
315
- } else {
316
- groupState.state = groupState.assignedPartitions.length === 0 ? "empty" : "preparing_rebalance";
317
- }
318
- }
319
- if (event.generation !== void 0) {
320
- groupState.generation = event.generation;
321
- }
322
- if (event.memberId) {
323
- groupState.memberId = event.memberId;
324
- }
325
- baseCtx.setAttribute(
326
- "messaging.consumer_group.rebalance.type",
327
- event.type
328
- );
329
- baseCtx.setAttribute(
330
- "messaging.consumer_group.rebalance.partition_count",
331
- event.partitions.length
332
- );
333
- if (event.generation !== void 0) {
334
- baseCtx.setAttribute(
335
- "messaging.consumer_group.generation",
336
- event.generation
337
- );
338
- }
339
- if (event.memberId) {
340
- baseCtx.setAttribute(
341
- "messaging.consumer_group.member_id",
342
- event.memberId
343
- );
344
- }
345
- if (event.reason) {
346
- baseCtx.setAttribute(
347
- "messaging.consumer_group.rebalance.reason",
348
- event.reason
349
- );
350
- }
351
- if (groupState.state) {
352
- baseCtx.setAttribute(
353
- "messaging.consumer_group.state",
354
- groupState.state
355
- );
356
- }
357
- const eventAttrs = {
358
- "messaging.consumer_group.rebalance.type": event.type,
359
- "messaging.consumer_group.rebalance.partition_count": event.partitions.length,
360
- "messaging.consumer_group.rebalance.timestamp": event.timestamp,
361
- ...event.generation !== void 0 && {
362
- "messaging.consumer_group.generation": event.generation
363
- },
364
- ...event.memberId && {
365
- "messaging.consumer_group.member_id": event.memberId
366
- },
367
- ...event.reason && {
368
- "messaging.consumer_group.rebalance.reason": event.reason
369
- },
370
- ...groupState.state && {
371
- "messaging.consumer_group.state": groupState.state
372
- }
373
- };
374
- if (event.partitions.length <= 10) {
375
- eventAttrs["messaging.consumer_group.rebalance.partitions"] = event.partitions.map((p) => `${p.topic}:${p.partition}`).join(",");
376
- }
377
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, `consumer_group_${event.type}`, eventAttrs);
378
- if (config.consumerGroupTracking?.onRebalance) {
379
- config.consumerGroupTracking.onRebalance(consumerCtx, event);
380
- }
381
- if (event.type === "assigned" && config.consumerGroupTracking?.onPartitionsAssigned) {
382
- config.consumerGroupTracking.onPartitionsAssigned(
383
- consumerCtx,
384
- event.partitions
385
- );
386
- }
387
- if (event.type === "revoked" && config.consumerGroupTracking?.onPartitionsRevoked) {
388
- config.consumerGroupTracking.onPartitionsRevoked(
389
- consumerCtx,
390
- event.partitions
391
- );
392
- }
393
- },
394
- recordHeartbeat(healthy, latencyMs) {
395
- groupState.lastHeartbeat = Date.now();
396
- baseCtx.setAttribute(
397
- "messaging.consumer_group.heartbeat.healthy",
398
- healthy
399
- );
400
- if (latencyMs !== void 0) {
401
- baseCtx.setAttribute(
402
- "messaging.consumer_group.heartbeat.latency_ms",
403
- latencyMs
404
- );
405
- }
406
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, "consumer_group_heartbeat", {
407
- "messaging.consumer_group.heartbeat.healthy": healthy,
408
- "messaging.consumer_group.heartbeat.timestamp": groupState.lastHeartbeat,
409
- ...latencyMs !== void 0 && {
410
- "messaging.consumer_group.heartbeat.latency_ms": latencyMs
411
- }
412
- });
413
- },
414
- recordPartitionLag(lag) {
415
- const prefix = `messaging.consumer_group.lag.${lag.topic}.${lag.partition}`;
416
- baseCtx.setAttribute(`${prefix}.current_offset`, lag.currentOffset);
417
- baseCtx.setAttribute(`${prefix}.end_offset`, lag.endOffset);
418
- baseCtx.setAttribute(`${prefix}.lag`, lag.lag);
419
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(baseCtx, "partition_lag_recorded", {
420
- "messaging.consumer_group.lag.topic": lag.topic,
421
- "messaging.consumer_group.lag.partition": lag.partition,
422
- "messaging.consumer_group.lag.current_offset": lag.currentOffset,
423
- "messaging.consumer_group.lag.end_offset": lag.endOffset,
424
- "messaging.consumer_group.lag.lag": lag.lag,
425
- "messaging.consumer_group.lag.timestamp": lag.timestamp
426
- });
427
- },
428
- getConsumerGroupState() {
429
- if (!config.consumerGroup) {
430
- return null;
431
- }
432
- return {
433
- groupId: config.consumerGroup,
434
- memberId: groupState.memberId ?? void 0,
435
- groupInstanceId: groupState.groupInstanceId ?? void 0,
436
- assignedPartitions: [...groupState.assignedPartitions],
437
- generation: groupState.generation ?? void 0,
438
- isActive: groupState.isActive,
439
- lastHeartbeat: groupState.lastHeartbeat ?? void 0,
440
- state: groupState.state ?? void 0
441
- };
442
- },
443
- getMemberId() {
444
- return groupState.memberId;
445
- },
446
- getAssignedPartitions() {
447
- return [...groupState.assignedPartitions];
448
- }
449
- };
450
- return consumerCtx;
451
- }
452
- function setProducerAttributes(ctx, config) {
453
- ctx.setAttribute("messaging.system", config.system);
454
- ctx.setAttribute("messaging.operation", "publish");
455
- ctx.setAttribute("messaging.destination.name", config.destination);
456
- if (config.system === "kafka") {
457
- ctx.setAttribute("messaging.kafka.destination.topic", config.destination);
458
- }
459
- if (config.attributes) {
460
- setCustomAttributes(ctx, config.attributes);
461
- }
462
- }
463
- function setDynamicProducerAttributes(ctx, config, args) {
464
- if (config.messageIdFrom) {
465
- const messageId = extractValue(config.messageIdFrom, args);
466
- if (messageId !== void 0) {
467
- ctx.setAttribute("messaging.message.id", String(messageId));
468
- }
469
- }
470
- if (config.partitionFrom) {
471
- const partition = extractValue(config.partitionFrom, args);
472
- if (partition !== void 0) {
473
- ctx.setAttribute(
474
- "messaging.kafka.destination.partition",
475
- Number(partition)
476
- );
477
- }
478
- }
479
- if (config.keyFrom) {
480
- const key = extractValue(config.keyFrom, args);
481
- if (key !== void 0) {
482
- ctx.setAttribute("messaging.kafka.message.key", String(key));
483
- }
484
- }
485
- }
486
- function setConsumerAttributes(ctx, config) {
487
- ctx.setAttribute("messaging.system", config.system);
488
- ctx.setAttribute(
489
- "messaging.operation",
490
- config.batchMode ? "receive" : "process"
491
- );
492
- ctx.setAttribute("messaging.destination.name", config.destination);
493
- if (config.consumerGroup) {
494
- ctx.setAttribute("messaging.consumer.group", config.consumerGroup);
495
- if (config.system === "kafka") {
496
- ctx.setAttribute("messaging.kafka.consumer.group", config.consumerGroup);
497
- }
498
- }
499
- if (config.system === "kafka") {
500
- ctx.setAttribute("messaging.kafka.destination.topic", config.destination);
501
- }
502
- if (config.attributes) {
503
- setCustomAttributes(ctx, config.attributes);
504
- }
505
- }
506
- async function extractAndAddLinks(ctx, config, args, linkStorage) {
507
- if (!config.headersFrom && !config.customContextExtractor) {
508
- return;
509
- }
510
- const links = [];
511
- if (config.batchMode && Array.isArray(args[0])) {
512
- const messages = args[0];
513
- if (config.headersFrom) {
514
- const batchLinks = chunkVH77IPJN_cjs.extractLinksFromBatch(
515
- messages.map((msg) => {
516
- const headers = extractHeaders(config.headersFrom, msg);
517
- return { headers };
518
- }),
519
- "headers"
520
- );
521
- links.push(...batchLinks);
522
- }
523
- if (config.customContextExtractor && config.headersFrom) {
524
- for (const msg of messages) {
525
- const headers = extractHeaders(config.headersFrom, msg);
526
- if (headers) {
527
- const w3cLink = chunkVH77IPJN_cjs.createLinkFromHeaders(headers);
528
- if (!w3cLink) {
529
- const customContext = config.customContextExtractor(headers);
530
- if (customContext) {
531
- links.push({
532
- context: customContext,
533
- attributes: { "messaging.link.source": "custom_extractor" }
534
- });
535
- }
536
- }
537
- }
538
- }
539
- }
540
- ctx.setAttribute("messaging.batch.message_count", messages.length);
541
- } else {
542
- const msg = args[0];
543
- const headers = config.headersFrom ? extractHeaders(config.headersFrom, msg) : void 0;
544
- if (headers) {
545
- const w3cLink = chunkVH77IPJN_cjs.createLinkFromHeaders(headers);
546
- if (w3cLink) {
547
- links.push(w3cLink);
548
- } else if (config.customContextExtractor) {
549
- const customContext = config.customContextExtractor(headers);
550
- if (customContext) {
551
- links.push({
552
- context: customContext,
553
- attributes: { "messaging.link.source": "custom_extractor" }
554
- });
555
- }
556
- }
557
- }
558
- }
559
- if (links.length > 0) {
560
- ctx.addLinks(links);
561
- linkStorage.links.push(...links);
562
- }
563
- }
564
- async function extractLagMetrics(ctx, lagConfig, args) {
565
- const msg = Array.isArray(args[0]) ? args[0][0] : args[0];
566
- let currentOffset;
567
- if (lagConfig.getCurrentOffset && msg) {
568
- currentOffset = lagConfig.getCurrentOffset(msg);
569
- if (currentOffset !== void 0) {
570
- ctx.setAttribute("messaging.kafka.message.offset", currentOffset);
571
- }
572
- }
573
- if (lagConfig.getPartition && msg) {
574
- const partition = lagConfig.getPartition(msg);
575
- if (partition !== void 0) {
576
- ctx.setAttribute("messaging.kafka.partition", partition);
577
- }
578
- }
579
- if (lagConfig.getEndOffset) {
580
- try {
581
- const endOffset = await Promise.resolve(lagConfig.getEndOffset());
582
- if (endOffset !== void 0 && currentOffset !== void 0) {
583
- const lag = endOffset - currentOffset;
584
- ctx.setAttribute("messaging.kafka.consumer_lag", lag);
585
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(ctx, "consumer_lag_measured", {
586
- "messaging.kafka.consumer_lag": lag,
587
- "messaging.kafka.message.offset": currentOffset,
588
- "messaging.kafka.high_watermark": endOffset
589
- });
590
- }
591
- } catch {
592
- }
593
- }
594
- if (lagConfig.getCommittedOffset) {
595
- try {
596
- const committedOffset = await Promise.resolve(
597
- lagConfig.getCommittedOffset()
598
- );
599
- if (committedOffset !== void 0) {
600
- ctx.setAttribute("messaging.kafka.committed_offset", committedOffset);
601
- }
602
- } catch {
603
- }
604
- }
605
- if (Array.isArray(args[0]) && args[0].length > 0) {
606
- const messages = args[0];
607
- if (lagConfig.getCurrentOffset) {
608
- const firstOffset = lagConfig.getCurrentOffset(messages[0]);
609
- const lastMessage = messages.at(-1);
610
- const lastOffset = lastMessage === void 0 ? void 0 : lagConfig.getCurrentOffset(lastMessage);
611
- if (firstOffset !== void 0) {
612
- ctx.setAttribute("messaging.batch.first_offset", firstOffset);
613
- }
614
- if (lastOffset !== void 0) {
615
- ctx.setAttribute("messaging.batch.last_offset", lastOffset);
616
- }
617
- }
618
- }
619
- }
620
- function extractHeaders(headersFrom, msg) {
621
- if (typeof headersFrom === "function") {
622
- return headersFrom(msg);
623
- }
624
- if (typeof msg === "object" && msg !== null) {
625
- const value = msg[headersFrom];
626
- if (typeof value === "object" && value !== null) {
627
- return value;
628
- }
629
- }
630
- return void 0;
631
- }
632
- function extractValue(extractor, args) {
633
- if (typeof extractor === "function") {
634
- return extractor(args);
635
- }
636
- const firstArg = args[0];
637
- if (typeof firstArg === "object" && firstArg !== null) {
638
- return firstArg[extractor];
639
- }
640
- return void 0;
641
- }
642
- function setCustomAttributes(ctx, attributes) {
643
- for (const [key, value] of Object.entries(attributes)) {
644
- if (value !== void 0 && value !== null) {
645
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
646
- ctx.setAttribute(key, value);
647
- } else if (Array.isArray(value)) {
648
- const cleanArray = value.filter(
649
- (v) => v !== null && v !== void 0 && (typeof v === "string" || typeof v === "number" || typeof v === "boolean")
650
- );
651
- if (cleanArray.length > 0) {
652
- ctx.setAttribute(key, cleanArray);
653
- }
654
- } else {
655
- ctx.setAttribute(key, JSON.stringify(value));
656
- }
657
- }
658
- }
659
- }
660
- function extractAndProcessOrdering(ctx, config, args, orderingState) {
661
- const ordering = config.ordering;
662
- if (!ordering) return;
663
- const messages = config.batchMode && Array.isArray(args[0]) ? args[0] : [args[0]];
664
- if (messages.length === 0) return;
665
- let outOfOrderCount = 0;
666
- let duplicateCount = 0;
667
- let lastSequence = null;
668
- let lastPartitionKey = null;
669
- let lastMessageId = null;
670
- for (const [i, msg] of messages.entries()) {
671
- if (!msg) continue;
672
- let msgSequence = null;
673
- let msgPartitionKey = null;
674
- let msgId = null;
675
- if (ordering.sequenceFrom) {
676
- const seq = ordering.sequenceFrom(msg);
677
- if (seq !== void 0) {
678
- msgSequence = seq;
679
- lastSequence = seq;
680
- }
681
- }
682
- if (ordering.partitionKeyFrom) {
683
- const key = ordering.partitionKeyFrom(msg);
684
- if (key !== void 0) {
685
- msgPartitionKey = key;
686
- lastPartitionKey = key;
687
- }
688
- }
689
- if (ordering.messageIdFrom) {
690
- const id = ordering.messageIdFrom(msg);
691
- if (id !== void 0) {
692
- msgId = id;
693
- lastMessageId = id;
694
- }
695
- }
696
- if (ordering.detectOutOfOrder && msgSequence !== null) {
697
- const msgOrderingState = {
698
- partitionKey: msgPartitionKey};
699
- const trackerKey = buildTrackerKey(config, msgOrderingState);
700
- const prevSequence = sequenceTrackers.get(trackerKey);
701
- if (prevSequence !== void 0) {
702
- const expectedSequence = prevSequence + 1;
703
- if (msgSequence !== expectedSequence) {
704
- outOfOrderCount++;
705
- const gap = msgSequence - expectedSequence;
706
- const outOfOrderInfo = {
707
- currentSequence: msgSequence,
708
- expectedSequence,
709
- partitionKey: msgPartitionKey ?? void 0,
710
- gap
711
- };
712
- if (!orderingState.outOfOrderInfo) {
713
- orderingState.outOfOrderInfo = outOfOrderInfo;
714
- }
715
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(ctx, "message_out_of_order", {
716
- "messaging.ordering.batch_index": i,
717
- "messaging.ordering.current_sequence": msgSequence,
718
- "messaging.ordering.expected_sequence": expectedSequence,
719
- "messaging.ordering.gap": gap,
720
- ...msgPartitionKey && {
721
- "messaging.ordering.partition_key": msgPartitionKey
722
- }
723
- });
724
- if (ordering.onOutOfOrder) {
725
- ordering.onOutOfOrder(ctx, outOfOrderInfo);
726
- }
727
- }
728
- }
729
- sequenceTrackers.set(trackerKey, msgSequence);
730
- }
731
- if (ordering.detectDuplicates && msgId !== null) {
732
- const msgOrderingState = {
733
- messageId: msgId};
734
- const dedupKey = buildDedupKey(config, msgOrderingState);
735
- if (deduplicationWindow.has(dedupKey)) {
736
- duplicateCount++;
737
- chunk4P6ZOARG_cjs.emitCorrelatedEvent(ctx, "message_duplicate", {
738
- "messaging.ordering.batch_index": i,
739
- "messaging.message.id": msgId
740
- });
741
- if (ordering.onDuplicate) {
742
- ordering.onDuplicate(ctx, msgId);
743
- }
744
- } else {
745
- deduplicationWindow.set(dedupKey, Date.now());
746
- const windowSize = ordering.deduplicationWindowSize ?? DEFAULT_DEDUP_WINDOW_SIZE;
747
- trimDeduplicationWindow(windowSize);
748
- }
749
- }
750
- }
751
- orderingState.sequenceNumber = lastSequence;
752
- orderingState.partitionKey = lastPartitionKey;
753
- orderingState.messageId = lastMessageId;
754
- orderingState.isDuplicate = duplicateCount > 0;
755
- if (lastSequence !== null) {
756
- ctx.setAttribute("messaging.message.sequence_number", lastSequence);
757
- }
758
- if (lastPartitionKey !== null) {
759
- ctx.setAttribute("messaging.message.partition_key", lastPartitionKey);
760
- }
761
- if (lastMessageId !== null) {
762
- ctx.setAttribute("messaging.message.id", lastMessageId);
763
- }
764
- if (outOfOrderCount > 0) {
765
- ctx.setAttribute("messaging.ordering.out_of_order", true);
766
- ctx.setAttribute("messaging.ordering.out_of_order_count", outOfOrderCount);
767
- }
768
- if (duplicateCount > 0) {
769
- ctx.setAttribute("messaging.ordering.duplicate", true);
770
- ctx.setAttribute("messaging.ordering.duplicate_count", duplicateCount);
771
- }
772
- }
773
- function buildTrackerKey(config, orderingState) {
774
- const parts = [config.system, config.destination];
775
- if (orderingState.partitionKey) {
776
- parts.push(orderingState.partitionKey);
777
- }
778
- if (config.consumerGroup) {
779
- parts.push(config.consumerGroup);
780
- }
781
- return parts.join(":");
782
- }
783
- function buildDedupKey(config, orderingState) {
784
- const parts = [config.system, config.destination];
785
- if (orderingState.messageId) {
786
- parts.push(orderingState.messageId);
787
- }
788
- return parts.join(":");
789
- }
790
- function clearOrderingState() {
791
- sequenceTrackers.clear();
792
- deduplicationWindow.clear();
793
- }
794
-
795
- exports.clearOrderingState = clearOrderingState;
796
- exports.traceConsumer = traceConsumer;
797
- exports.traceProducer = traceProducer;
798
- //# sourceMappingURL=chunk-Z6HRSM2Y.cjs.map
799
- //# sourceMappingURL=chunk-Z6HRSM2Y.cjs.map