autotel 4.3.0 → 6.0.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 (384) hide show
  1. package/README.md +125 -103
  2. package/dist/analysis.cjs +87 -0
  3. package/dist/analysis.cjs.map +1 -0
  4. package/dist/analysis.d.cts +87 -0
  5. package/dist/analysis.d.cts.map +1 -0
  6. package/dist/analysis.d.ts +87 -0
  7. package/dist/analysis.d.ts.map +1 -0
  8. package/dist/analysis.js +85 -0
  9. package/dist/analysis.js.map +1 -0
  10. package/dist/{attribute-redacting-processor-DtTS9xxh.d.ts → attribute-redacting-processor-Pk7lAzWd.d.cts} +13 -8
  11. package/dist/attribute-redacting-processor-Pk7lAzWd.d.cts.map +1 -0
  12. package/dist/{attribute-redacting-processor-DtTS9xxh.d.cts → attribute-redacting-processor-Pk7lAzWd.d.ts} +13 -8
  13. package/dist/attribute-redacting-processor-Pk7lAzWd.d.ts.map +1 -0
  14. package/dist/attribute-redacting-processor.cjs +4 -4
  15. package/dist/attribute-redacting-processor.cjs.map +1 -1
  16. package/dist/attribute-redacting-processor.d.cts +1 -1
  17. package/dist/attribute-redacting-processor.d.ts +1 -1
  18. package/dist/attribute-redacting-processor.js +4 -4
  19. package/dist/attribute-redacting-processor.js.map +1 -1
  20. package/dist/attributes.d.cts +1 -1
  21. package/dist/attributes.d.ts +1 -1
  22. package/dist/auto.cjs +1 -1
  23. package/dist/auto.cjs.map +1 -1
  24. package/dist/auto.d.cts +1 -1
  25. package/dist/auto.d.ts +1 -1
  26. package/dist/auto.js +1 -1
  27. package/dist/auto.js.map +1 -1
  28. package/dist/business-baggage.d.cts +2 -3
  29. package/dist/business-baggage.d.cts.map +1 -1
  30. package/dist/business-baggage.d.ts +2 -3
  31. package/dist/business-baggage.d.ts.map +1 -1
  32. package/dist/{canonical-log-line-processor-xvjMgtpF.d.cts → canonical-log-line-processor-B4WgG-VS.d.cts} +2 -3
  33. package/dist/canonical-log-line-processor-B4WgG-VS.d.cts.map +1 -0
  34. package/dist/{canonical-log-line-processor-BcRuAdRk.d.ts → canonical-log-line-processor-CL_J7gb5.d.ts} +2 -3
  35. package/dist/canonical-log-line-processor-CL_J7gb5.d.ts.map +1 -0
  36. package/dist/{canonical-log-line-processor-CcrDi6TO.cjs → canonical-log-line-processor-DOjb6Kxy.cjs} +5 -5
  37. package/dist/canonical-log-line-processor-DOjb6Kxy.cjs.map +1 -0
  38. package/dist/{canonical-log-line-processor-FLezvFCB.js → canonical-log-line-processor-mKABvGP0.js} +5 -5
  39. package/dist/canonical-log-line-processor-mKABvGP0.js.map +1 -0
  40. package/dist/config.d.cts +12 -7
  41. package/dist/config.d.cts.map +1 -1
  42. package/dist/config.d.ts +12 -7
  43. package/dist/config.d.ts.map +1 -1
  44. package/dist/correlation-id.cjs +9 -9
  45. package/dist/correlation-id.d.cts +0 -1
  46. package/dist/correlation-id.d.cts.map +1 -1
  47. package/dist/correlation-id.d.ts +0 -1
  48. package/dist/correlation-id.d.ts.map +1 -1
  49. package/dist/correlation-id.js +1 -1
  50. package/dist/db.d.cts.map +1 -1
  51. package/dist/db.d.ts.map +1 -1
  52. package/dist/decorators.cjs +2 -2
  53. package/dist/decorators.cjs.map +1 -1
  54. package/dist/decorators.d.cts +1 -2
  55. package/dist/decorators.d.cts.map +1 -1
  56. package/dist/decorators.d.ts +1 -2
  57. package/dist/decorators.d.ts.map +1 -1
  58. package/dist/decorators.js +1 -1
  59. package/dist/decorators.js.map +1 -1
  60. package/dist/{define-event-CreknLm3.d.ts → define-event-B2z1SBe7.d.ts} +2 -3
  61. package/dist/define-event-B2z1SBe7.d.ts.map +1 -0
  62. package/dist/{define-event-HZRizPwz.d.cts → define-event-CGG048HE.d.cts} +2 -3
  63. package/dist/define-event-CGG048HE.d.cts.map +1 -0
  64. package/dist/diagnostics.cjs +10 -1
  65. package/dist/diagnostics.cjs.map +1 -1
  66. package/dist/diagnostics.d.cts +0 -1
  67. package/dist/diagnostics.d.cts.map +1 -1
  68. package/dist/diagnostics.d.ts +0 -1
  69. package/dist/diagnostics.d.ts.map +1 -1
  70. package/dist/diagnostics.js +10 -1
  71. package/dist/diagnostics.js.map +1 -1
  72. package/dist/drain-pipeline.d.cts +12 -5
  73. package/dist/drain-pipeline.d.cts.map +1 -1
  74. package/dist/drain-pipeline.d.ts +12 -5
  75. package/dist/drain-pipeline.d.ts.map +1 -1
  76. package/dist/enrichers.d.cts.map +1 -1
  77. package/dist/enrichers.d.ts.map +1 -1
  78. package/dist/{event-subscriber-D1XLkPzi.d.ts → event-subscriber-CWh8sTGh.d.cts} +2 -2
  79. package/dist/event-subscriber-CWh8sTGh.d.cts.map +1 -0
  80. package/dist/{event-subscriber-D1XLkPzi.d.cts → event-subscriber-CWh8sTGh.d.ts} +2 -2
  81. package/dist/event-subscriber-CWh8sTGh.d.ts.map +1 -0
  82. package/dist/event-subscriber.d.cts +1 -1
  83. package/dist/event-subscriber.d.ts +1 -1
  84. package/dist/{event-testing-CfFs3to2.d.ts → event-testing-CA2mIx1E.d.ts} +2 -3
  85. package/dist/event-testing-CA2mIx1E.d.ts.map +1 -0
  86. package/dist/{event-testing-BqRnI0z4.d.cts → event-testing-D0qWfqAy.d.cts} +2 -3
  87. package/dist/event-testing-D0qWfqAy.d.cts.map +1 -0
  88. package/dist/event-testing.d.cts +1 -1
  89. package/dist/event-testing.d.ts +1 -1
  90. package/dist/event.cjs +4 -4
  91. package/dist/event.d.cts +3 -4
  92. package/dist/event.d.cts.map +1 -1
  93. package/dist/event.d.ts +3 -4
  94. package/dist/event.d.ts.map +1 -1
  95. package/dist/event.js +1 -1
  96. package/dist/exporters.d.cts +0 -4
  97. package/dist/exporters.d.cts.map +1 -1
  98. package/dist/exporters.d.ts +0 -4
  99. package/dist/exporters.d.ts.map +1 -1
  100. package/dist/{filtering-span-processor-B8R8B7Uk.d.ts → filtering-span-processor-BpDagWNa.d.cts} +1 -2
  101. package/dist/filtering-span-processor-BpDagWNa.d.cts.map +1 -0
  102. package/dist/{filtering-span-processor-B8R8B7Uk.d.cts → filtering-span-processor-BpDagWNa.d.ts} +1 -2
  103. package/dist/filtering-span-processor-BpDagWNa.d.ts.map +1 -0
  104. package/dist/filtering-span-processor.d.cts +1 -1
  105. package/dist/filtering-span-processor.d.ts +1 -1
  106. package/dist/functional-BnDUxnSl.js +838 -0
  107. package/dist/functional-BnDUxnSl.js.map +1 -0
  108. package/dist/functional-DcLBuCPz.cjs +888 -0
  109. package/dist/functional-DcLBuCPz.cjs.map +1 -0
  110. package/dist/functional.cjs +2 -2
  111. package/dist/functional.d.cts +79 -130
  112. package/dist/functional.d.cts.map +1 -1
  113. package/dist/functional.d.ts +79 -130
  114. package/dist/functional.d.ts.map +1 -1
  115. package/dist/functional.js +2 -2
  116. package/dist/http.cjs +6 -6
  117. package/dist/http.cjs.map +1 -1
  118. package/dist/http.d.cts +4 -5
  119. package/dist/http.d.cts.map +1 -1
  120. package/dist/http.d.ts +4 -5
  121. package/dist/http.d.ts.map +1 -1
  122. package/dist/http.js +5 -5
  123. package/dist/http.js.map +1 -1
  124. package/dist/{index-eKuioqT1.d.cts → index-BPcxVucm.d.cts} +2 -3
  125. package/dist/index-BPcxVucm.d.cts.map +1 -0
  126. package/dist/{index-Ck06vlW2.d.ts → index-DolOVX6F.d.ts} +2 -3
  127. package/dist/index-DolOVX6F.d.ts.map +1 -0
  128. package/dist/index.cjs +25 -167
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.d.cts +14 -14
  131. package/dist/index.d.cts.map +1 -1
  132. package/dist/index.d.ts +14 -14
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +6 -148
  135. package/dist/index.js.map +1 -1
  136. package/dist/init-C3RApHKJ.cjs +3371 -0
  137. package/dist/init-C3RApHKJ.cjs.map +1 -0
  138. package/dist/{init-DSrRmVnz.d.cts → init-D6n2diBy.d.ts} +46 -20
  139. package/dist/init-D6n2diBy.d.ts.map +1 -0
  140. package/dist/init-R-gSEXkJ.js +3190 -0
  141. package/dist/init-R-gSEXkJ.js.map +1 -0
  142. package/dist/{init-B7u-DjxM.d.ts → init-XzXzrarP.d.cts} +46 -20
  143. package/dist/init-XzXzrarP.d.cts.map +1 -0
  144. package/dist/instrumentation.cjs +7 -13
  145. package/dist/instrumentation.cjs.map +1 -1
  146. package/dist/instrumentation.d.cts +0 -1
  147. package/dist/instrumentation.d.cts.map +1 -1
  148. package/dist/instrumentation.d.ts +0 -1
  149. package/dist/instrumentation.d.ts.map +1 -1
  150. package/dist/instrumentation.js +8 -14
  151. package/dist/instrumentation.js.map +1 -1
  152. package/dist/{logger-BauSUhUv.d.ts → logger-CN4xpzMd.d.cts} +1 -2
  153. package/dist/logger-CN4xpzMd.d.cts.map +1 -0
  154. package/dist/{logger-BauSUhUv.d.cts → logger-CN4xpzMd.d.ts} +1 -2
  155. package/dist/logger-CN4xpzMd.d.ts.map +1 -0
  156. package/dist/logger-D3Ej3DII.js.map +1 -1
  157. package/dist/logger-thMPLpOG.cjs.map +1 -1
  158. package/dist/logger.d.cts +1 -1
  159. package/dist/logger.d.ts +1 -1
  160. package/dist/messaging-adapters.cjs.map +1 -1
  161. package/dist/messaging-adapters.d.cts +0 -1
  162. package/dist/messaging-adapters.d.cts.map +1 -1
  163. package/dist/messaging-adapters.d.ts +0 -1
  164. package/dist/messaging-adapters.d.ts.map +1 -1
  165. package/dist/messaging-adapters.js.map +1 -1
  166. package/dist/messaging-testing.d.cts +0 -1
  167. package/dist/messaging-testing.d.cts.map +1 -1
  168. package/dist/messaging-testing.d.ts +0 -1
  169. package/dist/messaging-testing.d.ts.map +1 -1
  170. package/dist/messaging.cjs +27 -10
  171. package/dist/messaging.cjs.map +1 -1
  172. package/dist/messaging.d.cts +6 -7
  173. package/dist/messaging.d.cts.map +1 -1
  174. package/dist/messaging.d.ts +6 -7
  175. package/dist/messaging.d.ts.map +1 -1
  176. package/dist/messaging.js +27 -10
  177. package/dist/messaging.js.map +1 -1
  178. package/dist/metric-helpers.d.cts +0 -1
  179. package/dist/metric-helpers.d.cts.map +1 -1
  180. package/dist/metric-helpers.d.ts +0 -1
  181. package/dist/metric-helpers.d.ts.map +1 -1
  182. package/dist/{metric-testing-DXdK3-Q3.d.ts → metric-testing-CWm6UhaR.d.ts} +2 -3
  183. package/dist/metric-testing-CWm6UhaR.d.ts.map +1 -0
  184. package/dist/{metric-testing-MxvzChDp.d.cts → metric-testing-CpvP3ZIa.d.cts} +2 -3
  185. package/dist/metric-testing-CpvP3ZIa.d.cts.map +1 -0
  186. package/dist/metric-testing.d.cts +1 -1
  187. package/dist/metric-testing.d.ts +1 -1
  188. package/dist/metric.d.cts +3 -4
  189. package/dist/metric.d.cts.map +1 -1
  190. package/dist/metric.d.ts +3 -4
  191. package/dist/metric.d.ts.map +1 -1
  192. package/dist/parse-error.d.cts.map +1 -1
  193. package/dist/parse-error.d.ts.map +1 -1
  194. package/dist/processors.cjs +1 -1
  195. package/dist/processors.d.cts +1 -1
  196. package/dist/processors.d.ts +1 -1
  197. package/dist/processors.js +1 -1
  198. package/dist/register.d.cts +1 -1
  199. package/dist/register.d.ts +1 -1
  200. package/dist/{sampling-DfYhDJij.d.cts → sampling-BR9fkSwx.d.cts} +127 -10
  201. package/dist/sampling-BR9fkSwx.d.cts.map +1 -0
  202. package/dist/{sampling-CR0Va1VB.d.ts → sampling-CP3e7-Yr.d.ts} +127 -10
  203. package/dist/sampling-CP3e7-Yr.d.ts.map +1 -0
  204. package/dist/sampling.cjs +160 -12
  205. package/dist/sampling.cjs.map +1 -1
  206. package/dist/sampling.d.cts +2 -2
  207. package/dist/sampling.d.ts +2 -2
  208. package/dist/sampling.js +157 -13
  209. package/dist/sampling.js.map +1 -1
  210. package/dist/security-schema.d.cts +9 -4
  211. package/dist/security-schema.d.cts.map +1 -1
  212. package/dist/security-schema.d.ts +9 -4
  213. package/dist/security-schema.d.ts.map +1 -1
  214. package/dist/semantic-conventions-FhSxv-bK.d.cts.map +1 -1
  215. package/dist/semantic-conventions-FhSxv-bK.d.ts.map +1 -1
  216. package/dist/semantic-conventions.cjs.map +1 -1
  217. package/dist/semantic-conventions.js.map +1 -1
  218. package/dist/semantic-helpers.cjs +85 -304
  219. package/dist/semantic-helpers.cjs.map +1 -1
  220. package/dist/semantic-helpers.d.cts +21 -12
  221. package/dist/semantic-helpers.d.cts.map +1 -1
  222. package/dist/semantic-helpers.d.ts +21 -12
  223. package/dist/semantic-helpers.d.ts.map +1 -1
  224. package/dist/semantic-helpers.js +85 -304
  225. package/dist/semantic-helpers.js.map +1 -1
  226. package/dist/slo.cjs +225 -0
  227. package/dist/slo.cjs.map +1 -0
  228. package/dist/slo.d.cts +97 -0
  229. package/dist/slo.d.cts.map +1 -0
  230. package/dist/slo.d.ts +97 -0
  231. package/dist/slo.d.ts.map +1 -0
  232. package/dist/slo.js +223 -0
  233. package/dist/slo.js.map +1 -0
  234. package/dist/{span-name-normalizer-8ZOGJuwv.d.ts → span-name-normalizer-CN1-8C76.d.cts} +1 -2
  235. package/dist/span-name-normalizer-CN1-8C76.d.cts.map +1 -0
  236. package/dist/{span-name-normalizer-8ZOGJuwv.d.cts → span-name-normalizer-CN1-8C76.d.ts} +1 -2
  237. package/dist/span-name-normalizer-CN1-8C76.d.ts.map +1 -0
  238. package/dist/span-name-normalizer.cjs.map +1 -1
  239. package/dist/span-name-normalizer.d.cts +1 -1
  240. package/dist/span-name-normalizer.d.ts +1 -1
  241. package/dist/span-name-normalizer.js.map +1 -1
  242. package/dist/tail-sampling-processor.d.cts +0 -1
  243. package/dist/tail-sampling-processor.d.cts.map +1 -1
  244. package/dist/tail-sampling-processor.d.ts +0 -1
  245. package/dist/tail-sampling-processor.d.ts.map +1 -1
  246. package/dist/test-span-collector.cjs.map +1 -1
  247. package/dist/test-span-collector.d.cts +0 -1
  248. package/dist/test-span-collector.d.cts.map +1 -1
  249. package/dist/test-span-collector.d.ts +0 -1
  250. package/dist/test-span-collector.d.ts.map +1 -1
  251. package/dist/test-span-collector.js.map +1 -1
  252. package/dist/testing.cjs +76 -11
  253. package/dist/testing.cjs.map +1 -1
  254. package/dist/testing.d.cts +30 -5
  255. package/dist/testing.d.cts.map +1 -1
  256. package/dist/testing.d.ts +30 -5
  257. package/dist/testing.d.ts.map +1 -1
  258. package/dist/testing.js +73 -12
  259. package/dist/testing.js.map +1 -1
  260. package/dist/{trace-context-Cijqoi6e.d.ts → trace-context-IuyoPyNq.d.cts} +9 -9
  261. package/dist/trace-context-IuyoPyNq.d.cts.map +1 -0
  262. package/dist/{trace-context-Cijqoi6e.d.cts → trace-context-IuyoPyNq.d.ts} +9 -9
  263. package/dist/trace-context-IuyoPyNq.d.ts.map +1 -0
  264. package/dist/trace-factory-validation-BjVAinz6.js +13 -0
  265. package/dist/trace-factory-validation-BjVAinz6.js.map +1 -0
  266. package/dist/trace-factory-validation-Dc8epn87.cjs +19 -0
  267. package/dist/trace-factory-validation-Dc8epn87.cjs.map +1 -0
  268. package/dist/trace-helpers.cjs +7 -7
  269. package/dist/trace-helpers.cjs.map +1 -1
  270. package/dist/trace-helpers.d.cts +6 -7
  271. package/dist/trace-helpers.d.cts.map +1 -1
  272. package/dist/trace-helpers.d.ts +6 -7
  273. package/dist/trace-helpers.d.ts.map +1 -1
  274. package/dist/trace-helpers.js +7 -7
  275. package/dist/trace-helpers.js.map +1 -1
  276. package/dist/tracer-provider.d.cts +0 -1
  277. package/dist/tracer-provider.d.cts.map +1 -1
  278. package/dist/tracer-provider.d.ts +0 -1
  279. package/dist/tracer-provider.d.ts.map +1 -1
  280. package/dist/validate.cjs.map +1 -1
  281. package/dist/validate.d.cts +1 -2
  282. package/dist/validate.d.cts.map +1 -1
  283. package/dist/validate.d.ts +1 -2
  284. package/dist/validate.d.ts.map +1 -1
  285. package/dist/validate.js.map +1 -1
  286. package/dist/validation-attributes.d.cts +17 -8
  287. package/dist/validation-attributes.d.cts.map +1 -1
  288. package/dist/validation-attributes.d.ts +17 -8
  289. package/dist/validation-attributes.d.ts.map +1 -1
  290. package/dist/webhook.cjs +5 -4
  291. package/dist/webhook.cjs.map +1 -1
  292. package/dist/webhook.d.cts +4 -4
  293. package/dist/webhook.d.cts.map +1 -1
  294. package/dist/webhook.d.ts +4 -4
  295. package/dist/webhook.d.ts.map +1 -1
  296. package/dist/webhook.js +5 -4
  297. package/dist/webhook.js.map +1 -1
  298. package/dist/workflow-distributed.cjs +5 -5
  299. package/dist/workflow-distributed.cjs.map +1 -1
  300. package/dist/workflow-distributed.d.cts +25 -15
  301. package/dist/workflow-distributed.d.cts.map +1 -1
  302. package/dist/workflow-distributed.d.ts +25 -15
  303. package/dist/workflow-distributed.d.ts.map +1 -1
  304. package/dist/workflow-distributed.js +5 -5
  305. package/dist/workflow-distributed.js.map +1 -1
  306. package/dist/workflow.cjs +24 -30
  307. package/dist/workflow.cjs.map +1 -1
  308. package/dist/workflow.d.cts +11 -6
  309. package/dist/workflow.d.cts.map +1 -1
  310. package/dist/workflow.d.ts +11 -6
  311. package/dist/workflow.d.ts.map +1 -1
  312. package/dist/workflow.js +24 -30
  313. package/dist/workflow.js.map +1 -1
  314. package/dist/yaml-config.d.cts +2 -3
  315. package/dist/yaml-config.d.cts.map +1 -1
  316. package/dist/yaml-config.d.ts +2 -3
  317. package/dist/yaml-config.d.ts.map +1 -1
  318. package/package.json +24 -16
  319. package/dist/attribute-redacting-processor-DtTS9xxh.d.cts.map +0 -1
  320. package/dist/attribute-redacting-processor-DtTS9xxh.d.ts.map +0 -1
  321. package/dist/canonical-log-line-processor-BcRuAdRk.d.ts.map +0 -1
  322. package/dist/canonical-log-line-processor-CcrDi6TO.cjs.map +0 -1
  323. package/dist/canonical-log-line-processor-FLezvFCB.js.map +0 -1
  324. package/dist/canonical-log-line-processor-xvjMgtpF.d.cts.map +0 -1
  325. package/dist/define-event-CreknLm3.d.ts.map +0 -1
  326. package/dist/define-event-HZRizPwz.d.cts.map +0 -1
  327. package/dist/event-BEm5IJ8U.js +0 -761
  328. package/dist/event-BEm5IJ8U.js.map +0 -1
  329. package/dist/event-rzA1X5h3.cjs +0 -778
  330. package/dist/event-rzA1X5h3.cjs.map +0 -1
  331. package/dist/event-subscriber-D1XLkPzi.d.cts.map +0 -1
  332. package/dist/event-subscriber-D1XLkPzi.d.ts.map +0 -1
  333. package/dist/event-testing-BqRnI0z4.d.cts.map +0 -1
  334. package/dist/event-testing-CfFs3to2.d.ts.map +0 -1
  335. package/dist/filtering-span-processor-B8R8B7Uk.d.cts.map +0 -1
  336. package/dist/filtering-span-processor-B8R8B7Uk.d.ts.map +0 -1
  337. package/dist/functional-CwsPyc4l.cjs +0 -1298
  338. package/dist/functional-CwsPyc4l.cjs.map +0 -1
  339. package/dist/functional-dAYhXQPA.js +0 -1248
  340. package/dist/functional-dAYhXQPA.js.map +0 -1
  341. package/dist/index-Ck06vlW2.d.ts.map +0 -1
  342. package/dist/index-eKuioqT1.d.cts.map +0 -1
  343. package/dist/init-B7u-DjxM.d.ts.map +0 -1
  344. package/dist/init-BvBB45-T.js +0 -1034
  345. package/dist/init-BvBB45-T.js.map +0 -1
  346. package/dist/init-BxJEJ9Tn.cjs +0 -1111
  347. package/dist/init-BxJEJ9Tn.cjs.map +0 -1
  348. package/dist/init-DSrRmVnz.d.cts.map +0 -1
  349. package/dist/logger-BauSUhUv.d.cts.map +0 -1
  350. package/dist/logger-BauSUhUv.d.ts.map +0 -1
  351. package/dist/metric-testing-DXdK3-Q3.d.ts.map +0 -1
  352. package/dist/metric-testing-MxvzChDp.d.cts.map +0 -1
  353. package/dist/operation-context-CKBoA4Qy.js +0 -59
  354. package/dist/operation-context-CKBoA4Qy.js.map +0 -1
  355. package/dist/operation-context-hzKbTKnt.cjs +0 -72
  356. package/dist/operation-context-hzKbTKnt.cjs.map +0 -1
  357. package/dist/sampling-CR0Va1VB.d.ts.map +0 -1
  358. package/dist/sampling-DfYhDJij.d.cts.map +0 -1
  359. package/dist/span-name-normalizer-8ZOGJuwv.d.cts.map +0 -1
  360. package/dist/span-name-normalizer-8ZOGJuwv.d.ts.map +0 -1
  361. package/dist/trace-context-Cijqoi6e.d.cts.map +0 -1
  362. package/dist/trace-context-Cijqoi6e.d.ts.map +0 -1
  363. package/dist/track-D7O7oIZa.js +0 -1115
  364. package/dist/track-D7O7oIZa.js.map +0 -1
  365. package/dist/track-eovhCJ-I.cjs +0 -1218
  366. package/dist/track-eovhCJ-I.cjs.map +0 -1
  367. package/skills/analyze-traces/SKILL.md +0 -180
  368. package/skills/autotel-core/SKILL.md +0 -159
  369. package/skills/autotel-events/SKILL.md +0 -84
  370. package/skills/autotel-frameworks/SKILL.md +0 -90
  371. package/skills/autotel-instrumentation/SKILL.md +0 -145
  372. package/skills/autotel-request-logging/SKILL.md +0 -94
  373. package/skills/autotel-structured-errors/SKILL.md +0 -125
  374. package/skills/build-audit-trails/SKILL.md +0 -460
  375. package/skills/build-audit-trails/references/audit-queries.md +0 -73
  376. package/skills/build-audit-trails/references/framework-wiring.md +0 -196
  377. package/skills/debug-missing-spans/SKILL.md +0 -250
  378. package/skills/migrate-to-autotel/SKILL.md +0 -269
  379. package/skills/review-otel-patterns/SKILL.md +0 -538
  380. package/skills/review-otel-patterns/references/code-review.md +0 -76
  381. package/skills/review-otel-patterns/references/processor-pipeline.md +0 -205
  382. package/skills/review-otel-patterns/references/structured-errors.md +0 -102
  383. package/skills/review-otel-patterns/references/wide-spans.md +0 -85
  384. package/skills/tune-sampling/SKILL.md +0 -215
@@ -1,538 +0,0 @@
1
- ---
2
- name: review-otel-patterns
3
- description: >
4
- Review TypeScript/JavaScript code for OpenTelemetry instrumentation patterns and guide adoption of autotel.
5
- Covers Next.js, Nuxt, Nitro, TanStack Start, SvelteKit, NestJS, Express, Hono, Fastify, Elysia,
6
- Cloudflare Workers, AWS Lambda, edge runtimes, and standalone Node. Detects unstructured tracing,
7
- missing span attributes, manual exporter setup, broken context propagation, exposed PII, and ad-hoc
8
- error handling. Covers spans, metrics, logs, structured errors, the autotel processor pipeline
9
- (tail-sampling, attribute redaction, span-name normalisation, filtering, baggage),
10
- built-in enrichers (user agent, geo, request size) and custom `defineEnricher`,
11
- `defineWorkerFetch` for Cloudflare async drains, multi-vendor OTLP backends (Honeycomb, Datadog,
12
- Grafana Cloud, Sentry, Axiom, HyperDX), `composeSpanProcessors` / `composeSubscribers` /
13
- `composePostProcessors` for pipelines, AI SDK observability with gen-ai semantic conventions, and
14
- end-to-end OTLP testing.
15
- license: MIT
16
- ---
17
-
18
- # Review OpenTelemetry patterns
19
-
20
- Review and improve OpenTelemetry instrumentation in TypeScript/JavaScript codebases using autotel. Replace ad-hoc tracing with idiomatic OTel-native spans, metrics and structured logs that work across every major framework and edge runtime — without vendor lock-in.
21
-
22
- ## When to use
23
-
24
- - Setting up autotel in a new or existing project (any supported framework)
25
- - Reviewing code for OpenTelemetry best practices
26
- - Converting `console.log` / ad-hoc tracing to spans + structured events
27
- - Improving error handling with structured errors and span status
28
- - Configuring sampling, redaction, processors, or backends
29
- - Migrating between observability vendors
30
-
31
- ## Quick reference
32
-
33
- | Working on… | Resource |
34
- | -------------------------------- | -------------------------------------------------------------------- |
35
- | Span design + wide events | [references/wide-spans.md](references/wide-spans.md) |
36
- | Structured errors | [references/structured-errors.md](references/structured-errors.md) |
37
- | Code review checklist | [references/code-review.md](references/code-review.md) |
38
- | Processor pipeline + composition | [references/processor-pipeline.md](references/processor-pipeline.md) |
39
-
40
- ## Installation
41
-
42
- ```bash
43
- npm install autotel
44
- ```
45
-
46
- For framework-specific helpers, install the relevant package alongside core:
47
-
48
- ```bash
49
- npm install autotel-cloudflare # Workers + Durable Objects + Workflows
50
- npm install autotel-edge # Vendor-agnostic edge runtime base
51
- npm install autotel-hono # Hono middleware
52
- npm install autotel-tanstack # TanStack Start
53
- npm install autotel-adapters # Next.js / Nitro / Hono / Cloudflare adapter toolkit
54
- npm install autotel-vitest # Span assertions in tests
55
- npm install autotel-playwright # Browser → server trace propagation
56
- npm install autotel-drizzle # Drizzle ORM auto-instrumentation
57
- npm install autotel-mongoose # Mongoose auto-instrumentation
58
- npm install autotel-sentry # Sentry exporter via OTLP
59
- ```
60
-
61
- ---
62
-
63
- ## Framework setup
64
-
65
- ### Next.js (App Router)
66
-
67
- Step 1 — Initialise once in `instrumentation.ts`:
68
-
69
- ```typescript
70
- // instrumentation.ts
71
- import { init } from 'autotel';
72
-
73
- export function register() {
74
- if (process.env.NEXT_RUNTIME === 'nodejs') {
75
- init({
76
- service: 'my-app',
77
- endpoint: process.env.OTLP_ENDPOINT!,
78
- sampling: { rates: { server: 25, client: 5 } },
79
- attributeRedactor: 'default',
80
- });
81
- }
82
- }
83
- ```
84
-
85
- Step 2 — Wrap route handlers:
86
-
87
- ```typescript
88
- // app/api/checkout/route.ts
89
- import { withAutotel } from 'autotel-adapters';
90
-
91
- export const POST = withAutotel(async (request: Request) => {
92
- const log = useLogger();
93
- log.set({ user: { id: 'usr_123', plan: 'enterprise' } });
94
- log.set({ cart: { items: 3, total: 14_999 } });
95
- return Response.json({ ok: true });
96
- });
97
- ```
98
-
99
- Step 3 — Tag Server Actions the same way (`withAutotel`).
100
-
101
- Step 4 — Browser → server trace propagation: drop in `<TraceProvider />` from `autotel-web` so the W3C `traceparent` header is forwarded automatically.
102
-
103
- ### Nuxt + Nitro v3
104
-
105
- ```typescript
106
- // nitro.config.ts
107
- import { defineConfig } from 'nitro';
108
- import autotel from 'autotel-adapters/nitro';
109
-
110
- export default defineConfig({
111
- modules: [
112
- autotel({ service: 'my-api', sampling: { rates: { server: 25 } } }),
113
- ],
114
- });
115
- ```
116
-
117
- ```typescript
118
- // routes/api/checkout.post.ts
119
- import { useLogger } from 'autotel-adapters/nitro';
120
-
121
- export default defineEventHandler(async (event) => {
122
- const log = useLogger(event);
123
- log.set({ action: 'checkout', user: { id: event.context.user?.id } });
124
- return { ok: true };
125
- });
126
- ```
127
-
128
- ### TanStack Start
129
-
130
- ```typescript
131
- // nitro.config.ts
132
- import autotel from 'autotel-adapters/nitro';
133
- export default defineConfig({
134
- modules: [autotel({ service: 'my-app' })],
135
- });
136
- ```
137
-
138
- ```typescript
139
- // src/routes/__root.tsx
140
- import { createMiddleware } from '@tanstack/react-start';
141
- import { autotelMiddleware } from 'autotel-tanstack';
142
-
143
- export const Route = createRootRoute({
144
- server: { middleware: [createMiddleware().server(autotelMiddleware())] },
145
- });
146
- ```
147
-
148
- ### Hono
149
-
150
- ```typescript
151
- import { Hono } from 'hono';
152
- import { honoToolkit } from 'autotel-adapters';
153
-
154
- const { useLogger, withAutotel } = honoToolkit;
155
- const app = new Hono();
156
- app.use('*', withAutotel({ service: 'my-api' }));
157
-
158
- app.get('/api/users', (c) => {
159
- const log = useLogger(c);
160
- log.set({ users: { count: 42 } });
161
- return c.json({ users: [] });
162
- });
163
- ```
164
-
165
- ### Express / Fastify / Elysia / NestJS
166
-
167
- The `autotel-adapters` toolkit ships a uniform shape for these: `withAutotel` middleware + `useLogger()` from anywhere in the call stack. See per-framework docs in `packages/autotel-adapters/skills/autotel-adapters/SKILL.md`.
168
-
169
- ### Cloudflare Workers (with auto `waitUntil`)
170
-
171
- `defineWorkerFetch` instruments the handler **and** wires `ctx.waitUntil` for span exports — without it, async exports silently drop:
172
-
173
- ```typescript
174
- import { defineWorkerFetch } from 'autotel-cloudflare';
175
-
176
- export default defineWorkerFetch(
177
- { service: { name: 'edge-api' } },
178
- async (request, env, ctx, log) => {
179
- log.set({ route: '/health', user: { id: env.userId } });
180
- return new Response('ok');
181
- },
182
- );
183
- ```
184
-
185
- For broader use cases (`scheduled`, `queue`, `email` handlers, Durable Objects, Workflows), use `wrapModule` / `wrapDurableObject` / `instrumentWorkflow` — same auto-`waitUntil` semantics.
186
-
187
- ### AWS Lambda
188
-
189
- ```typescript
190
- import { withLambda } from 'autotel-aws';
191
-
192
- export const handler = withLambda(async (event) => {
193
- const log = useLogger();
194
- log.set({ event: { source: event.source } });
195
- return { statusCode: 200 };
196
- });
197
- ```
198
-
199
- ### Standalone Node / scripts
200
-
201
- ```typescript
202
- import { init, trace } from 'autotel';
203
-
204
- init({ service: 'my-worker', endpoint: process.env.OTLP_ENDPOINT! });
205
-
206
- const processJob = trace(async (job: Job) => {
207
- // span auto-named after the function
208
- const log = useLogger();
209
- log.set({ job: { id: job.id, source: job.source } });
210
- });
211
- ```
212
-
213
- ---
214
-
215
- ## Configuration options
216
-
217
- All options work with `init()`, framework adapters, and `wrapModule` / `defineWorkerFetch`:
218
-
219
- | Option | Type | Default | Description |
220
- | --------------------------------------- | --------------------------------------------------------------- | ----------------- | --------------------------------------------------------------- |
221
- | `service` / `service.name` | `string` | `'app'` | Service name in `service.name` resource attribute |
222
- | `endpoint` | `string` | — | Single OTLP destination shorthand |
223
- | `destinations` | `Array<{ endpoint, headers?, protocol?, signals? }>` | — | Declarative OTLP fan-out to multiple backends |
224
- | `spanProcessors` | `SpanProcessor[]` | — | Use **instead of** `exporter` for full control |
225
- | `sampling.rates` | `{ server?: number, client?: number, internal?: number }` | `100%` | Head sampling per span kind (0–100%) |
226
- | `sampling.tail` | `TailSampleFn` | — | Keep traces matching predicate (e.g. errors, slow) |
227
- | `attributeRedactor` | `'default' \| 'strict' \| 'pci-dss' \| AttributeRedactorConfig` | — | PII redaction; on by default in production |
228
- | `instrumentation.disabled` | `boolean` | `false` | Hard-off switch (ideal for local dev) |
229
- | `instrumentation.instrumentGlobalFetch` | `boolean` | `true` | Patch `globalThis.fetch` for outbound HTTP spans |
230
- | `subscribers` | `EdgeSubscriber[]` | — | In-process side effects (metrics, audit, AI cost) |
231
- | `postProcessor` | `PostProcessorFn` | — | Mutate spans before export (redact, drop, tag) |
232
- | `propagator` | `TextMapPropagator` | W3C trace-context | Override propagation format |
233
- | `dataSafety` | `DataSafetyConfig` | — | Per-attribute safety (`captureDbStatement: 'obfuscated'`, etc.) |
234
-
235
- ---
236
-
237
- ## Built-in enrichers
238
-
239
- Enrichers turn raw request data into standard, low-cardinality span attributes. Import the helpers from `autotel/enrichers` and spread their output onto the active span or request logger. Each returns `undefined` when there is nothing to add, so spreading is safe.
240
-
241
- | Helper | Returns attributes | Source |
242
- | -------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------- |
243
- | `userAgent(headers)` | `user_agent.raw`, `user_agent.browser`, `user_agent.os`, `user_agent.device` | `user-agent` request header |
244
- | `geo(headers)` | `geo.country`, `geo.region`, `geo.city`, `geo.latitude`, `geo.longitude` | Vercel / Cloudflare geo headers |
245
- | `requestSize(reqHeaders, resHeaders?)` | `http.request.body.size`, `http.response.body.size` | `content-length` headers |
246
-
247
- ```typescript
248
- import { userAgent, geo, requestSize } from 'autotel/enrichers';
249
-
250
- export const handler = trace((ctx) => async (request: Request) => {
251
- ctx.setAttributes({
252
- ...userAgent(request.headers),
253
- ...geo(request.headers),
254
- ...requestSize(request.headers),
255
- });
256
- // ... handle request
257
- });
258
- ```
259
-
260
- For your own derived fields on a request's wide event, build a reusable enricher with `defineEnricher` (from `autotel`) instead of scattering ad-hoc field writes. `compute` returns an object that is merged into the named `field`; return `undefined` to skip. Keep the output low-cardinality (bucket or hash high-cardinality values):
261
-
262
- ```typescript
263
- import { defineEnricher } from 'autotel';
264
-
265
- // Merge a derived, low-cardinality object into event.user on each request.
266
- const enrichTier = defineEnricher<
267
- { user?: { plan?: string } },
268
- { tier: string }
269
- >({
270
- name: 'user-tier',
271
- field: 'user',
272
- compute: ({ event }) => ({ tier: event.user?.plan ?? 'anonymous' }),
273
- });
274
- ```
275
-
276
- **Review checks:** raw `User-Agent` strings stored verbatim (use `userAgent()` to parse), geo data hand-parsed per framework (use `geo()`), and high-cardinality values (full URLs, emails, ids) set directly as attributes instead of being bucketed or hashed.
277
-
278
- ---
279
-
280
- ## Backends (multi-vendor OTLP)
281
-
282
- Switch backends with **no code changes** — autotel speaks OTLP HTTP/JSON and HTTP/protobuf out of the box.
283
-
284
- | Backend | Endpoint | Headers |
285
- | -------------------------------- | ---------------------------------------------------------- | ------------------------------------- |
286
- | Honeycomb | `https://api.honeycomb.io/v1/traces` | `{ 'x-honeycomb-team': '<key>' }` |
287
- | Grafana Cloud | `https://otlp-gateway-<region>.grafana.net/otlp/v1/traces` | `{ authorization: 'Basic <b64>' }` |
288
- | Datadog (OTLP intake) | `https://trace.agent.datadoghq.com/api/v0.4/traces` | `{ 'dd-api-key': '<key>' }` |
289
- | Sentry | `<dsn>/api/<id>/envelope/` (use `autotel-sentry`) | `{ 'x-sentry-auth': '…' }` |
290
- | Axiom | `https://api.axiom.co/v1/traces` | `{ authorization: 'Bearer <token>' }` |
291
- | HyperDX | `https://in-otel.hyperdx.io/v1/traces` | `{ authorization: '<key>' }` |
292
- | New Relic | `https://otlp.nr-data.net/v1/traces` | `{ 'api-key': '<key>' }` |
293
- | Local Jaeger / Tempo / Collector | `http://localhost:4318/v1/traces` | — |
294
-
295
- Use `init({ endpoint, headers })` for one backend. For multiple OTLP backends, prefer `init({ destinations: [...] })`. Drop to `composeSpanProcessors([batchA, batchB])` only when you need custom processor-level control.
296
-
297
- ---
298
-
299
- ## Auto-redaction (PII protection)
300
-
301
- Built-in masking scrubs sensitive data from span attributes **before** export. **On by default in production**, off in development. Smart partial masking preserves debug signal:
302
-
303
- | Pattern | Example input | Masked output |
304
- | ------------ | --------------------- | -------------------------------------------- |
305
- | `creditCard` | `4111-1111-1111-1111` | `****1111` (PCI-DSS compliant) |
306
- | `email` | `alice@example.com` | `a***@***.com` |
307
- | `ipv4` | `192.168.1.100` | `***.***.***.100` |
308
- | `phone` | `+33 6 12 34 56 78` | `+33******78` (requires `+cc` or `(parens)`) |
309
- | `jwt` | `eyJhbGciOi…` | `eyJ***.***` |
310
- | `bearer` | `Bearer sk_live_abc…` | `Bearer ***` |
311
- | `iban` | `FR76 3000 6000 …189` | `FR76****189` |
312
-
313
- Three presets ship out of the box: `'default'` (PII-grade), `'strict'` (adds JWT / Bearer / IBAN, redacts more keys), `'pci-dss'` (cards only, PCI focus).
314
-
315
- ```typescript
316
- init({
317
- service: 'my-app',
318
- attributeRedactor: 'default',
319
- });
320
- ```
321
-
322
- Custom config:
323
-
324
- ```typescript
325
- import { builtinPatterns, type AttributeRedactorConfig } from 'autotel';
326
-
327
- const config: AttributeRedactorConfig = {
328
- keyPatterns: [/password/i, /^x-internal-/i],
329
- builtins: ['email', 'creditCard', 'jwt'], // pick specific masks
330
- valuePatterns: [
331
- { name: 'customerId', pattern: /CUST-\d{8}/g, replacement: 'CUST-***' },
332
- ],
333
- };
334
- init({ attributeRedactor: config });
335
- ```
336
-
337
- For free-text fields outside the span pipeline (logs, error messages, frontend payloads), use `createStringRedactor('default')` — same masks, returns a `(s: string) => string`.
338
-
339
- ---
340
-
341
- ## Composition (build pipelines from small parts)
342
-
343
- ```typescript
344
- import {
345
- composeSpanProcessors,
346
- composeSubscribers,
347
- composePostProcessors,
348
- defineConfig,
349
- } from 'autotel-edge';
350
-
351
- export const otelConfig = defineConfig({
352
- service: { name: 'checkout' },
353
- spanProcessors: composeSpanProcessors([
354
- new BatchSpanProcessor(honeycombExporter),
355
- new BatchSpanProcessor(datadogExporter),
356
- new TailSamplingProcessor({ keep: { errors: true, slow: 500 } }),
357
- ]),
358
- subscribers: [
359
- composeSubscribers([metricsSubscriber, auditSubscriber, aiCostSubscriber]),
360
- ],
361
- postProcessor: composePostProcessors([
362
- redactPiiInStackTraces,
363
- dropHealthChecks,
364
- ]),
365
- });
366
- ```
367
-
368
- Errors are isolated per item — one bad processor cannot break the others. See [references/processor-pipeline.md](references/processor-pipeline.md) for the full pipeline cookbook.
369
-
370
- ---
371
-
372
- ## Processors (autotel-specific superpowers)
373
-
374
- | Processor | Purpose |
375
- | ------------------------------ | ----------------------------------------------------------- |
376
- | `AttributeRedactingProcessor` | PII masking with smart partial output |
377
- | `TailSamplingProcessor` | Keep errors + slow + sampled-by-rate |
378
- | `FilteringSpanProcessor` | Drop spans matching predicate (health checks, etc.) |
379
- | `SpanNameNormalizingProcessor` | Normalise `/users/123` → `/users/{id}` to bound cardinality |
380
- | `BaggageSpanProcessor` | Lift baggage entries onto every span |
381
- | `PrettyConsoleExporter` | Hierarchical colourised output for local dev |
382
-
383
- Compose them at build time with `composeSpanProcessors([...])` — no boilerplate.
384
-
385
- ---
386
-
387
- ## AI SDK integration (gen-ai semantic conventions)
388
-
389
- autotel implements the **OTel gen-ai semantic conventions** out of the box. Token usage, tool calls, model info, latency, cost — captured as standard attributes (`gen_ai.usage.input_tokens`, `gen_ai.tool.name`, `gen_ai.response.finish_reasons`, …) so any backend that understands OTel can render LLM telemetry without custom mapping.
390
-
391
- > Node.js apps get the same canonical `gen_ai.*` conventions (plus cost, metric views, and agent governance) from the `autotel-genai` package — `traceGenAI` / `recordGenAiUsage` from `autotel-genai/trace` and `genAiMetricViews` from `autotel-genai/metrics`. `withAiTelemetry` below is the edge-runtime entry point.
392
-
393
- ```typescript
394
- import { trace } from 'autotel';
395
- import { withAiTelemetry } from 'autotel-edge';
396
- import { registerTelemetry } from 'ai';
397
- import { streamText } from 'ai';
398
- import { autotelTelemetry } from 'autotel-genai/observer';
399
-
400
- registerTelemetry(autotelTelemetry()); // Node / server runtimes
401
-
402
- const handler = trace(async (req) => {
403
- const result = await streamText({
404
- model: withAiTelemetry('anthropic/claude-sonnet-4.6'),
405
- messages: req.messages,
406
- });
407
- return result.toResponse();
408
- });
409
- ```
410
-
411
- Captured attributes per call: `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens` / `output_tokens` / `reasoning.output_tokens` / `cache_read.input_tokens`, `gen_ai.response.finish_reasons`, `gen_ai.response.id`, plus per-tool spans with `gen_ai.tool.name`. Cost estimation (`gen_ai.usage.cost.usd`) comes for free from `autotelTelemetry()` in Node runtimes or if you pass a pricing map to `withAiTelemetry`.
412
-
413
- Anti-patterns to detect:
414
-
415
- | Anti-pattern | Fix |
416
- | ---------------------------------- | --------------------------------------------------------- |
417
- | Manual `result.usage` printing | `autotelTelemetry()` or `withAiTelemetry()` |
418
- | Custom `ai.tokens` attribute names | Use OTel gen-ai conventions (`gen_ai.usage.input_tokens`) |
419
- | Tool calls as plain log lines | Each tool call gets a child span automatically |
420
- | AI SDK not registered in Node | `registerTelemetry(autotelTelemetry())` |
421
-
422
- ---
423
-
424
- ## Structured errors
425
-
426
- Throw rich errors that carry status, audience, and remediation hints — and consume them at HTTP boundaries:
427
-
428
- ```typescript
429
- import { createStructuredError, parseError } from 'autotel';
430
-
431
- throw createStructuredError({
432
- message: 'Payment declined',
433
- status: 402,
434
- why: 'Card declined by issuer — insufficient funds',
435
- fix: 'Use a different payment method or contact your bank',
436
- link: 'https://docs.example.com/payments/declined',
437
- internal: { correlationId: 'req_abc', resourceId: 'cust_123' },
438
- });
439
-
440
- // at the HTTP boundary
441
- app.onError((error, c) => {
442
- const parsed = parseError(error);
443
- // `internal` is stripped from `parsed` — never returned to clients
444
- return c.json(parsed, parsed.status);
445
- });
446
- ```
447
-
448
- `createStructuredError` records the error onto the active span automatically (`exception.type`, `exception.message`, `exception.stacktrace`) and sets `span.status = ERROR`.
449
-
450
- See [references/structured-errors.md](references/structured-errors.md) for templates.
451
-
452
- ---
453
-
454
- ## Testing your instrumentation
455
-
456
- ### Unit tests (in-memory exporter)
457
-
458
- ```typescript
459
- import { InMemorySpanExporter } from 'autotel/exporters';
460
- import { SimpleSpanProcessor } from 'autotel/processors';
461
- import { init, trace } from 'autotel';
462
-
463
- const exporter = new InMemorySpanExporter();
464
- init({ service: 'test', spanProcessors: [new SimpleSpanProcessor(exporter)] });
465
-
466
- await trace(async () => {
467
- // … code under test
468
- })();
469
-
470
- const spans = exporter.getFinishedSpans();
471
- expect(spans).toContainSpan({
472
- name: 'processOrder',
473
- attributes: { 'order.id': '123' },
474
- });
475
- ```
476
-
477
- `autotel-vitest` ships a custom matcher (`toContainSpan`) and a `withSpans()` helper.
478
-
479
- ### End-to-end (real OTLP backend)
480
-
481
- `packages/autotel/test/e2e/` ships a working OTLP HTTP/JSON smoke test that tags every span with `e2e_run_id` / `e2e_correlation_id` for cleanup, skips gracefully when env vars are missing, and is wired up to a daily GitHub Actions cron. Copy it to test against your own backend (Honeycomb, Grafana Cloud, Datadog, …):
482
-
483
- ```bash
484
- pnpm --filter autotel run test:e2e
485
- ```
486
-
487
- ### Bundle size guard
488
-
489
- `scripts/check-bundle-size.mjs` measures every `packages/autotel*/dist` against `bundle-size-baseline.json` and fails CI on growth past 5 % / 2 KiB. Update the baseline only when the growth is intentional.
490
-
491
- ---
492
-
493
- ## Anti-patterns to detect
494
-
495
- | Anti-pattern | Fix |
496
- | --------------------------------------------------- | ------------------------------------------------------------------- |
497
- | `console.log` in handlers | Use `useLogger()` — fields land on the active span |
498
- | Manual `tracer.startSpan` boilerplate | `trace(fn)` — auto-named, auto-ended, auto-status |
499
- | `try { … } catch (e) { console.error(e); throw e }` | Replace with `createStructuredError({ … })` |
500
- | `throw new Error('something went wrong')` | `createStructuredError({ message, status, why, fix })` |
501
- | Ad-hoc `span.setAttribute('user_id', id)` | Use `useLogger().set({ user: { id } })` — flattens with stable keys |
502
- | Multiple exporters wired in parallel by hand | `composeSpanProcessors([…])` |
503
- | PII in attributes | `attributeRedactor: 'default'` (on in prod by default) |
504
- | Cloudflare Workers without `waitUntil` | Use `defineWorkerFetch` / `wrapModule` |
505
- | High-cardinality span names (`/users/123`) | `SpanNameNormalizingProcessor` |
506
- | AI SDK token logs | `withAiTelemetry()` + gen-ai semantic conventions |
507
- | Health checks blowing up trace volume | `FilteringSpanProcessor` |
508
- | No tests for instrumentation | `InMemorySpanExporter` + `autotel-vitest` matchers |
509
- | Manual context propagation in fetch | `instrumentation.instrumentGlobalFetch: true` (default) |
510
-
511
- See [references/code-review.md](references/code-review.md) for the full checklist.
512
-
513
- ---
514
-
515
- ## Why autotel beats manually-wired OTel
516
-
517
- | Concern | Plain `@opentelemetry/sdk-node` | autotel |
518
- | --------------------- | ---------------------------------------------------- | ----------------------------------------------------- |
519
- | Setup | Multi-page checklist, vendor-specific resource attrs | One `init()` call, sane defaults |
520
- | Cloudflare Workers | DIY `waitUntil` (logs/spans drop silently if missed) | `defineWorkerFetch` auto-wires it |
521
- | PII redaction | DIY span processor | `attributeRedactor: 'default'` (smart masks built in) |
522
- | High-cardinality URLs | DIY span name munging | `SpanNameNormalizingProcessor` |
523
- | Multi-backend | Hand-write a tee processor | `composeSpanProcessors([…])` |
524
- | Local debugging | Manual `ConsoleSpanExporter` plumbing | `init({ debug: 'pretty' })` |
525
- | AI SDK | Custom attributes, vendor-specific dashboards | OTel gen-ai semconv out of the box |
526
- | Bundle size | Unbounded | CI guard with `bundle-size-baseline.json` |
527
- | Real-backend tests | DIY | `pnpm test:e2e` ships a working OTLP smoke test |
528
-
529
- ---
530
-
531
- ## Loading reference files
532
-
533
- Load based on what you're working on — **do not load all at once**:
534
-
535
- - Designing spans → [references/wide-spans.md](references/wide-spans.md)
536
- - Improving errors → [references/structured-errors.md](references/structured-errors.md)
537
- - Full code review → [references/code-review.md](references/code-review.md)
538
- - Pipeline / processors → [references/processor-pipeline.md](references/processor-pipeline.md)
@@ -1,76 +0,0 @@
1
- # OpenTelemetry code review checklist
2
-
3
- Run through this list when adding observability to a new service or auditing an existing one.
4
-
5
- ## Setup
6
-
7
- - [ ] **Service name set.** `service.name` resource attribute is unique per deployable unit (not just `"app"`).
8
- - [ ] **OTLP endpoint configured** via `OTLP_ENDPOINT` env var. Don't hard-code per-vendor URLs.
9
- - [ ] **No global SDK init in handlers.** Init runs once at module load (Next.js `instrumentation.ts`, Workers top of module, Node `--require`).
10
- - [ ] **Production redaction on.** `attributeRedactor: 'default'` (or `'strict'` / `'pci-dss'`) — autotel turns it on automatically when `NODE_ENV === 'production'`.
11
- - [ ] **Sampling configured.** Don't ship 100% in production unless volume is genuinely tiny. `sampling.rates: { server: 25 }` is a reasonable starting point.
12
-
13
- ## Spans
14
-
15
- - [ ] **One wide span per logical unit of work.** Avoid hundreds of trivial spans.
16
- - [ ] **Span names are low-cardinality.** `/users/:id`, not `/users/123`. Use `SpanNameNormalizingProcessor` if necessary.
17
- - [ ] **No raw bodies in attributes.** Pick fields explicitly: `{ user: { id, plan } }` not `{ user: requestBody }`.
18
- - [ ] **Status is set on errors.** `createStructuredError` does it; manual throws should set `span.status = ERROR`.
19
- - [ ] **Context propagation works end-to-end.** W3C `traceparent` headers on outbound requests (autotel's global fetch instrumentation handles this).
20
- - [ ] **Cross-service propagation works.** Browser → server, server → service, server → queue worker.
21
-
22
- ## Cloudflare Workers
23
-
24
- - [ ] **`defineWorkerFetch` (or `wrapModule`).** Async drains drop silently if `ctx.waitUntil` isn't wired.
25
- - [ ] **No SDK calls inside `addEventListener`.** Use the module worker style.
26
- - [ ] **Bindings instrumented.** `instrumentBindings: true` to get spans for KV / R2 / D1 / Service Bindings.
27
- - [ ] **Durable Objects wrapped.** `wrapDurableObject` for transactional state.
28
-
29
- ## Logs (structured events)
30
-
31
- - [ ] **`useLogger().set({ … })` instead of `console.log`.** Logger fields land on the active span automatically.
32
- - [ ] **No PII in attributes** (or rely on redactor). Don't log raw email / cards / phones / JWTs.
33
- - [ ] **Group fields with objects.** `{ user: { id, plan } }`, not flat `userId` / `userPlan`.
34
- - [ ] **Decisions captured.** Which branch, which fallback, which feature flag — not just inputs.
35
- - [ ] **Background work uses `log.fork()`** — gets its own span and `_parentCorrelationId` for correlation.
36
-
37
- ## Errors
38
-
39
- - [ ] **`createStructuredError({ message, status, why, fix })`.** No bare `new Error('…')`.
40
- - [ ] **`parseError()` at HTTP boundaries.** `internal` is stripped; clients only see safe fields.
41
- - [ ] **Validation errors include `details`.** Per-field problems for the client to render.
42
- - [ ] **No double-logging.** Don't `console.error(e); throw e`; the span will pick it up.
43
-
44
- ## Metrics
45
-
46
- - [ ] **Use OTel meter API**, not service-specific clients.
47
- - [ ] **Counters for events, histograms for durations, gauges for snapshots** — match the right type.
48
- - [ ] **Bounded label cardinality.** Don't put `userId` on a metric label.
49
-
50
- ## AI / LLM
51
-
52
- - [ ] **Node/server runtimes register `autotelTelemetry()`.** `registerTelemetry(autotelTelemetry())` captures canonical `gen_ai.*`, tool spans, cost, and streaming timing.
53
- - [ ] **Edge runtimes use `withAiTelemetry()` from `autotel-edge`.** Captures `gen_ai.*` semantic attributes automatically.
54
- - [ ] **No bespoke `ai.tokens` attributes.** Use `gen_ai.usage.input_tokens`, etc.
55
- - [ ] **Cost tracking is canonical.** Use `gen_ai.usage.cost.usd`, not custom cost keys.
56
- - [ ] **Tool-call spans are emitted by the integration.** No plain log-only tool activity.
57
-
58
- ## Testing
59
-
60
- - [ ] **`InMemorySpanExporter` in unit tests.** Assert spans + attributes.
61
- - [ ] **`autotel-vitest` matchers** (`toContainSpan`, `withSpans()`).
62
- - [ ] **One e2e smoke test against a real OTLP backend.** `pnpm test:e2e` template ships in `packages/autotel/test/e2e/`.
63
- - [ ] **Bundle-size baseline.** `pnpm bundle-size` runs on PRs; commit the baseline only on intentional growth.
64
-
65
- ## Pipeline / processors
66
-
67
- - [ ] **One source of composition.** `composeSpanProcessors` / `composeSubscribers` / `composePostProcessors` over hand-rolled tee logic.
68
- - [ ] **Tail sampling for noisy services.** Keep errors + slow + a sampled %.
69
- - [ ] **Filter health checks.** `FilteringSpanProcessor({ exclude: ['/healthz', '/ready'] })`.
70
- - [ ] **Baggage for cross-cutting context.** `BaggageSpanProcessor` lifts `feature_flags`, `tenant`, etc. onto every span automatically.
71
-
72
- ## Secrets
73
-
74
- - [ ] **No exporter tokens in client bundles.** Server-only env vars.
75
- - [ ] **No span attributes containing secrets.** Even with redaction on, prefer not to capture them at all.
76
- - [ ] **CI runs e2e with secret-protected workflow** (label `e2e`, never on fork PRs).