autotel 6.1.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/dist/analysis.cjs +1 -2
  2. package/dist/analysis.d.cts +1 -2
  3. package/dist/analysis.d.ts +1 -2
  4. package/dist/analysis.js +1 -2
  5. package/dist/attribute-redacting-processor-Pk7lAzWd.d.cts +1 -2
  6. package/dist/attribute-redacting-processor-Pk7lAzWd.d.ts +1 -2
  7. package/dist/attribute-redacting-processor.cjs +1 -2
  8. package/dist/attribute-redacting-processor.js +1 -2
  9. package/dist/attributes-B7wix2VG.js +1 -2
  10. package/dist/attributes-aDmJYral.cjs +1 -2
  11. package/dist/auto.cjs +2 -3
  12. package/dist/auto.js +2 -3
  13. package/dist/business-baggage.cjs +1 -2
  14. package/dist/business-baggage.d.cts +1 -2
  15. package/dist/business-baggage.d.ts +1 -2
  16. package/dist/business-baggage.js +1 -2
  17. package/dist/canonical-log-line-processor-B4WgG-VS.d.cts +1 -2
  18. package/dist/canonical-log-line-processor-CL_J7gb5.d.ts +1 -2
  19. package/dist/canonical-log-line-processor-DOjb6Kxy.cjs +1 -2
  20. package/dist/canonical-log-line-processor-mKABvGP0.js +1 -2
  21. package/dist/config.cjs +9 -3
  22. package/dist/config.d.cts +1 -2
  23. package/dist/config.d.ts +1 -2
  24. package/dist/config.js +9 -3
  25. package/dist/correlated-events-Bzh5y-UB.js +1 -2
  26. package/dist/correlated-events-kSwLo3mi.cjs +1 -2
  27. package/dist/correlation-id.cjs +1 -1
  28. package/dist/correlation-id.d.cts +1 -2
  29. package/dist/correlation-id.d.ts +1 -2
  30. package/dist/correlation-id.js +1 -1
  31. package/dist/db.cjs +1 -2
  32. package/dist/db.d.cts +1 -2
  33. package/dist/db.d.ts +1 -2
  34. package/dist/db.js +1 -2
  35. package/dist/decorators.cjs +2 -3
  36. package/dist/decorators.d.cts +1 -2
  37. package/dist/decorators.d.ts +1 -2
  38. package/dist/decorators.js +2 -3
  39. package/dist/define-event-B2z1SBe7.d.ts +1 -2
  40. package/dist/define-event-CGG048HE.d.cts +1 -2
  41. package/dist/diagnostics.cjs +1 -2
  42. package/dist/diagnostics.d.cts +1 -2
  43. package/dist/diagnostics.d.ts +1 -2
  44. package/dist/diagnostics.js +1 -2
  45. package/dist/drain-pipeline.cjs +1 -2
  46. package/dist/drain-pipeline.d.cts +1 -2
  47. package/dist/drain-pipeline.d.ts +1 -2
  48. package/dist/drain-pipeline.js +1 -2
  49. package/dist/enrichers.cjs +1 -2
  50. package/dist/enrichers.d.cts +1 -2
  51. package/dist/enrichers.d.ts +1 -2
  52. package/dist/enrichers.js +1 -2
  53. package/dist/event-subscriber-CWh8sTGh.d.cts +1 -2
  54. package/dist/event-subscriber-CWh8sTGh.d.ts +1 -2
  55. package/dist/event-testing-CA2mIx1E.d.ts +1 -2
  56. package/dist/event-testing-D0qWfqAy.d.cts +1 -2
  57. package/dist/event-testing.cjs +1 -2
  58. package/dist/event-testing.js +1 -2
  59. package/dist/event.cjs +1 -1
  60. package/dist/event.d.cts +1 -2
  61. package/dist/event.d.ts +1 -2
  62. package/dist/event.js +1 -1
  63. package/dist/exporters.d.cts +1 -2
  64. package/dist/exporters.d.ts +1 -2
  65. package/dist/filtering-span-processor-BpDagWNa.d.cts +1 -2
  66. package/dist/filtering-span-processor-BpDagWNa.d.ts +1 -2
  67. package/dist/filtering-span-processor.cjs +1 -2
  68. package/dist/filtering-span-processor.js +1 -2
  69. package/dist/{functional-BnDUxnSl.js → functional-2AZsH_gQ.js} +2 -3
  70. package/dist/{functional-DcLBuCPz.cjs → functional-CogDARqC.cjs} +2 -3
  71. package/dist/functional.cjs +1 -1
  72. package/dist/functional.d.cts +1 -2
  73. package/dist/functional.d.ts +1 -2
  74. package/dist/functional.js +1 -1
  75. package/dist/http.cjs +2 -3
  76. package/dist/http.d.cts +1 -2
  77. package/dist/http.d.ts +1 -2
  78. package/dist/http.js +2 -3
  79. package/dist/index-BPcxVucm.d.cts +1 -2
  80. package/dist/index-DolOVX6F.d.ts +1 -2
  81. package/dist/index.cjs +3 -4
  82. package/dist/index.d.cts +2 -3
  83. package/dist/index.d.ts +2 -3
  84. package/dist/index.js +3 -4
  85. package/dist/{init-D6n2diBy.d.ts → init-BHp-kqLJ.d.ts} +12 -4
  86. package/dist/{init-XzXzrarP.d.cts → init-BoIYyB6Q.d.cts} +12 -4
  87. package/dist/{init-R-gSEXkJ.js → init-Bu6wR-k_.js} +56 -6
  88. package/dist/{init-C3RApHKJ.cjs → init-BzVuFs5a.cjs} +56 -6
  89. package/dist/instrumentation.cjs +2 -3
  90. package/dist/instrumentation.d.cts +1 -2
  91. package/dist/instrumentation.d.ts +1 -2
  92. package/dist/instrumentation.js +2 -3
  93. package/dist/logger-CN4xpzMd.d.cts +1 -2
  94. package/dist/logger-CN4xpzMd.d.ts +1 -2
  95. package/dist/logger-D3Ej3DII.js +1 -2
  96. package/dist/logger-thMPLpOG.cjs +1 -2
  97. package/dist/messaging-adapters.cjs +1 -2
  98. package/dist/messaging-adapters.d.cts +1 -2
  99. package/dist/messaging-adapters.d.ts +1 -2
  100. package/dist/messaging-adapters.js +1 -2
  101. package/dist/messaging-testing.cjs +1 -2
  102. package/dist/messaging-testing.d.cts +1 -2
  103. package/dist/messaging-testing.d.ts +1 -2
  104. package/dist/messaging-testing.js +1 -2
  105. package/dist/messaging.cjs +2 -3
  106. package/dist/messaging.d.cts +1 -2
  107. package/dist/messaging.d.ts +1 -2
  108. package/dist/messaging.js +2 -3
  109. package/dist/metric-helpers.cjs +1 -2
  110. package/dist/metric-helpers.d.cts +1 -2
  111. package/dist/metric-helpers.d.ts +1 -2
  112. package/dist/metric-helpers.js +1 -2
  113. package/dist/metric-testing-CWm6UhaR.d.ts +1 -2
  114. package/dist/metric-testing-CpvP3ZIa.d.cts +1 -2
  115. package/dist/metric-testing.cjs +1 -2
  116. package/dist/metric-testing.js +1 -2
  117. package/dist/metric.cjs +1 -2
  118. package/dist/metric.d.cts +1 -2
  119. package/dist/metric.d.ts +1 -2
  120. package/dist/metric.js +1 -2
  121. package/dist/node-require-PFqDihze.cjs +1 -2
  122. package/dist/node-require-vROmTeJ8.js +1 -2
  123. package/dist/parse-error.cjs +1 -2
  124. package/dist/parse-error.d.cts +1 -2
  125. package/dist/parse-error.d.ts +1 -2
  126. package/dist/parse-error.js +1 -2
  127. package/dist/pretty-console-exporter-CMzlrRNg.cjs +1 -2
  128. package/dist/pretty-console-exporter-DqKl_q9z.js +1 -2
  129. package/dist/register.cjs +1 -2
  130. package/dist/register.js +1 -2
  131. package/dist/registry-DVSmWg6Y.js +1 -2
  132. package/dist/registry-DYgvb62e.cjs +1 -2
  133. package/dist/sampling-BR9fkSwx.d.cts +1 -2
  134. package/dist/sampling-CP3e7-Yr.d.ts +1 -2
  135. package/dist/sampling.cjs +1 -2
  136. package/dist/sampling.js +1 -2
  137. package/dist/security-schema.cjs +1 -2
  138. package/dist/security-schema.d.cts +1 -2
  139. package/dist/security-schema.d.ts +1 -2
  140. package/dist/security-schema.js +1 -2
  141. package/dist/semantic-conventions-FhSxv-bK.d.cts +1 -2
  142. package/dist/semantic-conventions-FhSxv-bK.d.ts +1 -2
  143. package/dist/semantic-conventions.cjs +1 -2
  144. package/dist/semantic-conventions.js +1 -2
  145. package/dist/semantic-helpers.cjs +2 -3
  146. package/dist/semantic-helpers.d.cts +1 -2
  147. package/dist/semantic-helpers.d.ts +1 -2
  148. package/dist/semantic-helpers.js +2 -3
  149. package/dist/slo.cjs +1 -2
  150. package/dist/slo.d.cts +1 -2
  151. package/dist/slo.d.ts +1 -2
  152. package/dist/slo.js +1 -2
  153. package/dist/span-name-normalizer-CN1-8C76.d.cts +1 -2
  154. package/dist/span-name-normalizer-CN1-8C76.d.ts +1 -2
  155. package/dist/span-name-normalizer.cjs +1 -2
  156. package/dist/span-name-normalizer.js +1 -2
  157. package/dist/stable-hash-CS9BxvVQ.cjs +1 -2
  158. package/dist/stable-hash-ChFBIhNt.js +1 -2
  159. package/dist/structured-error-9--cxBay.js +1 -2
  160. package/dist/structured-error-CHg7DoIQ.cjs +1 -2
  161. package/dist/tail-sampling-processor.cjs +1 -2
  162. package/dist/tail-sampling-processor.d.cts +1 -2
  163. package/dist/tail-sampling-processor.d.ts +1 -2
  164. package/dist/tail-sampling-processor.js +1 -2
  165. package/dist/test-span-collector.cjs +1 -2
  166. package/dist/test-span-collector.d.cts +1 -2
  167. package/dist/test-span-collector.d.ts +1 -2
  168. package/dist/test-span-collector.js +1 -2
  169. package/dist/testing.cjs +1 -2
  170. package/dist/testing.d.cts +1 -2
  171. package/dist/testing.d.ts +1 -2
  172. package/dist/testing.js +1 -2
  173. package/dist/trace-context-IuyoPyNq.d.cts +1 -2
  174. package/dist/trace-context-IuyoPyNq.d.ts +1 -2
  175. package/dist/trace-factory-validation-BjVAinz6.js +1 -2
  176. package/dist/trace-factory-validation-Dc8epn87.cjs +1 -2
  177. package/dist/trace-helpers.cjs +1 -2
  178. package/dist/trace-helpers.d.cts +1 -2
  179. package/dist/trace-helpers.d.ts +1 -2
  180. package/dist/trace-helpers.js +1 -2
  181. package/dist/tracer-provider.cjs +1 -2
  182. package/dist/tracer-provider.d.cts +1 -2
  183. package/dist/tracer-provider.d.ts +1 -2
  184. package/dist/tracer-provider.js +1 -2
  185. package/dist/validate.cjs +1 -2
  186. package/dist/validate.d.cts +1 -2
  187. package/dist/validate.d.ts +1 -2
  188. package/dist/validate.js +1 -2
  189. package/dist/validation-attributes.cjs +1 -2
  190. package/dist/validation-attributes.d.cts +1 -2
  191. package/dist/validation-attributes.d.ts +1 -2
  192. package/dist/validation-attributes.js +1 -2
  193. package/dist/webhook.cjs +2 -3
  194. package/dist/webhook.d.cts +1 -2
  195. package/dist/webhook.d.ts +1 -2
  196. package/dist/webhook.js +2 -3
  197. package/dist/workflow-distributed.cjs +2 -3
  198. package/dist/workflow-distributed.d.cts +1 -2
  199. package/dist/workflow-distributed.d.ts +1 -2
  200. package/dist/workflow-distributed.js +2 -3
  201. package/dist/workflow.cjs +2 -3
  202. package/dist/workflow.d.cts +1 -2
  203. package/dist/workflow.d.ts +1 -2
  204. package/dist/workflow.js +2 -3
  205. package/dist/yaml-config.cjs +1 -2
  206. package/dist/yaml-config.d.cts +4 -5
  207. package/dist/yaml-config.d.ts +4 -5
  208. package/dist/yaml-config.js +1 -2
  209. package/package.json +47 -32
  210. package/dist/analysis.cjs.map +0 -1
  211. package/dist/analysis.d.cts.map +0 -1
  212. package/dist/analysis.d.ts.map +0 -1
  213. package/dist/analysis.js.map +0 -1
  214. package/dist/attribute-redacting-processor-Pk7lAzWd.d.cts.map +0 -1
  215. package/dist/attribute-redacting-processor-Pk7lAzWd.d.ts.map +0 -1
  216. package/dist/attribute-redacting-processor.cjs.map +0 -1
  217. package/dist/attribute-redacting-processor.js.map +0 -1
  218. package/dist/attributes-B7wix2VG.js.map +0 -1
  219. package/dist/attributes-aDmJYral.cjs.map +0 -1
  220. package/dist/auto.cjs.map +0 -1
  221. package/dist/auto.js.map +0 -1
  222. package/dist/business-baggage.cjs.map +0 -1
  223. package/dist/business-baggage.d.cts.map +0 -1
  224. package/dist/business-baggage.d.ts.map +0 -1
  225. package/dist/business-baggage.js.map +0 -1
  226. package/dist/canonical-log-line-processor-B4WgG-VS.d.cts.map +0 -1
  227. package/dist/canonical-log-line-processor-CL_J7gb5.d.ts.map +0 -1
  228. package/dist/canonical-log-line-processor-DOjb6Kxy.cjs.map +0 -1
  229. package/dist/canonical-log-line-processor-mKABvGP0.js.map +0 -1
  230. package/dist/config.cjs.map +0 -1
  231. package/dist/config.d.cts.map +0 -1
  232. package/dist/config.d.ts.map +0 -1
  233. package/dist/config.js.map +0 -1
  234. package/dist/correlated-events-Bzh5y-UB.js.map +0 -1
  235. package/dist/correlated-events-kSwLo3mi.cjs.map +0 -1
  236. package/dist/correlation-id.d.cts.map +0 -1
  237. package/dist/correlation-id.d.ts.map +0 -1
  238. package/dist/db.cjs.map +0 -1
  239. package/dist/db.d.cts.map +0 -1
  240. package/dist/db.d.ts.map +0 -1
  241. package/dist/db.js.map +0 -1
  242. package/dist/decorators.cjs.map +0 -1
  243. package/dist/decorators.d.cts.map +0 -1
  244. package/dist/decorators.d.ts.map +0 -1
  245. package/dist/decorators.js.map +0 -1
  246. package/dist/define-event-B2z1SBe7.d.ts.map +0 -1
  247. package/dist/define-event-CGG048HE.d.cts.map +0 -1
  248. package/dist/diagnostics.cjs.map +0 -1
  249. package/dist/diagnostics.d.cts.map +0 -1
  250. package/dist/diagnostics.d.ts.map +0 -1
  251. package/dist/diagnostics.js.map +0 -1
  252. package/dist/drain-pipeline.cjs.map +0 -1
  253. package/dist/drain-pipeline.d.cts.map +0 -1
  254. package/dist/drain-pipeline.d.ts.map +0 -1
  255. package/dist/drain-pipeline.js.map +0 -1
  256. package/dist/enrichers.cjs.map +0 -1
  257. package/dist/enrichers.d.cts.map +0 -1
  258. package/dist/enrichers.d.ts.map +0 -1
  259. package/dist/enrichers.js.map +0 -1
  260. package/dist/event-subscriber-CWh8sTGh.d.cts.map +0 -1
  261. package/dist/event-subscriber-CWh8sTGh.d.ts.map +0 -1
  262. package/dist/event-testing-CA2mIx1E.d.ts.map +0 -1
  263. package/dist/event-testing-D0qWfqAy.d.cts.map +0 -1
  264. package/dist/event-testing.cjs.map +0 -1
  265. package/dist/event-testing.js.map +0 -1
  266. package/dist/event.d.cts.map +0 -1
  267. package/dist/event.d.ts.map +0 -1
  268. package/dist/exporters.d.cts.map +0 -1
  269. package/dist/exporters.d.ts.map +0 -1
  270. package/dist/filtering-span-processor-BpDagWNa.d.cts.map +0 -1
  271. package/dist/filtering-span-processor-BpDagWNa.d.ts.map +0 -1
  272. package/dist/filtering-span-processor.cjs.map +0 -1
  273. package/dist/filtering-span-processor.js.map +0 -1
  274. package/dist/functional-BnDUxnSl.js.map +0 -1
  275. package/dist/functional-DcLBuCPz.cjs.map +0 -1
  276. package/dist/functional.d.cts.map +0 -1
  277. package/dist/functional.d.ts.map +0 -1
  278. package/dist/http.cjs.map +0 -1
  279. package/dist/http.d.cts.map +0 -1
  280. package/dist/http.d.ts.map +0 -1
  281. package/dist/http.js.map +0 -1
  282. package/dist/index-BPcxVucm.d.cts.map +0 -1
  283. package/dist/index-DolOVX6F.d.ts.map +0 -1
  284. package/dist/index.cjs.map +0 -1
  285. package/dist/index.d.cts.map +0 -1
  286. package/dist/index.d.ts.map +0 -1
  287. package/dist/index.js.map +0 -1
  288. package/dist/init-C3RApHKJ.cjs.map +0 -1
  289. package/dist/init-D6n2diBy.d.ts.map +0 -1
  290. package/dist/init-R-gSEXkJ.js.map +0 -1
  291. package/dist/init-XzXzrarP.d.cts.map +0 -1
  292. package/dist/instrumentation.cjs.map +0 -1
  293. package/dist/instrumentation.d.cts.map +0 -1
  294. package/dist/instrumentation.d.ts.map +0 -1
  295. package/dist/instrumentation.js.map +0 -1
  296. package/dist/logger-CN4xpzMd.d.cts.map +0 -1
  297. package/dist/logger-CN4xpzMd.d.ts.map +0 -1
  298. package/dist/logger-D3Ej3DII.js.map +0 -1
  299. package/dist/logger-thMPLpOG.cjs.map +0 -1
  300. package/dist/messaging-adapters.cjs.map +0 -1
  301. package/dist/messaging-adapters.d.cts.map +0 -1
  302. package/dist/messaging-adapters.d.ts.map +0 -1
  303. package/dist/messaging-adapters.js.map +0 -1
  304. package/dist/messaging-testing.cjs.map +0 -1
  305. package/dist/messaging-testing.d.cts.map +0 -1
  306. package/dist/messaging-testing.d.ts.map +0 -1
  307. package/dist/messaging-testing.js.map +0 -1
  308. package/dist/messaging.cjs.map +0 -1
  309. package/dist/messaging.d.cts.map +0 -1
  310. package/dist/messaging.d.ts.map +0 -1
  311. package/dist/messaging.js.map +0 -1
  312. package/dist/metric-helpers.cjs.map +0 -1
  313. package/dist/metric-helpers.d.cts.map +0 -1
  314. package/dist/metric-helpers.d.ts.map +0 -1
  315. package/dist/metric-helpers.js.map +0 -1
  316. package/dist/metric-testing-CWm6UhaR.d.ts.map +0 -1
  317. package/dist/metric-testing-CpvP3ZIa.d.cts.map +0 -1
  318. package/dist/metric-testing.cjs.map +0 -1
  319. package/dist/metric-testing.js.map +0 -1
  320. package/dist/metric.cjs.map +0 -1
  321. package/dist/metric.d.cts.map +0 -1
  322. package/dist/metric.d.ts.map +0 -1
  323. package/dist/metric.js.map +0 -1
  324. package/dist/node-require-PFqDihze.cjs.map +0 -1
  325. package/dist/node-require-vROmTeJ8.js.map +0 -1
  326. package/dist/parse-error.cjs.map +0 -1
  327. package/dist/parse-error.d.cts.map +0 -1
  328. package/dist/parse-error.d.ts.map +0 -1
  329. package/dist/parse-error.js.map +0 -1
  330. package/dist/pretty-console-exporter-CMzlrRNg.cjs.map +0 -1
  331. package/dist/pretty-console-exporter-DqKl_q9z.js.map +0 -1
  332. package/dist/register.cjs.map +0 -1
  333. package/dist/register.js.map +0 -1
  334. package/dist/registry-DVSmWg6Y.js.map +0 -1
  335. package/dist/registry-DYgvb62e.cjs.map +0 -1
  336. package/dist/sampling-BR9fkSwx.d.cts.map +0 -1
  337. package/dist/sampling-CP3e7-Yr.d.ts.map +0 -1
  338. package/dist/sampling.cjs.map +0 -1
  339. package/dist/sampling.js.map +0 -1
  340. package/dist/security-schema.cjs.map +0 -1
  341. package/dist/security-schema.d.cts.map +0 -1
  342. package/dist/security-schema.d.ts.map +0 -1
  343. package/dist/security-schema.js.map +0 -1
  344. package/dist/semantic-conventions-FhSxv-bK.d.cts.map +0 -1
  345. package/dist/semantic-conventions-FhSxv-bK.d.ts.map +0 -1
  346. package/dist/semantic-conventions.cjs.map +0 -1
  347. package/dist/semantic-conventions.js.map +0 -1
  348. package/dist/semantic-helpers.cjs.map +0 -1
  349. package/dist/semantic-helpers.d.cts.map +0 -1
  350. package/dist/semantic-helpers.d.ts.map +0 -1
  351. package/dist/semantic-helpers.js.map +0 -1
  352. package/dist/slo.cjs.map +0 -1
  353. package/dist/slo.d.cts.map +0 -1
  354. package/dist/slo.d.ts.map +0 -1
  355. package/dist/slo.js.map +0 -1
  356. package/dist/span-name-normalizer-CN1-8C76.d.cts.map +0 -1
  357. package/dist/span-name-normalizer-CN1-8C76.d.ts.map +0 -1
  358. package/dist/span-name-normalizer.cjs.map +0 -1
  359. package/dist/span-name-normalizer.js.map +0 -1
  360. package/dist/stable-hash-CS9BxvVQ.cjs.map +0 -1
  361. package/dist/stable-hash-ChFBIhNt.js.map +0 -1
  362. package/dist/structured-error-9--cxBay.js.map +0 -1
  363. package/dist/structured-error-CHg7DoIQ.cjs.map +0 -1
  364. package/dist/tail-sampling-processor.cjs.map +0 -1
  365. package/dist/tail-sampling-processor.d.cts.map +0 -1
  366. package/dist/tail-sampling-processor.d.ts.map +0 -1
  367. package/dist/tail-sampling-processor.js.map +0 -1
  368. package/dist/test-span-collector.cjs.map +0 -1
  369. package/dist/test-span-collector.d.cts.map +0 -1
  370. package/dist/test-span-collector.d.ts.map +0 -1
  371. package/dist/test-span-collector.js.map +0 -1
  372. package/dist/testing.cjs.map +0 -1
  373. package/dist/testing.d.cts.map +0 -1
  374. package/dist/testing.d.ts.map +0 -1
  375. package/dist/testing.js.map +0 -1
  376. package/dist/trace-context-IuyoPyNq.d.cts.map +0 -1
  377. package/dist/trace-context-IuyoPyNq.d.ts.map +0 -1
  378. package/dist/trace-factory-validation-BjVAinz6.js.map +0 -1
  379. package/dist/trace-factory-validation-Dc8epn87.cjs.map +0 -1
  380. package/dist/trace-helpers.cjs.map +0 -1
  381. package/dist/trace-helpers.d.cts.map +0 -1
  382. package/dist/trace-helpers.d.ts.map +0 -1
  383. package/dist/trace-helpers.js.map +0 -1
  384. package/dist/tracer-provider.cjs.map +0 -1
  385. package/dist/tracer-provider.d.cts.map +0 -1
  386. package/dist/tracer-provider.d.ts.map +0 -1
  387. package/dist/tracer-provider.js.map +0 -1
  388. package/dist/validate.cjs.map +0 -1
  389. package/dist/validate.d.cts.map +0 -1
  390. package/dist/validate.d.ts.map +0 -1
  391. package/dist/validate.js.map +0 -1
  392. package/dist/validation-attributes.cjs.map +0 -1
  393. package/dist/validation-attributes.d.cts.map +0 -1
  394. package/dist/validation-attributes.d.ts.map +0 -1
  395. package/dist/validation-attributes.js.map +0 -1
  396. package/dist/webhook.cjs.map +0 -1
  397. package/dist/webhook.d.cts.map +0 -1
  398. package/dist/webhook.d.ts.map +0 -1
  399. package/dist/webhook.js.map +0 -1
  400. package/dist/workflow-distributed.cjs.map +0 -1
  401. package/dist/workflow-distributed.d.cts.map +0 -1
  402. package/dist/workflow-distributed.d.ts.map +0 -1
  403. package/dist/workflow-distributed.js.map +0 -1
  404. package/dist/workflow.cjs.map +0 -1
  405. package/dist/workflow.d.cts.map +0 -1
  406. package/dist/workflow.d.ts.map +0 -1
  407. package/dist/workflow.js.map +0 -1
  408. package/dist/yaml-config.cjs.map +0 -1
  409. package/dist/yaml-config.d.cts.map +0 -1
  410. package/dist/yaml-config.d.ts.map +0 -1
  411. package/dist/yaml-config.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { h as SamplingPreset } from "./sampling-BR9fkSwx.cjs";
2
- import { n as OtlpSignal, t as AutotelConfig } from "./init-XzXzrarP.cjs";
2
+ import { n as OtlpSignal, t as AutotelConfig } from "./init-BoIYyB6Q.cjs";
3
3
  //#region src/yaml-config.d.ts
4
4
  /**
5
5
  * YAML config structure
@@ -13,11 +13,11 @@ interface YamlConfig {
13
13
  };
14
14
  exporter?: {
15
15
  endpoint?: string;
16
- protocol?: 'http' | 'grpc';
16
+ protocol?: 'http' | 'http/protobuf' | 'grpc';
17
17
  headers?: Record<string, string>;
18
18
  destinations?: Array<{
19
19
  endpoint: string;
20
- protocol?: 'http' | 'grpc';
20
+ protocol?: 'http' | 'http/protobuf' | 'grpc';
21
21
  headers?: Record<string, string>;
22
22
  signals?: OtlpSignal[];
23
23
  }>;
@@ -76,5 +76,4 @@ declare function loadYamlConfigFromFile(filePath: string): Partial<AutotelConfig
76
76
  */
77
77
  declare function hasYamlConfig(): boolean;
78
78
  //#endregion
79
- export { YamlConfig, hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
80
- //# sourceMappingURL=yaml-config.d.cts.map
79
+ export { YamlConfig, hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
@@ -1,5 +1,5 @@
1
1
  import { h as SamplingPreset } from "./sampling-CP3e7-Yr.js";
2
- import { n as OtlpSignal, t as AutotelConfig } from "./init-D6n2diBy.js";
2
+ import { n as OtlpSignal, t as AutotelConfig } from "./init-BHp-kqLJ.js";
3
3
  //#region src/yaml-config.d.ts
4
4
  /**
5
5
  * YAML config structure
@@ -13,11 +13,11 @@ interface YamlConfig {
13
13
  };
14
14
  exporter?: {
15
15
  endpoint?: string;
16
- protocol?: 'http' | 'grpc';
16
+ protocol?: 'http' | 'http/protobuf' | 'grpc';
17
17
  headers?: Record<string, string>;
18
18
  destinations?: Array<{
19
19
  endpoint: string;
20
- protocol?: 'http' | 'grpc';
20
+ protocol?: 'http' | 'http/protobuf' | 'grpc';
21
21
  headers?: Record<string, string>;
22
22
  signals?: OtlpSignal[];
23
23
  }>;
@@ -76,5 +76,4 @@ declare function loadYamlConfigFromFile(filePath: string): Partial<AutotelConfig
76
76
  */
77
77
  declare function hasYamlConfig(): boolean;
78
78
  //#endregion
79
- export { YamlConfig, hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
80
- //# sourceMappingURL=yaml-config.d.ts.map
79
+ export { YamlConfig, hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
@@ -225,5 +225,4 @@ function hasYamlConfig() {
225
225
  }
226
226
 
227
227
  //#endregion
228
- export { hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
229
- //# sourceMappingURL=yaml-config.js.map
228
+ export { hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel",
3
- "version": "6.1.0",
3
+ "version": "6.2.1",
4
4
  "description": "Write Once, Observe Anywhere",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -279,28 +279,31 @@
279
279
  "license": "Apache-2.0",
280
280
  "dependencies": {
281
281
  "@opentelemetry/api": "^1.9.1",
282
- "@opentelemetry/api-logs": "^0.220.0",
283
- "@opentelemetry/exporter-logs-otlp-http": "^0.220.0",
284
- "@opentelemetry/exporter-metrics-otlp-http": "^0.220.0",
285
- "@opentelemetry/exporter-trace-otlp-http": "^0.220.0",
286
- "@opentelemetry/instrumentation": "^0.220.0",
287
- "@opentelemetry/resources": "^2.9.0",
288
- "@opentelemetry/sdk-logs": "^0.220.0",
289
- "@opentelemetry/sdk-metrics": "^2.9.0",
290
- "@opentelemetry/sdk-node": "^0.220.0",
291
- "@opentelemetry/sdk-trace-base": "^2.9.0",
282
+ "@opentelemetry/api-logs": "^0.221.0",
283
+ "@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
284
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
285
+ "@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
286
+ "@opentelemetry/instrumentation": "^0.221.0",
287
+ "@opentelemetry/resources": "^2.10.0",
288
+ "@opentelemetry/sdk-logs": "^0.221.0",
289
+ "@opentelemetry/sdk-metrics": "^2.10.0",
290
+ "@opentelemetry/sdk-node": "^0.221.0",
291
+ "@opentelemetry/sdk-trace-base": "^2.10.0",
292
292
  "@opentelemetry/semantic-conventions": "^1.43.0",
293
293
  "import-in-the-middle": "^3.3.2"
294
294
  },
295
295
  "peerDependencies": {
296
- "@opentelemetry/auto-instrumentations-node": "^0.78.0",
297
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.220.0",
298
- "@opentelemetry/exporter-metrics-otlp-grpc": "^0.220.0",
299
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.220.0",
300
- "@opentelemetry/resource-detector-aws": "^2.20.0",
301
- "@opentelemetry/resource-detector-container": "^0.8.11",
302
- "@opentelemetry/resource-detector-gcp": "^0.55.0",
303
- "@opentelemetry/sdk-trace-node": "^2.9.0",
296
+ "@opentelemetry/auto-instrumentations-node": "^0.79.0",
297
+ "@opentelemetry/exporter-logs-otlp-grpc": "^0.221.0",
298
+ "@opentelemetry/exporter-logs-otlp-proto": "^0.221.0",
299
+ "@opentelemetry/exporter-metrics-otlp-grpc": "^0.221.0",
300
+ "@opentelemetry/exporter-metrics-otlp-proto": "^0.221.0",
301
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.221.0",
302
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.221.0",
303
+ "@opentelemetry/resource-detector-aws": "^2.21.0",
304
+ "@opentelemetry/resource-detector-container": "^0.8.12",
305
+ "@opentelemetry/resource-detector-gcp": "^0.56.0",
306
+ "@opentelemetry/sdk-trace-node": "^2.10.0",
304
307
  "@traceloop/node-server-sdk": "^0.27.0",
305
308
  "pino": "^10.3.1",
306
309
  "pino-pretty": "^13.1.3",
@@ -313,22 +316,31 @@
313
316
  "@opentelemetry/exporter-logs-otlp-grpc": {
314
317
  "optional": true
315
318
  },
319
+ "@opentelemetry/exporter-logs-otlp-proto": {
320
+ "optional": true
321
+ },
316
322
  "@opentelemetry/exporter-metrics-otlp-grpc": {
317
323
  "optional": true
318
324
  },
325
+ "@opentelemetry/exporter-metrics-otlp-proto": {
326
+ "optional": true
327
+ },
319
328
  "@opentelemetry/exporter-trace-otlp-grpc": {
320
329
  "optional": true
321
330
  },
322
- "@opentelemetry/sdk-trace-node": {
331
+ "@opentelemetry/exporter-trace-otlp-proto": {
323
332
  "optional": true
324
333
  },
325
334
  "@opentelemetry/resource-detector-aws": {
326
335
  "optional": true
327
336
  },
337
+ "@opentelemetry/resource-detector-container": {
338
+ "optional": true
339
+ },
328
340
  "@opentelemetry/resource-detector-gcp": {
329
341
  "optional": true
330
342
  },
331
- "@opentelemetry/resource-detector-container": {
343
+ "@opentelemetry/sdk-trace-node": {
332
344
  "optional": true
333
345
  },
334
346
  "@traceloop/node-server-sdk": {
@@ -347,20 +359,23 @@
347
359
  "devDependencies": {
348
360
  "@arethetypeswrong/cli": "^0.18.5",
349
361
  "@edge-runtime/vm": "^5.0.0",
350
- "@opentelemetry/auto-instrumentations-node": "^0.78.0",
351
- "@opentelemetry/context-async-hooks": "^2.9.0",
352
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.220.0",
353
- "@opentelemetry/exporter-metrics-otlp-grpc": "^0.220.0",
354
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.220.0",
355
- "@opentelemetry/resource-detector-aws": "^2.20.0",
356
- "@opentelemetry/resource-detector-container": "^0.8.11",
357
- "@opentelemetry/resource-detector-gcp": "^0.55.0",
358
- "@opentelemetry/sdk-trace-node": "^2.9.0",
362
+ "@opentelemetry/auto-instrumentations-node": "^0.79.0",
363
+ "@opentelemetry/context-async-hooks": "^2.10.0",
364
+ "@opentelemetry/exporter-logs-otlp-grpc": "^0.221.0",
365
+ "@opentelemetry/exporter-logs-otlp-proto": "^0.221.0",
366
+ "@opentelemetry/exporter-metrics-otlp-grpc": "^0.221.0",
367
+ "@opentelemetry/exporter-metrics-otlp-proto": "^0.221.0",
368
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.221.0",
369
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.221.0",
370
+ "@opentelemetry/resource-detector-aws": "^2.21.0",
371
+ "@opentelemetry/resource-detector-container": "^0.8.12",
372
+ "@opentelemetry/resource-detector-gcp": "^0.56.0",
373
+ "@opentelemetry/sdk-trace-node": "^2.10.0",
359
374
  "@swc/core": "^1.15.46",
360
375
  "@total-typescript/ts-reset": "^0.6.1",
361
376
  "@total-typescript/tsconfig": "^1.0.4",
362
377
  "@types/eslint-config-prettier": "^6.11.3",
363
- "@types/node": "^26.1.1",
378
+ "@types/node": "^26.1.2",
364
379
  "@typescript-eslint/eslint-plugin": "^8.65.0",
365
380
  "@typescript-eslint/parser": "^8.65.0",
366
381
  "eslint-config-prettier": "^10.1.8",
@@ -368,7 +383,7 @@
368
383
  "pino": "^10.3.1",
369
384
  "prettier": "^3.9.6",
370
385
  "rimraf": "^6.1.3",
371
- "tsdown": "^0.22.12",
386
+ "tsdown": "^0.22.14",
372
387
  "tsx": "^4.23.1",
373
388
  "typescript": "^6.0.3",
374
389
  "typescript-eslint": "^8.65.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"analysis.cjs","names":[],"sources":["../src/analysis.ts"],"sourcesContent":["/**\n * Core Analysis Loop\n *\n * Debugging from first principles: take the events you care about, take a\n * comparable normal population, and ask which recorded field separates them.\n * The loop is mechanical, so run it in code instead of clicking through a\n * dashboard.\n *\n * `compareCohorts()` scores every field/value pair by how much more often it\n * appears in the outlier group than in the baseline. The top result names the\n * cohort behind a regression, which is the hypothesis you then verify against\n * individual traces.\n *\n * The input is any array of flat records: wide events from\n * `getRequestLogger()`, `TestSpan.attributes` from `autotel/testing`, or rows\n * returned by a backend query.\n *\n * @example Find the cohort behind a latency regression\n * ```typescript\n * import { compareCohorts } from 'autotel/analysis'\n *\n * const slow = events.filter((event) => event['duration_ms'] >= 800)\n * const normal = events.filter((event) => event['duration_ms'] < 800)\n *\n * const [top] = compareCohorts({ outlier: slow, baseline: normal })\n * // { field: 'payment.provider', value: 'bank-beta', difference: 0.94, ... }\n * ```\n */\n\n/** A flat telemetry record. Span attributes and wide events both satisfy it. */\nexport type AnalysisEvent = Record<string, unknown>;\n\n/** How strongly one field/value pair separates the outlier group from the baseline. */\nexport interface CohortDifference {\n /** Attribute name, such as `payment.provider`. */\n field: string;\n /** The value, rendered as a string for display and grouping. */\n value: string;\n /** Share of outlier events carrying this value, 0-1. */\n outlierFraction: number;\n /** Share of baseline events carrying this value, 0-1. */\n baselineFraction: number;\n /** `outlierFraction - baselineFraction`. Positive means over-represented in the outliers. */\n difference: number;\n outlierCount: number;\n baselineCount: number;\n}\n\nexport interface CompareCohortsOptions {\n /** The events you are investigating: the errors, the slow requests, the failed checkouts. */\n outlier: readonly AnalysisEvent[];\n /** A comparable normal population from the same time range. */\n baseline: readonly AnalysisEvent[];\n /** Restrict the scan to these fields. Defaults to every field seen in either group. */\n fields?: readonly string[];\n /** Fields to skip, such as identifiers you already know are unique. */\n ignoreFields?: readonly string[];\n /**\n * Skip a field once it holds more distinct values than this across both\n * groups. Default 50.\n */\n maxValuesPerField?: number;\n /**\n * Skip a field whose distinct values outnumber this share of the combined\n * events. A request id or a raw duration takes a near-unique value per\n * event, so its values never repeat and it cannot describe a cohort. The\n * ratio catches those fields in small populations, where an absolute cap\n * does not. Bucket numeric fields at instrumentation time if you want them\n * ranked. Default 0.5.\n */\n maxUniqueRatio?: number;\n /** Drop pairs whose absolute difference falls below this. Default 0.1. */\n minDifference?: number;\n /** Maximum results to return, strongest first. Default 20. */\n limit?: number;\n}\n\nconst DEFAULT_MAX_VALUES_PER_FIELD = 50;\nconst DEFAULT_MAX_UNIQUE_RATIO = 0.5;\nconst DEFAULT_MIN_DIFFERENCE = 0.1;\nconst DEFAULT_LIMIT = 20;\n\n/**\n * Render a value as a grouping key.\n *\n * Objects and arrays return undefined: a nested structure does not name a\n * cohort, and stringifying it produces noise rather than a testable split.\n */\nfunction valueKey(value: unknown): string | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n const kind = typeof value;\n if (\n kind === 'string' ||\n kind === 'number' ||\n kind === 'boolean' ||\n kind === 'bigint'\n ) {\n return String(value);\n }\n return undefined;\n}\n\n/** Occurrences of one value, split by the group it appeared in. */\ninterface ValueCounts {\n outlier: number;\n baseline: number;\n}\n\n/** field -> value -> counts */\ntype FieldTally = Map<string, Map<string, ValueCounts>>;\n\n/**\n * Fold one group's events into the shared tally.\n *\n * Both groups accumulate into the same structure, so the caller never builds a\n * combined array or revisits an event once per candidate field.\n */\nfunction accumulate(\n tally: FieldTally,\n events: readonly AnalysisEvent[],\n group: keyof ValueCounts,\n includes: (field: string) => boolean,\n): void {\n for (const event of events) {\n for (const [field, raw] of Object.entries(event)) {\n if (!includes(field)) {\n continue;\n }\n const value = valueKey(raw);\n if (value === undefined) {\n continue;\n }\n let values = tally.get(field);\n if (values === undefined) {\n values = new Map<string, ValueCounts>();\n tally.set(field, values);\n }\n const counts = values.get(value) ?? { outlier: 0, baseline: 0 };\n counts[group]++;\n values.set(value, counts);\n }\n }\n}\n\n/**\n * Rank the field/value pairs that separate an outlier group from a baseline.\n *\n * Returns an empty array when either group is empty, because a fraction over\n * zero events carries no information.\n *\n * @param options - The two populations and the scan limits\n * @returns Differences sorted by absolute strength, strongest first\n */\nexport function compareCohorts(\n options: CompareCohortsOptions,\n): CohortDifference[] {\n const {\n outlier,\n baseline,\n fields,\n ignoreFields,\n maxValuesPerField = DEFAULT_MAX_VALUES_PER_FIELD,\n maxUniqueRatio = DEFAULT_MAX_UNIQUE_RATIO,\n minDifference = DEFAULT_MIN_DIFFERENCE,\n limit = DEFAULT_LIMIT,\n } = options;\n\n if (outlier.length === 0 || baseline.length === 0) {\n return [];\n }\n\n const ignored = new Set(ignoreFields);\n const selected = fields === undefined ? undefined : new Set(fields);\n const includes = (field: string) =>\n !ignored.has(field) && (selected === undefined || selected.has(field));\n\n const tally: FieldTally = new Map();\n accumulate(tally, outlier, 'outlier', includes);\n accumulate(tally, baseline, 'baseline', includes);\n\n const results: CohortDifference[] = [];\n const total = outlier.length + baseline.length;\n\n for (const [field, values] of tally) {\n if (\n values.size > maxValuesPerField ||\n values.size > total * maxUniqueRatio\n ) {\n continue;\n }\n\n for (const [value, counts] of values) {\n const outlierFraction = counts.outlier / outlier.length;\n const baselineFraction = counts.baseline / baseline.length;\n const difference = outlierFraction - baselineFraction;\n\n if (Math.abs(difference) < minDifference) {\n continue;\n }\n\n results.push({\n field,\n value,\n outlierFraction,\n baselineFraction,\n difference,\n outlierCount: counts.outlier,\n baselineCount: counts.baseline,\n });\n }\n }\n\n // Strongest first. On a tie prefer the over-represented value, because a\n // cohort you can open traces from beats one defined by its absence. Fall\n // back to field and value so repeated runs return the same order.\n results.sort(\n (a, b) =>\n Math.abs(b.difference) - Math.abs(a.difference) ||\n b.difference - a.difference ||\n a.field.localeCompare(b.field) ||\n a.value.localeCompare(b.value),\n );\n\n return results.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AU,YAAY,QAAQ;CAEhD,MAAM,UAA8B,CAAC;CACrC,MAAM,QAAQ,QAAQ,SAAS,SAAS;CAExC,KAAK,MAAM,CAAC,OAAO,WAAW,OAAO;EACnC,IACE,OAAO,OAAO,qBACd,OAAO,OAAO,QAAQ,gBAEtB;EAGF,KAAK,MAAM,CAAC,OAAO,WAAW,QAAQ;GACpC,MAAM,kBAAkB,OAAO,UAAU,QAAQ;GACjD,MAAM,mBAAmB,OAAO,WAAW,SAAS;GACpD,MAAM,aAAa,kBAAkB;GAErC,IAAI,KAAK,IAAI,UAAU,IAAI,eACzB;GAGF,QAAQ,KAAK;IACX;IACA;IACA;IACA;IACA;IACA,cAAc,OAAO;IACrB,eAAe,OAAO;GACxB,CAAC;EACH;CACF;CAKA,QAAQ,MACL,GAAG,MACF,KAAK,IAAI,EAAE,UAAU,IAAI,KAAK,IAAI,EAAE,UAAU,KAC9C,EAAE,aAAa,EAAE,cACjB,EAAE,MAAM,cAAc,EAAE,KAAK,KAC7B,EAAE,MAAM,cAAc,EAAE,KAAK,CACjC;CAEA,OAAO,QAAQ,MAAM,GAAG,KAAK;AAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"analysis.d.cts","names":[],"sources":["../src/analysis.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BY,gBAAgB;;UAGX;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;UAGe;;EAEf,kBAAkB;;EAElB,mBAAmB;;EAEnB;;EAEA;;;;;EAKA;;;;;;;;;EASA;;EAEA;;EAEA;;;;;;;;;;;iBAiFc,eACd,SAAS,wBACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"analysis.d.ts","names":[],"sources":["../src/analysis.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BY,gBAAgB;;UAGX;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;UAGe;;EAEf,kBAAkB;;EAElB,mBAAmB;;EAEnB;;EAEA;;;;;EAKA;;;;;;;;;EASA;;EAEA;;EAEA;;;;;;;;;;;iBAiFc,eACd,SAAS,wBACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"analysis.js","names":[],"sources":["../src/analysis.ts"],"sourcesContent":["/**\n * Core Analysis Loop\n *\n * Debugging from first principles: take the events you care about, take a\n * comparable normal population, and ask which recorded field separates them.\n * The loop is mechanical, so run it in code instead of clicking through a\n * dashboard.\n *\n * `compareCohorts()` scores every field/value pair by how much more often it\n * appears in the outlier group than in the baseline. The top result names the\n * cohort behind a regression, which is the hypothesis you then verify against\n * individual traces.\n *\n * The input is any array of flat records: wide events from\n * `getRequestLogger()`, `TestSpan.attributes` from `autotel/testing`, or rows\n * returned by a backend query.\n *\n * @example Find the cohort behind a latency regression\n * ```typescript\n * import { compareCohorts } from 'autotel/analysis'\n *\n * const slow = events.filter((event) => event['duration_ms'] >= 800)\n * const normal = events.filter((event) => event['duration_ms'] < 800)\n *\n * const [top] = compareCohorts({ outlier: slow, baseline: normal })\n * // { field: 'payment.provider', value: 'bank-beta', difference: 0.94, ... }\n * ```\n */\n\n/** A flat telemetry record. Span attributes and wide events both satisfy it. */\nexport type AnalysisEvent = Record<string, unknown>;\n\n/** How strongly one field/value pair separates the outlier group from the baseline. */\nexport interface CohortDifference {\n /** Attribute name, such as `payment.provider`. */\n field: string;\n /** The value, rendered as a string for display and grouping. */\n value: string;\n /** Share of outlier events carrying this value, 0-1. */\n outlierFraction: number;\n /** Share of baseline events carrying this value, 0-1. */\n baselineFraction: number;\n /** `outlierFraction - baselineFraction`. Positive means over-represented in the outliers. */\n difference: number;\n outlierCount: number;\n baselineCount: number;\n}\n\nexport interface CompareCohortsOptions {\n /** The events you are investigating: the errors, the slow requests, the failed checkouts. */\n outlier: readonly AnalysisEvent[];\n /** A comparable normal population from the same time range. */\n baseline: readonly AnalysisEvent[];\n /** Restrict the scan to these fields. Defaults to every field seen in either group. */\n fields?: readonly string[];\n /** Fields to skip, such as identifiers you already know are unique. */\n ignoreFields?: readonly string[];\n /**\n * Skip a field once it holds more distinct values than this across both\n * groups. Default 50.\n */\n maxValuesPerField?: number;\n /**\n * Skip a field whose distinct values outnumber this share of the combined\n * events. A request id or a raw duration takes a near-unique value per\n * event, so its values never repeat and it cannot describe a cohort. The\n * ratio catches those fields in small populations, where an absolute cap\n * does not. Bucket numeric fields at instrumentation time if you want them\n * ranked. Default 0.5.\n */\n maxUniqueRatio?: number;\n /** Drop pairs whose absolute difference falls below this. Default 0.1. */\n minDifference?: number;\n /** Maximum results to return, strongest first. Default 20. */\n limit?: number;\n}\n\nconst DEFAULT_MAX_VALUES_PER_FIELD = 50;\nconst DEFAULT_MAX_UNIQUE_RATIO = 0.5;\nconst DEFAULT_MIN_DIFFERENCE = 0.1;\nconst DEFAULT_LIMIT = 20;\n\n/**\n * Render a value as a grouping key.\n *\n * Objects and arrays return undefined: a nested structure does not name a\n * cohort, and stringifying it produces noise rather than a testable split.\n */\nfunction valueKey(value: unknown): string | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n const kind = typeof value;\n if (\n kind === 'string' ||\n kind === 'number' ||\n kind === 'boolean' ||\n kind === 'bigint'\n ) {\n return String(value);\n }\n return undefined;\n}\n\n/** Occurrences of one value, split by the group it appeared in. */\ninterface ValueCounts {\n outlier: number;\n baseline: number;\n}\n\n/** field -> value -> counts */\ntype FieldTally = Map<string, Map<string, ValueCounts>>;\n\n/**\n * Fold one group's events into the shared tally.\n *\n * Both groups accumulate into the same structure, so the caller never builds a\n * combined array or revisits an event once per candidate field.\n */\nfunction accumulate(\n tally: FieldTally,\n events: readonly AnalysisEvent[],\n group: keyof ValueCounts,\n includes: (field: string) => boolean,\n): void {\n for (const event of events) {\n for (const [field, raw] of Object.entries(event)) {\n if (!includes(field)) {\n continue;\n }\n const value = valueKey(raw);\n if (value === undefined) {\n continue;\n }\n let values = tally.get(field);\n if (values === undefined) {\n values = new Map<string, ValueCounts>();\n tally.set(field, values);\n }\n const counts = values.get(value) ?? { outlier: 0, baseline: 0 };\n counts[group]++;\n values.set(value, counts);\n }\n }\n}\n\n/**\n * Rank the field/value pairs that separate an outlier group from a baseline.\n *\n * Returns an empty array when either group is empty, because a fraction over\n * zero events carries no information.\n *\n * @param options - The two populations and the scan limits\n * @returns Differences sorted by absolute strength, strongest first\n */\nexport function compareCohorts(\n options: CompareCohortsOptions,\n): CohortDifference[] {\n const {\n outlier,\n baseline,\n fields,\n ignoreFields,\n maxValuesPerField = DEFAULT_MAX_VALUES_PER_FIELD,\n maxUniqueRatio = DEFAULT_MAX_UNIQUE_RATIO,\n minDifference = DEFAULT_MIN_DIFFERENCE,\n limit = DEFAULT_LIMIT,\n } = options;\n\n if (outlier.length === 0 || baseline.length === 0) {\n return [];\n }\n\n const ignored = new Set(ignoreFields);\n const selected = fields === undefined ? undefined : new Set(fields);\n const includes = (field: string) =>\n !ignored.has(field) && (selected === undefined || selected.has(field));\n\n const tally: FieldTally = new Map();\n accumulate(tally, outlier, 'outlier', includes);\n accumulate(tally, baseline, 'baseline', includes);\n\n const results: CohortDifference[] = [];\n const total = outlier.length + baseline.length;\n\n for (const [field, values] of tally) {\n if (\n values.size > maxValuesPerField ||\n values.size > total * maxUniqueRatio\n ) {\n continue;\n }\n\n for (const [value, counts] of values) {\n const outlierFraction = counts.outlier / outlier.length;\n const baselineFraction = counts.baseline / baseline.length;\n const difference = outlierFraction - baselineFraction;\n\n if (Math.abs(difference) < minDifference) {\n continue;\n }\n\n results.push({\n field,\n value,\n outlierFraction,\n baselineFraction,\n difference,\n outlierCount: counts.outlier,\n baselineCount: counts.baseline,\n });\n }\n }\n\n // Strongest first. On a tie prefer the over-represented value, because a\n // cohort you can open traces from beats one defined by its absence. Fall\n // back to field and value so repeated runs return the same order.\n results.sort(\n (a, b) =>\n Math.abs(b.difference) - Math.abs(a.difference) ||\n b.difference - a.difference ||\n a.field.localeCompare(b.field) ||\n a.value.localeCompare(b.value),\n );\n\n return results.slice(0, limit);\n}\n"],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A+Cc,iCACd,KAAK,0BAA0B,oCAC9B,0BAA0B;;;;;;;iBA4NpB,mBACP,MAAM,cACN,UAAU,sBACT;;;;;;;;;;;;;;iBAuCa,wBACd,QAAQ,0BAA0B,0BACjC;;;;;;;;;;;;;cAgBU,uCAAuC;mBACjC;mBACA;EAGf,YAAA,kBAAkB,eAClB,SAAS;;;;EAUX,QAAQ,MAAM,MAAM,eAAe;;;;EAOnC,MAAM,MAAM;EAWZ,cAAc;EAId,YAAY"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute-redacting-processor-Pk7lAzWd.d.ts","names":[],"sources":["../src/attribute-redacting-processor.ts"],"mappings":";;;;;;KAsCY,uBACV,aACA,OAAO,mBACJ;;;;KAKO;;;;KAKA,UAAU;;;;UAKL;;EAEf;;EAEA,SAAS;;EAET;;EAEA,OAAO;;;;;KAMG,kCAAkC;;;;UAK7B;;EAEf,cAAc;;EAGd,gBAAgB;;EAGhB;;EAGA,qBAAqB;;EAGrB,WAAW;;EAGX;;EAGA,WAAW;;;;;UAMI;EACf,UAAU,0BAA0B;;;;;cAMzB;;;;;;;;;;;;;;cAmBA;;;;aAIC,OAAA;;;;;aAKA,OAAA;;;;;aAWA,OAAA;;;;;;;;;;;;;;aAeA,OAAA;;;;;;;;;;;;;;;aA4BA,OAAA;;;;;;cAqDD,kBAAkB,OAC7B,yBACA;;;;;iBA+Cc,iCACd,KAAK,0BAA0B,oCAC9B,0BAA0B;;;;;;;iBA4NpB,mBACP,MAAM,cACN,UAAU,sBACT;;;;;;;;;;;;;;iBAuCa,wBACd,QAAQ,0BAA0B,0BACjC;;;;;;;;;;;;;cAgBU,uCAAuC;mBACjC;mBACA;EAGf,YAAA,kBAAkB,eAClB,SAAS;;;;EAUX,QAAQ,MAAM,MAAM,eAAe;;;;EAOnC,MAAM,MAAM;EAWZ,cAAc;EAId,YAAY"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute-redacting-processor.cjs","names":[],"sources":["../src/attribute-redacting-processor.ts"],"sourcesContent":["/**\n * Attribute Redacting Processor\n *\n * Automatically redacts PII and sensitive data from span attributes before export.\n * This is critical for compliance (GDPR, PCI-DSS, HIPAA) and data security.\n *\n * @example Basic usage with preset\n * ```typescript\n * init({\n * service: 'my-app',\n * attributeRedactor: 'default'\n * })\n * ```\n *\n * @example Custom patterns\n * ```typescript\n * init({\n * service: 'my-app',\n * attributeRedactor: {\n * keyPatterns: [/password/i, /secret/i],\n * valuePatterns: [\n * { name: 'customerId', pattern: /CUST-\\d{8}/g, replacement: 'CUST-***' }\n * ]\n * }\n * })\n * ```\n */\n\nimport type {\n SpanProcessor,\n ReadableSpan,\n} from '@opentelemetry/sdk-trace-base';\nimport type { Context, AttributeValue, Attributes } from '@opentelemetry/api';\nimport type { Span } from '@opentelemetry/sdk-trace-base';\n\n/**\n * Custom redactor function type\n */\nexport type AttributeRedactorFn = (\n key: string,\n value: AttributeValue,\n) => AttributeValue;\n\n/**\n * Built-in redactor preset names\n */\nexport type AttributeRedactorPreset = 'default' | 'strict' | 'pci-dss';\n\n/**\n * Masker function type - receives the matched string and returns a masked version\n */\nexport type MaskFn = (match: string) => string;\n\n/**\n * Value pattern configuration\n */\nexport interface ValuePatternConfig {\n /** Name for debugging/logging */\n name: string;\n /** Regex pattern to match in values */\n pattern: RegExp;\n /** Custom replacement (default: uses global replacement) */\n replacement?: string;\n /** Mask function for smart partial masking (overrides replacement) */\n mask?: MaskFn;\n}\n\n/**\n * Built-in PII pattern names\n */\nexport type BuiltinPatternName = keyof typeof builtinPatterns;\n\n/**\n * Attribute redactor configuration\n */\nexport interface AttributeRedactorConfig {\n /** Patterns to match against attribute keys (redacts entire value if key matches) */\n keyPatterns?: RegExp[];\n\n /** Patterns to match against attribute values (redacts matched portion) */\n valuePatterns?: ValuePatternConfig[];\n\n /** Dot-notation paths to redact (e.g. 'user.password', 'payment.card') */\n paths?: string[];\n\n /** Built-in PII patterns to enable. `true` enables all, `false` disables all, array selects specific ones. */\n builtins?: boolean | BuiltinPatternName[];\n\n /** Custom RegExp patterns for string-level redaction */\n patterns?: RegExp[];\n\n /** Default replacement string (default: '[REDACTED]') */\n replacement?: string;\n\n /** Custom redactor function for full control */\n redactor?: AttributeRedactorFn;\n}\n\n/**\n * Processor options\n */\nexport interface AttributeRedactingProcessorOptions {\n redactor: AttributeRedactorConfig | AttributeRedactorPreset;\n}\n\n/**\n * Built-in patterns for detecting sensitive data\n */\nexport const REDACTOR_PATTERNS = {\n // Value patterns (match content in attribute values)\n email: /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b/gi,\n phone: /\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b/g,\n ssn: /\\b\\d{3}[-]?\\d{2}[-]?\\d{4}\\b/g,\n creditCard: /\\b\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}\\b/g,\n bearerToken: /Bearer\\s+[A-Za-z0-9._~+/=-]+/gi,\n apiKeyInValue: /(?:api[_-]?key|apikey|api_secret)[=:][\\s\"']*[A-Za-z0-9_-]+/gi,\n jwt: /eyJ[A-Za-z0-9_-]*\\.eyJ[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*/g,\n\n // Key patterns (match attribute names - redacts entire value)\n sensitiveKey:\n /^(password|passwd|pwd|secret|token|api[_-]?key|auth|credential|private[_-]?key|authorization)$/i,\n} as const;\n\n/**\n * Built-in PII detection patterns with smart masking.\n * Each builtin preserves just enough signal for debugging while scrubbing PII.\n */\nexport const builtinPatterns = {\n /** Credit card numbers → ****1111 (PCI DSS: last 4 allowed) */\n creditCard: {\n pattern: /\\b\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}\\b/g,\n mask: (m: string) => `****${m.replaceAll(/[\\s-]/g, '').slice(-4)}`,\n },\n /** Email addresses → a***@***.com */\n email: {\n pattern: /[\\w.+-]+@[\\w-]+\\.[\\w.]+/g,\n mask: (m: string) => {\n const at = m.indexOf('@');\n if (at < 1) return '***@***';\n const tld = m.slice(m.lastIndexOf('.'));\n return `${m[0]}***@***${tld}`;\n },\n },\n /** IPv4 addresses → ***.***.***.100 (last octet only) */\n ipv4: {\n pattern:\n /\\b(?!0\\.0\\.0\\.0\\b)(?!127\\.0\\.0\\.1\\b)\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/g,\n mask: (m: string) => `***.***.***.${m.split('.').pop()}`,\n },\n /**\n * International / formatted phone numbers.\n *\n * Matches:\n * - `+33 1 23 45 67 89` -> `+33******89`\n * - `(415) 555-1234` -> `********34`\n * - `555-123-4567` / `555.123.4567` / `5551234567` -> `********67`\n *\n * Bare short digit runs like `12345678` are intentionally not matched.\n */\n phone: {\n pattern:\n /(?:\\+\\d{1,3}[\\s.-]?\\(?\\d{1,4}\\)?(?:[\\s.-]?\\d{2,4}){2,4}|\\(\\d{1,4}\\)(?:[\\s.-]?\\d{2,4}){2,4}|\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b)/g,\n mask: (m: string) => {\n const digits = m.replaceAll(/[^\\d]/g, '');\n const hasPlus = m.startsWith('+');\n if (hasPlus && digits.length > 4) {\n const ccMatch = m.match(/^\\+\\d{1,3}/);\n const cc = ccMatch ? ccMatch[0] : '+';\n return `${cc}******${digits.slice(-2)}`;\n }\n if (digits.length > 2) {\n return `${'*'.repeat(digits.length - 2)}${digits.slice(-2)}`;\n }\n return '***';\n },\n },\n /** JWT tokens → eyJ***.*** */\n jwt: {\n pattern: /\\beyJ[\\w-]*\\.[\\w-]*\\.[\\w-]*\\b/g,\n mask: () => 'eyJ***.***',\n },\n /** Bearer tokens → Bearer *** */\n bearer: {\n pattern: /\\bBearer\\s+[\\w\\-.~+/]{8,}=*/gi,\n mask: () => 'Bearer ***',\n },\n /** IBAN → FR76****189 (country + check digits + last 3) */\n iban: {\n pattern:\n /\\b[A-Z]{2}\\d{2}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{0,4}[\\s-]?[\\dA-Z]{0,4}[\\s-]?[\\dA-Z]{0,4}\\b/g,\n mask: (m: string) => {\n const clean = m.replaceAll(/[\\s-]/g, '');\n return `${clean.slice(0, 4)}****${clean.slice(-3)}`;\n },\n },\n} as const;\n\nfunction cloneRegex(re: RegExp): RegExp {\n return new RegExp(re.source, re.flags);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction toRegExp(value: unknown): RegExp | undefined {\n if (value instanceof RegExp) return value;\n if (typeof value === 'string') return new RegExp(value, 'g');\n if (isPlainObject(value) && typeof value.source === 'string') {\n const flags = typeof value.flags === 'string' ? value.flags : 'g';\n return new RegExp(value.source, flags);\n }\n return undefined;\n}\n\nfunction toRegExpArray(value: unknown): RegExp[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: RegExp[] = [];\n for (const item of value) {\n const re = toRegExp(item);\n if (re) out.push(re);\n }\n return out.length > 0 ? out : [];\n}\n\nfunction builtinToValuePattern(name: BuiltinPatternName): ValuePatternConfig {\n const b = builtinPatterns[name];\n return { name, pattern: cloneRegex(b.pattern), mask: b.mask };\n}\n\n/**\n * Default value patterns for the 'default' preset\n */\nconst DEFAULT_VALUE_PATTERNS: ValuePatternConfig[] = [\n builtinToValuePattern('email'),\n builtinToValuePattern('phone'),\n { name: 'ssn', pattern: REDACTOR_PATTERNS.ssn },\n builtinToValuePattern('creditCard'),\n];\n\n/**\n * Built-in redactor presets\n */\nexport const REDACTOR_PRESETS: Record<\n AttributeRedactorPreset,\n AttributeRedactorConfig\n> = {\n /**\n * Default preset - covers common PII patterns with smart masking\n * Detects: emails (a***@***.com), phone numbers, SSNs, credit cards (****1111)\n * Redacts keys: password, secret, token, apiKey, auth, credential\n */\n default: {\n keyPatterns: [REDACTOR_PATTERNS.sensitiveKey],\n valuePatterns: DEFAULT_VALUE_PATTERNS,\n builtins: true,\n replacement: '[REDACTED]',\n },\n\n /**\n * Strict preset - more aggressive redaction for high-security environments\n * Includes everything in default plus: Bearer tokens, JWTs, IBAN, API keys in values\n */\n strict: {\n keyPatterns: [REDACTOR_PATTERNS.sensitiveKey, /bearer/i, /jwt/i],\n valuePatterns: [\n ...DEFAULT_VALUE_PATTERNS,\n builtinToValuePattern('jwt'),\n builtinToValuePattern('bearer'),\n builtinToValuePattern('iban'),\n { name: 'apiKeyInValue', pattern: REDACTOR_PATTERNS.apiKeyInValue },\n ],\n builtins: true,\n replacement: '[REDACTED]',\n },\n\n /**\n * PCI-DSS preset - focused on payment card industry compliance\n * Redacts: credit card numbers (****1111), CVV-like patterns, card-related keys\n */\n 'pci-dss': {\n keyPatterns: [/card/i, /cvv/i, /cvc/i, /pan/i, /expir/i, /ccn/i],\n valuePatterns: [builtinToValuePattern('creditCard')],\n builtins: ['creditCard'],\n replacement: '[REDACTED]',\n },\n};\n\n/**\n * Normalize redactor config that may have been deserialized from JSON/YAML.\n * Converts regex-like values back to RegExp instances.\n */\nexport function normalizeAttributeRedactorConfig(\n raw: AttributeRedactorConfig | AttributeRedactorPreset | unknown,\n): AttributeRedactorConfig | AttributeRedactorPreset | undefined {\n if (raw === undefined || raw === null) return undefined;\n if (typeof raw === 'string') return raw as AttributeRedactorPreset;\n if (!isPlainObject(raw)) return undefined;\n\n const config: AttributeRedactorConfig = {};\n\n if (Array.isArray(raw.paths)) {\n config.paths = raw.paths.filter(\n (value): value is string => typeof value === 'string',\n );\n }\n\n if (typeof raw.replacement === 'string') {\n config.replacement = raw.replacement;\n }\n\n if (typeof raw.builtins === 'boolean') {\n config.builtins = raw.builtins;\n } else if (Array.isArray(raw.builtins)) {\n config.builtins = raw.builtins.filter(\n (name): name is BuiltinPatternName => typeof name === 'string',\n );\n }\n\n if (typeof raw.redactor === 'function') {\n config.redactor = raw.redactor as AttributeRedactorFn;\n }\n\n const keyPatterns = toRegExpArray(raw.keyPatterns);\n if (keyPatterns) config.keyPatterns = keyPatterns;\n\n const patterns = toRegExpArray(raw.patterns);\n if (patterns) config.patterns = patterns;\n\n if (Array.isArray(raw.valuePatterns)) {\n const valuePatterns: ValuePatternConfig[] = [];\n for (const item of raw.valuePatterns) {\n if (!isPlainObject(item) || typeof item.name !== 'string') continue;\n const pattern = toRegExp(item.pattern);\n if (!pattern) continue;\n valuePatterns.push({\n name: item.name,\n pattern,\n replacement:\n typeof item.replacement === 'string' ? item.replacement : undefined,\n mask:\n typeof item.mask === 'function' ? (item.mask as MaskFn) : undefined,\n });\n }\n config.valuePatterns = valuePatterns;\n }\n\n return config;\n}\n\n/**\n * Resolve config to a normalized form\n */\nfunction resolveConfig(\n config: AttributeRedactorConfig | AttributeRedactorPreset,\n): AttributeRedactorConfig {\n const normalized = normalizeAttributeRedactorConfig(config);\n if (!normalized) {\n throw new Error('Invalid attribute redactor config');\n }\n\n if (typeof normalized === 'string') {\n const preset = REDACTOR_PRESETS[normalized];\n if (!preset) {\n throw new Error(\n `Unknown attribute redactor preset: \"${normalized}\". ` +\n `Available presets: ${Object.keys(REDACTOR_PRESETS).join(', ')}`,\n );\n }\n return preset;\n }\n\n const resolvedConfig: AttributeRedactorConfig = {\n ...normalized,\n keyPatterns: normalized.keyPatterns\n ? [...normalized.keyPatterns]\n : undefined,\n valuePatterns: normalized.valuePatterns\n ? [...normalized.valuePatterns]\n : undefined,\n paths: normalized.paths ? [...normalized.paths] : undefined,\n patterns: normalized.patterns ? [...normalized.patterns] : undefined,\n };\n\n // Merge built-in patterns if enabled\n if (resolvedConfig.builtins !== false) {\n const builtinNames = Array.isArray(resolvedConfig.builtins)\n ? resolvedConfig.builtins\n : (Object.keys(builtinPatterns) as BuiltinPatternName[]);\n const builtinValuePatterns = builtinNames\n .filter((name) => name in builtinPatterns)\n .map((name) => builtinToValuePattern(name));\n\n resolvedConfig.valuePatterns = [\n ...(resolvedConfig.valuePatterns ?? []),\n ...builtinValuePatterns,\n ];\n }\n\n return resolvedConfig;\n}\n\n/**\n * Create a redactor function from config\n */\nfunction createRedactorFromConfig(\n config: AttributeRedactorConfig,\n): AttributeRedactorFn {\n // If custom redactor provided, use it directly\n if (config.redactor) {\n return config.redactor;\n }\n\n const keyPatterns = config.keyPatterns ?? [];\n const valuePatterns = config.valuePatterns ?? [];\n const paths = config.paths ?? [];\n const pathSet = new Set(paths);\n const customPatterns = config.patterns ?? [];\n const defaultReplacement = config.replacement ?? '[REDACTED]';\n\n // Build masker list from valuePatterns that have mask functions\n const maskers: [RegExp, MaskFn][] = valuePatterns\n .filter((vp) => vp.mask)\n .map((vp) => [cloneRegex(vp.pattern), vp.mask!]);\n\n return (key: string, value: AttributeValue): AttributeValue => {\n // Key-pattern and path-based redaction only applies to string values.\n // Numbers, booleans and other non-string attributes are not credentials;\n // replacing them with the string '[REDACTED]' silently changes their\n // type and corrupts downstream consumers (LLM token counters etc.).\n if (typeof value === 'string') {\n for (const pattern of keyPatterns) {\n pattern.lastIndex = 0;\n if (pattern.test(key)) {\n return defaultReplacement;\n }\n }\n if (pathSet.has(key)) {\n return defaultReplacement;\n }\n }\n\n // For non-string values, return as-is\n if (typeof value !== 'string') {\n if (Array.isArray(value)) {\n return value.map((item) => {\n if (typeof item === 'string') {\n return redactStringValue(\n item,\n valuePatterns,\n maskers,\n customPatterns,\n defaultReplacement,\n ) as string;\n }\n return item;\n }) as AttributeValue;\n }\n return value;\n }\n\n // Three-tier strategy: path-based → masker-based → pattern-based\n return redactStringValue(\n value,\n valuePatterns,\n maskers,\n customPatterns,\n defaultReplacement,\n );\n };\n}\n\n/**\n * Apply three-tier redaction strategy to a string\n * 1. Masker-based: built-in patterns with smart partial masking\n * 2. Pattern-based: custom RegExp patterns replaced with replacement\n */\nfunction redactStringValue(\n value: string,\n patterns: ValuePatternConfig[],\n maskers: [RegExp, MaskFn][],\n customPatterns: RegExp[],\n defaultReplacement: string,\n): string {\n let result = value;\n\n // Tier 1: Apply maskers (smart partial masking)\n for (const [pattern, mask] of maskers) {\n pattern.lastIndex = 0;\n result = result.replace(pattern, mask);\n }\n\n // Tier 2: Apply value patterns without mask (full replacement)\n for (const { pattern, replacement, mask } of patterns) {\n if (mask) continue; // Already handled by maskers\n pattern.lastIndex = 0;\n result = result.replaceAll(pattern, replacement ?? defaultReplacement);\n }\n\n // Tier 3: Apply custom patterns\n for (const pattern of customPatterns) {\n pattern.lastIndex = 0;\n result = result.replaceAll(pattern, defaultReplacement);\n }\n\n return result;\n}\n\n/**\n * Create a proxy wrapper around ReadableSpan with redacted attributes\n *\n * Since ReadableSpan.attributes is readonly, we use a Proxy to intercept\n * attribute access and return the redacted version.\n */\nfunction createRedactedSpan(\n span: ReadableSpan,\n redactor: AttributeRedactorFn,\n): ReadableSpan {\n // Pre-compute redacted attributes (cached for efficiency)\n const redactedAttributes: Attributes = {};\n for (const [key, value] of Object.entries(span.attributes)) {\n if (value !== undefined) {\n redactedAttributes[key] = redactor(key, value);\n }\n }\n\n // Return a proxy that intercepts attribute access\n return new Proxy(span, {\n get(target, prop) {\n if (prop === 'attributes') {\n return redactedAttributes;\n }\n // For all other properties, delegate to the original span\n const value = Reflect.get(target, prop);\n // Bind methods to the original target\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n });\n}\n\n/**\n * Create an attribute redactor function from a config or preset.\n *\n * This is useful when you need to apply the same redaction logic\n * outside of the span processor pipeline (e.g., for canonical log lines).\n *\n * @example\n * ```typescript\n * const redactor = createAttributeRedactor('default');\n * const redactedValue = redactor('user.password', 'secret123');\n * // redactedValue === '[REDACTED]'\n * ```\n */\nexport function createAttributeRedactor(\n config: AttributeRedactorConfig | AttributeRedactorPreset,\n): AttributeRedactorFn {\n return createRedactorFromConfig(resolveConfig(config));\n}\n\n/**\n * Span processor that redacts sensitive data from span attributes.\n *\n * Redaction happens in onEnd() when all attributes are finalized.\n * Uses a Proxy wrapper to intercept attribute access since ReadableSpan\n * attributes are readonly.\n *\n * Common use cases:\n * - PII compliance (GDPR, CCPA)\n * - PCI-DSS compliance for payment data\n * - Preventing secrets from leaking to observability backends\n */\nexport class AttributeRedactingProcessor implements SpanProcessor {\n private readonly wrappedProcessor: SpanProcessor;\n private readonly redactor: AttributeRedactorFn;\n\n constructor(\n wrappedProcessor: SpanProcessor,\n options: AttributeRedactingProcessorOptions,\n ) {\n this.wrappedProcessor = wrappedProcessor;\n const config = resolveConfig(options.redactor);\n this.redactor = createRedactorFromConfig(config);\n }\n\n /**\n * Pass through onStart unchanged - attributes aren't finalized yet\n */\n onStart(span: Span, parentContext: Context): void {\n this.wrappedProcessor.onStart(span, parentContext);\n }\n\n /**\n * Redact attributes and forward to wrapped processor\n */\n onEnd(span: ReadableSpan): void {\n try {\n const redactedSpan = createRedactedSpan(span, this.redactor);\n this.wrappedProcessor.onEnd(redactedSpan);\n } catch {\n // Fail-open: if redaction fails, forward original span\n // This ensures we don't lose telemetry due to redaction errors\n this.wrappedProcessor.onEnd(span);\n }\n }\n\n forceFlush(): Promise<void> {\n return this.wrappedProcessor.forceFlush();\n }\n\n shutdown(): Promise<void> {\n return this.wrappedProcessor.shutdown();\n }\n}\n\n/**\n * Export createRedactedSpan for advanced users who want to use it directly\n */\nexport { createRedactedSpan };\n"],"mappings":";;;;;;AA4GA,MAAa,oBAAoB;CAE/B,OAAO;CACP,OAAO;CACP,KAAK;CACL,YAAY;CACZ,aAAa;CACb,eAAe;CACf,KAAK;CAGL,cACE;AACJ;;;;;AAMA,MAAa,kBAAkB;;CAE7B,YAAY;EACV,SAAS;EACT,OAAO,MAAc,OAAO,EAAE,WAAW,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACjE;;CAEA,OAAO;EACL,SAAS;EACT,OAAO,MAAc;GAEnB,IADW,EAAE,QAAQ,GAChB,IAAI,GAAG,OAAO;GACnB,MAAM,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,CAAC;GACtC,OAAO,GAAG,EAAE,GAAG,SAAS;EAC1B;CACF;;CAEA,MAAM;EACJ,SACE;EACF,OAAO,MAAc,eAAe,EAAE,MAAM,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aAAa;CACnD;;;;CAKA,MAAM,MAA0B;EAC9B,IAAI;GACF,MAAM,eAAe,mBAAmB,MAAM,KAAK,QAAQ;GAC3D,KAAK,iBAAiB,MAAM,YAAY;EAC1C,QAAQ;GAGN,KAAK,iBAAiB,MAAM,IAAI;EAClC;CACF;CAEA,aAA4B;EAC1B,OAAO,KAAK,iBAAiB,WAAW;CAC1C;CAEA,WAA0B;EACxB,OAAO,KAAK,iBAAiB,SAAS;CACxC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute-redacting-processor.js","names":[],"sources":["../src/attribute-redacting-processor.ts"],"sourcesContent":["/**\n * Attribute Redacting Processor\n *\n * Automatically redacts PII and sensitive data from span attributes before export.\n * This is critical for compliance (GDPR, PCI-DSS, HIPAA) and data security.\n *\n * @example Basic usage with preset\n * ```typescript\n * init({\n * service: 'my-app',\n * attributeRedactor: 'default'\n * })\n * ```\n *\n * @example Custom patterns\n * ```typescript\n * init({\n * service: 'my-app',\n * attributeRedactor: {\n * keyPatterns: [/password/i, /secret/i],\n * valuePatterns: [\n * { name: 'customerId', pattern: /CUST-\\d{8}/g, replacement: 'CUST-***' }\n * ]\n * }\n * })\n * ```\n */\n\nimport type {\n SpanProcessor,\n ReadableSpan,\n} from '@opentelemetry/sdk-trace-base';\nimport type { Context, AttributeValue, Attributes } from '@opentelemetry/api';\nimport type { Span } from '@opentelemetry/sdk-trace-base';\n\n/**\n * Custom redactor function type\n */\nexport type AttributeRedactorFn = (\n key: string,\n value: AttributeValue,\n) => AttributeValue;\n\n/**\n * Built-in redactor preset names\n */\nexport type AttributeRedactorPreset = 'default' | 'strict' | 'pci-dss';\n\n/**\n * Masker function type - receives the matched string and returns a masked version\n */\nexport type MaskFn = (match: string) => string;\n\n/**\n * Value pattern configuration\n */\nexport interface ValuePatternConfig {\n /** Name for debugging/logging */\n name: string;\n /** Regex pattern to match in values */\n pattern: RegExp;\n /** Custom replacement (default: uses global replacement) */\n replacement?: string;\n /** Mask function for smart partial masking (overrides replacement) */\n mask?: MaskFn;\n}\n\n/**\n * Built-in PII pattern names\n */\nexport type BuiltinPatternName = keyof typeof builtinPatterns;\n\n/**\n * Attribute redactor configuration\n */\nexport interface AttributeRedactorConfig {\n /** Patterns to match against attribute keys (redacts entire value if key matches) */\n keyPatterns?: RegExp[];\n\n /** Patterns to match against attribute values (redacts matched portion) */\n valuePatterns?: ValuePatternConfig[];\n\n /** Dot-notation paths to redact (e.g. 'user.password', 'payment.card') */\n paths?: string[];\n\n /** Built-in PII patterns to enable. `true` enables all, `false` disables all, array selects specific ones. */\n builtins?: boolean | BuiltinPatternName[];\n\n /** Custom RegExp patterns for string-level redaction */\n patterns?: RegExp[];\n\n /** Default replacement string (default: '[REDACTED]') */\n replacement?: string;\n\n /** Custom redactor function for full control */\n redactor?: AttributeRedactorFn;\n}\n\n/**\n * Processor options\n */\nexport interface AttributeRedactingProcessorOptions {\n redactor: AttributeRedactorConfig | AttributeRedactorPreset;\n}\n\n/**\n * Built-in patterns for detecting sensitive data\n */\nexport const REDACTOR_PATTERNS = {\n // Value patterns (match content in attribute values)\n email: /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b/gi,\n phone: /\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b/g,\n ssn: /\\b\\d{3}[-]?\\d{2}[-]?\\d{4}\\b/g,\n creditCard: /\\b\\d{4}[- ]?\\d{4}[- ]?\\d{4}[- ]?\\d{4}\\b/g,\n bearerToken: /Bearer\\s+[A-Za-z0-9._~+/=-]+/gi,\n apiKeyInValue: /(?:api[_-]?key|apikey|api_secret)[=:][\\s\"']*[A-Za-z0-9_-]+/gi,\n jwt: /eyJ[A-Za-z0-9_-]*\\.eyJ[A-Za-z0-9_-]*\\.[A-Za-z0-9_-]*/g,\n\n // Key patterns (match attribute names - redacts entire value)\n sensitiveKey:\n /^(password|passwd|pwd|secret|token|api[_-]?key|auth|credential|private[_-]?key|authorization)$/i,\n} as const;\n\n/**\n * Built-in PII detection patterns with smart masking.\n * Each builtin preserves just enough signal for debugging while scrubbing PII.\n */\nexport const builtinPatterns = {\n /** Credit card numbers → ****1111 (PCI DSS: last 4 allowed) */\n creditCard: {\n pattern: /\\b\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}\\b/g,\n mask: (m: string) => `****${m.replaceAll(/[\\s-]/g, '').slice(-4)}`,\n },\n /** Email addresses → a***@***.com */\n email: {\n pattern: /[\\w.+-]+@[\\w-]+\\.[\\w.]+/g,\n mask: (m: string) => {\n const at = m.indexOf('@');\n if (at < 1) return '***@***';\n const tld = m.slice(m.lastIndexOf('.'));\n return `${m[0]}***@***${tld}`;\n },\n },\n /** IPv4 addresses → ***.***.***.100 (last octet only) */\n ipv4: {\n pattern:\n /\\b(?!0\\.0\\.0\\.0\\b)(?!127\\.0\\.0\\.1\\b)\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/g,\n mask: (m: string) => `***.***.***.${m.split('.').pop()}`,\n },\n /**\n * International / formatted phone numbers.\n *\n * Matches:\n * - `+33 1 23 45 67 89` -> `+33******89`\n * - `(415) 555-1234` -> `********34`\n * - `555-123-4567` / `555.123.4567` / `5551234567` -> `********67`\n *\n * Bare short digit runs like `12345678` are intentionally not matched.\n */\n phone: {\n pattern:\n /(?:\\+\\d{1,3}[\\s.-]?\\(?\\d{1,4}\\)?(?:[\\s.-]?\\d{2,4}){2,4}|\\(\\d{1,4}\\)(?:[\\s.-]?\\d{2,4}){2,4}|\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b)/g,\n mask: (m: string) => {\n const digits = m.replaceAll(/[^\\d]/g, '');\n const hasPlus = m.startsWith('+');\n if (hasPlus && digits.length > 4) {\n const ccMatch = m.match(/^\\+\\d{1,3}/);\n const cc = ccMatch ? ccMatch[0] : '+';\n return `${cc}******${digits.slice(-2)}`;\n }\n if (digits.length > 2) {\n return `${'*'.repeat(digits.length - 2)}${digits.slice(-2)}`;\n }\n return '***';\n },\n },\n /** JWT tokens → eyJ***.*** */\n jwt: {\n pattern: /\\beyJ[\\w-]*\\.[\\w-]*\\.[\\w-]*\\b/g,\n mask: () => 'eyJ***.***',\n },\n /** Bearer tokens → Bearer *** */\n bearer: {\n pattern: /\\bBearer\\s+[\\w\\-.~+/]{8,}=*/gi,\n mask: () => 'Bearer ***',\n },\n /** IBAN → FR76****189 (country + check digits + last 3) */\n iban: {\n pattern:\n /\\b[A-Z]{2}\\d{2}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{4}[\\s-]?[\\dA-Z]{0,4}[\\s-]?[\\dA-Z]{0,4}[\\s-]?[\\dA-Z]{0,4}\\b/g,\n mask: (m: string) => {\n const clean = m.replaceAll(/[\\s-]/g, '');\n return `${clean.slice(0, 4)}****${clean.slice(-3)}`;\n },\n },\n} as const;\n\nfunction cloneRegex(re: RegExp): RegExp {\n return new RegExp(re.source, re.flags);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction toRegExp(value: unknown): RegExp | undefined {\n if (value instanceof RegExp) return value;\n if (typeof value === 'string') return new RegExp(value, 'g');\n if (isPlainObject(value) && typeof value.source === 'string') {\n const flags = typeof value.flags === 'string' ? value.flags : 'g';\n return new RegExp(value.source, flags);\n }\n return undefined;\n}\n\nfunction toRegExpArray(value: unknown): RegExp[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: RegExp[] = [];\n for (const item of value) {\n const re = toRegExp(item);\n if (re) out.push(re);\n }\n return out.length > 0 ? out : [];\n}\n\nfunction builtinToValuePattern(name: BuiltinPatternName): ValuePatternConfig {\n const b = builtinPatterns[name];\n return { name, pattern: cloneRegex(b.pattern), mask: b.mask };\n}\n\n/**\n * Default value patterns for the 'default' preset\n */\nconst DEFAULT_VALUE_PATTERNS: ValuePatternConfig[] = [\n builtinToValuePattern('email'),\n builtinToValuePattern('phone'),\n { name: 'ssn', pattern: REDACTOR_PATTERNS.ssn },\n builtinToValuePattern('creditCard'),\n];\n\n/**\n * Built-in redactor presets\n */\nexport const REDACTOR_PRESETS: Record<\n AttributeRedactorPreset,\n AttributeRedactorConfig\n> = {\n /**\n * Default preset - covers common PII patterns with smart masking\n * Detects: emails (a***@***.com), phone numbers, SSNs, credit cards (****1111)\n * Redacts keys: password, secret, token, apiKey, auth, credential\n */\n default: {\n keyPatterns: [REDACTOR_PATTERNS.sensitiveKey],\n valuePatterns: DEFAULT_VALUE_PATTERNS,\n builtins: true,\n replacement: '[REDACTED]',\n },\n\n /**\n * Strict preset - more aggressive redaction for high-security environments\n * Includes everything in default plus: Bearer tokens, JWTs, IBAN, API keys in values\n */\n strict: {\n keyPatterns: [REDACTOR_PATTERNS.sensitiveKey, /bearer/i, /jwt/i],\n valuePatterns: [\n ...DEFAULT_VALUE_PATTERNS,\n builtinToValuePattern('jwt'),\n builtinToValuePattern('bearer'),\n builtinToValuePattern('iban'),\n { name: 'apiKeyInValue', pattern: REDACTOR_PATTERNS.apiKeyInValue },\n ],\n builtins: true,\n replacement: '[REDACTED]',\n },\n\n /**\n * PCI-DSS preset - focused on payment card industry compliance\n * Redacts: credit card numbers (****1111), CVV-like patterns, card-related keys\n */\n 'pci-dss': {\n keyPatterns: [/card/i, /cvv/i, /cvc/i, /pan/i, /expir/i, /ccn/i],\n valuePatterns: [builtinToValuePattern('creditCard')],\n builtins: ['creditCard'],\n replacement: '[REDACTED]',\n },\n};\n\n/**\n * Normalize redactor config that may have been deserialized from JSON/YAML.\n * Converts regex-like values back to RegExp instances.\n */\nexport function normalizeAttributeRedactorConfig(\n raw: AttributeRedactorConfig | AttributeRedactorPreset | unknown,\n): AttributeRedactorConfig | AttributeRedactorPreset | undefined {\n if (raw === undefined || raw === null) return undefined;\n if (typeof raw === 'string') return raw as AttributeRedactorPreset;\n if (!isPlainObject(raw)) return undefined;\n\n const config: AttributeRedactorConfig = {};\n\n if (Array.isArray(raw.paths)) {\n config.paths = raw.paths.filter(\n (value): value is string => typeof value === 'string',\n );\n }\n\n if (typeof raw.replacement === 'string') {\n config.replacement = raw.replacement;\n }\n\n if (typeof raw.builtins === 'boolean') {\n config.builtins = raw.builtins;\n } else if (Array.isArray(raw.builtins)) {\n config.builtins = raw.builtins.filter(\n (name): name is BuiltinPatternName => typeof name === 'string',\n );\n }\n\n if (typeof raw.redactor === 'function') {\n config.redactor = raw.redactor as AttributeRedactorFn;\n }\n\n const keyPatterns = toRegExpArray(raw.keyPatterns);\n if (keyPatterns) config.keyPatterns = keyPatterns;\n\n const patterns = toRegExpArray(raw.patterns);\n if (patterns) config.patterns = patterns;\n\n if (Array.isArray(raw.valuePatterns)) {\n const valuePatterns: ValuePatternConfig[] = [];\n for (const item of raw.valuePatterns) {\n if (!isPlainObject(item) || typeof item.name !== 'string') continue;\n const pattern = toRegExp(item.pattern);\n if (!pattern) continue;\n valuePatterns.push({\n name: item.name,\n pattern,\n replacement:\n typeof item.replacement === 'string' ? item.replacement : undefined,\n mask:\n typeof item.mask === 'function' ? (item.mask as MaskFn) : undefined,\n });\n }\n config.valuePatterns = valuePatterns;\n }\n\n return config;\n}\n\n/**\n * Resolve config to a normalized form\n */\nfunction resolveConfig(\n config: AttributeRedactorConfig | AttributeRedactorPreset,\n): AttributeRedactorConfig {\n const normalized = normalizeAttributeRedactorConfig(config);\n if (!normalized) {\n throw new Error('Invalid attribute redactor config');\n }\n\n if (typeof normalized === 'string') {\n const preset = REDACTOR_PRESETS[normalized];\n if (!preset) {\n throw new Error(\n `Unknown attribute redactor preset: \"${normalized}\". ` +\n `Available presets: ${Object.keys(REDACTOR_PRESETS).join(', ')}`,\n );\n }\n return preset;\n }\n\n const resolvedConfig: AttributeRedactorConfig = {\n ...normalized,\n keyPatterns: normalized.keyPatterns\n ? [...normalized.keyPatterns]\n : undefined,\n valuePatterns: normalized.valuePatterns\n ? [...normalized.valuePatterns]\n : undefined,\n paths: normalized.paths ? [...normalized.paths] : undefined,\n patterns: normalized.patterns ? [...normalized.patterns] : undefined,\n };\n\n // Merge built-in patterns if enabled\n if (resolvedConfig.builtins !== false) {\n const builtinNames = Array.isArray(resolvedConfig.builtins)\n ? resolvedConfig.builtins\n : (Object.keys(builtinPatterns) as BuiltinPatternName[]);\n const builtinValuePatterns = builtinNames\n .filter((name) => name in builtinPatterns)\n .map((name) => builtinToValuePattern(name));\n\n resolvedConfig.valuePatterns = [\n ...(resolvedConfig.valuePatterns ?? []),\n ...builtinValuePatterns,\n ];\n }\n\n return resolvedConfig;\n}\n\n/**\n * Create a redactor function from config\n */\nfunction createRedactorFromConfig(\n config: AttributeRedactorConfig,\n): AttributeRedactorFn {\n // If custom redactor provided, use it directly\n if (config.redactor) {\n return config.redactor;\n }\n\n const keyPatterns = config.keyPatterns ?? [];\n const valuePatterns = config.valuePatterns ?? [];\n const paths = config.paths ?? [];\n const pathSet = new Set(paths);\n const customPatterns = config.patterns ?? [];\n const defaultReplacement = config.replacement ?? '[REDACTED]';\n\n // Build masker list from valuePatterns that have mask functions\n const maskers: [RegExp, MaskFn][] = valuePatterns\n .filter((vp) => vp.mask)\n .map((vp) => [cloneRegex(vp.pattern), vp.mask!]);\n\n return (key: string, value: AttributeValue): AttributeValue => {\n // Key-pattern and path-based redaction only applies to string values.\n // Numbers, booleans and other non-string attributes are not credentials;\n // replacing them with the string '[REDACTED]' silently changes their\n // type and corrupts downstream consumers (LLM token counters etc.).\n if (typeof value === 'string') {\n for (const pattern of keyPatterns) {\n pattern.lastIndex = 0;\n if (pattern.test(key)) {\n return defaultReplacement;\n }\n }\n if (pathSet.has(key)) {\n return defaultReplacement;\n }\n }\n\n // For non-string values, return as-is\n if (typeof value !== 'string') {\n if (Array.isArray(value)) {\n return value.map((item) => {\n if (typeof item === 'string') {\n return redactStringValue(\n item,\n valuePatterns,\n maskers,\n customPatterns,\n defaultReplacement,\n ) as string;\n }\n return item;\n }) as AttributeValue;\n }\n return value;\n }\n\n // Three-tier strategy: path-based → masker-based → pattern-based\n return redactStringValue(\n value,\n valuePatterns,\n maskers,\n customPatterns,\n defaultReplacement,\n );\n };\n}\n\n/**\n * Apply three-tier redaction strategy to a string\n * 1. Masker-based: built-in patterns with smart partial masking\n * 2. Pattern-based: custom RegExp patterns replaced with replacement\n */\nfunction redactStringValue(\n value: string,\n patterns: ValuePatternConfig[],\n maskers: [RegExp, MaskFn][],\n customPatterns: RegExp[],\n defaultReplacement: string,\n): string {\n let result = value;\n\n // Tier 1: Apply maskers (smart partial masking)\n for (const [pattern, mask] of maskers) {\n pattern.lastIndex = 0;\n result = result.replace(pattern, mask);\n }\n\n // Tier 2: Apply value patterns without mask (full replacement)\n for (const { pattern, replacement, mask } of patterns) {\n if (mask) continue; // Already handled by maskers\n pattern.lastIndex = 0;\n result = result.replaceAll(pattern, replacement ?? defaultReplacement);\n }\n\n // Tier 3: Apply custom patterns\n for (const pattern of customPatterns) {\n pattern.lastIndex = 0;\n result = result.replaceAll(pattern, defaultReplacement);\n }\n\n return result;\n}\n\n/**\n * Create a proxy wrapper around ReadableSpan with redacted attributes\n *\n * Since ReadableSpan.attributes is readonly, we use a Proxy to intercept\n * attribute access and return the redacted version.\n */\nfunction createRedactedSpan(\n span: ReadableSpan,\n redactor: AttributeRedactorFn,\n): ReadableSpan {\n // Pre-compute redacted attributes (cached for efficiency)\n const redactedAttributes: Attributes = {};\n for (const [key, value] of Object.entries(span.attributes)) {\n if (value !== undefined) {\n redactedAttributes[key] = redactor(key, value);\n }\n }\n\n // Return a proxy that intercepts attribute access\n return new Proxy(span, {\n get(target, prop) {\n if (prop === 'attributes') {\n return redactedAttributes;\n }\n // For all other properties, delegate to the original span\n const value = Reflect.get(target, prop);\n // Bind methods to the original target\n if (typeof value === 'function') {\n return value.bind(target);\n }\n return value;\n },\n });\n}\n\n/**\n * Create an attribute redactor function from a config or preset.\n *\n * This is useful when you need to apply the same redaction logic\n * outside of the span processor pipeline (e.g., for canonical log lines).\n *\n * @example\n * ```typescript\n * const redactor = createAttributeRedactor('default');\n * const redactedValue = redactor('user.password', 'secret123');\n * // redactedValue === '[REDACTED]'\n * ```\n */\nexport function createAttributeRedactor(\n config: AttributeRedactorConfig | AttributeRedactorPreset,\n): AttributeRedactorFn {\n return createRedactorFromConfig(resolveConfig(config));\n}\n\n/**\n * Span processor that redacts sensitive data from span attributes.\n *\n * Redaction happens in onEnd() when all attributes are finalized.\n * Uses a Proxy wrapper to intercept attribute access since ReadableSpan\n * attributes are readonly.\n *\n * Common use cases:\n * - PII compliance (GDPR, CCPA)\n * - PCI-DSS compliance for payment data\n * - Preventing secrets from leaking to observability backends\n */\nexport class AttributeRedactingProcessor implements SpanProcessor {\n private readonly wrappedProcessor: SpanProcessor;\n private readonly redactor: AttributeRedactorFn;\n\n constructor(\n wrappedProcessor: SpanProcessor,\n options: AttributeRedactingProcessorOptions,\n ) {\n this.wrappedProcessor = wrappedProcessor;\n const config = resolveConfig(options.redactor);\n this.redactor = createRedactorFromConfig(config);\n }\n\n /**\n * Pass through onStart unchanged - attributes aren't finalized yet\n */\n onStart(span: Span, parentContext: Context): void {\n this.wrappedProcessor.onStart(span, parentContext);\n }\n\n /**\n * Redact attributes and forward to wrapped processor\n */\n onEnd(span: ReadableSpan): void {\n try {\n const redactedSpan = createRedactedSpan(span, this.redactor);\n this.wrappedProcessor.onEnd(redactedSpan);\n } catch {\n // Fail-open: if redaction fails, forward original span\n // This ensures we don't lose telemetry due to redaction errors\n this.wrappedProcessor.onEnd(span);\n }\n }\n\n forceFlush(): Promise<void> {\n return this.wrappedProcessor.forceFlush();\n }\n\n shutdown(): Promise<void> {\n return this.wrappedProcessor.shutdown();\n }\n}\n\n/**\n * Export createRedactedSpan for advanced users who want to use it directly\n */\nexport { createRedactedSpan };\n"],"mappings":";;;;AA4GA,MAAa,oBAAoB;CAE/B,OAAO;CACP,OAAO;CACP,KAAK;CACL,YAAY;CACZ,aAAa;CACb,eAAe;CACf,KAAK;CAGL,cACE;AACJ;;;;;AAM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EAE1B,OAAO;CACT,EACF,CAAC;AACH;;;;;;;;;;;;;;AAeA,SAAgB,wBACd,QACqB;CACrB,OAAO,yBAAyB,cAAc,MAAM,CAAC;AACvD;;;;;;;;;;;;;AAcA,IAAa,8BAAb,MAAkE;CAChE,AAAiB;CACjB,AAAiB;CAEjB,YACE,kBACA,SACA;EACA,KAAK,mBAAmB;EACxB,MAAM,SAAS,cAAc,QAAQ,QAAQ;EAC7C,KAAK,WAAW,yBAAyB,MAAM;CACjD;;;;CAKA,QAAQ,MAAY,eAA8B;EAChD,KAAK,iBAAiB,QAAQ,MAAM,aAAa;CACnD;;;;CAKA,MAAM,MAA0B;EAC9B,IAAI;GACF,MAAM,eAAe,mBAAmB,MAAM,KAAK,QAAQ;GAC3D,KAAK,iBAAiB,MAAM,YAAY;EAC1C,QAAQ;GAGN,KAAK,iBAAiB,MAAM,IAAI;EAClC;CACF;CAEA,aAA4B;EAC1B,OAAO,KAAK,iBAAiB,WAAW;CAC1C;CAEA,WAA0B;EACxB,OAAO,KAAK,iBAAiB,SAAS;CACxC;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes-B7wix2VG.js","names":[],"sources":["../src/attributes/builders.ts","../src/attributes/validators.ts","../src/attributes/utils.ts","../src/attributes/attachers.ts","../src/attributes/domains.ts"],"sourcesContent":["/**\n * Attribute builders for constructing OpenTelemetry attributes\n * Provides both key builders (Pattern A) and object builders (Pattern B)\n *\n * @example Pattern A: Key builders\n * ```typescript\n * attrs.user.id('123') // { 'user.id': '123' }\n * attrs.user.email('user@example.com') // { 'user.email': 'user@example.com' }\n * attrs.http.request.method('GET') // { 'http.request.method': 'GET' }\n * attrs.http.response.statusCode(200) // { 'http.response.status_code': 200 }\n * ```\n *\n * @example Pattern B: Object builders\n * ```typescript\n * attrs.user({ id: '123', email: 'user@example.com' })\n * attrs.http.server({ method: 'GET', route: '/users/:id', statusCode: 200 })\n * attrs.db.client({ system: 'postgresql', operation: 'SELECT', collectionName: 'users' })\n * ```\n */\n\nimport {\n UserAttributes,\n SessionAttributes,\n DeviceAttributes,\n HTTPAttributes,\n DBAttributes,\n ServiceAttributes,\n NetworkAttributes,\n ServerAddressAttributes,\n URLAttributes,\n ErrorAttributes,\n ExceptionAttributes,\n ProcessAttributes,\n ThreadAttributes,\n ContainerAttributes,\n K8sAttributes,\n CloudAttributes,\n FaaSAttributes,\n FeatureFlagAttributes,\n MessagingAttributes,\n RPCAttributes,\n GraphQLAttributes,\n OTelAttributes,\n CodeAttributes,\n TLSAttributes,\n} from './registry';\n\nimport type {\n UserAttrs,\n SessionAttrs,\n DeviceAttrs,\n HTTPServerAttrs,\n HTTPClientAttrs,\n DBAttrs,\n ServiceAttrs,\n NetworkAttrs,\n ErrorAttrs,\n MessagingAttrs,\n CloudAttrs,\n ServerAddressAttrs,\n URLAttrs,\n ProcessAttrs,\n ContainerAttrs,\n ExceptionAttrs,\n} from './types';\n\nexport const attrs = {\n user: {\n id: (value: string) => ({ [UserAttributes.id]: value }),\n email: (value: string) => ({ [UserAttributes.email]: value }),\n name: (value: string) => ({ [UserAttributes.name]: value }),\n fullName: (value: string) => ({ [UserAttributes.fullName]: value }),\n hash: (value: string) => ({ [UserAttributes.hash]: value }),\n roles: (value: string[]) => ({ [UserAttributes.roles]: value }),\n\n data: (data: UserAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[UserAttributes.id] = data.id;\n if (data.email !== undefined) result[UserAttributes.email] = data.email;\n if (data.name !== undefined) result[UserAttributes.name] = data.name;\n if (data.fullName !== undefined)\n result[UserAttributes.fullName] = data.fullName;\n if (data.hash !== undefined) result[UserAttributes.hash] = data.hash;\n if (data.roles !== undefined) result[UserAttributes.roles] = data.roles;\n return result;\n },\n },\n\n session: {\n id: (value: string) => ({ [SessionAttributes.id]: value }),\n previousId: (value: string) => ({ [SessionAttributes.previousId]: value }),\n\n data: (data: SessionAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[SessionAttributes.id] = data.id;\n if (data.previousId !== undefined)\n result[SessionAttributes.previousId] = data.previousId;\n return result;\n },\n },\n\n device: {\n id: (value: string) => ({ [DeviceAttributes.id]: value }),\n manufacturer: (value: string) => ({\n [DeviceAttributes.manufacturer]: value,\n }),\n modelIdentifier: (value: string) => ({\n [DeviceAttributes.modelIdentifier]: value,\n }),\n modelName: (value: string) => ({ [DeviceAttributes.modelName]: value }),\n\n data: (data: DeviceAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[DeviceAttributes.id] = data.id;\n if (data.manufacturer !== undefined)\n result[DeviceAttributes.manufacturer] = data.manufacturer;\n if (data.modelIdentifier !== undefined)\n result[DeviceAttributes.modelIdentifier] = data.modelIdentifier;\n if (data.modelName !== undefined)\n result[DeviceAttributes.modelName] = data.modelName;\n return result;\n },\n },\n\n http: {\n request: {\n method: (value: string) => ({ [HTTPAttributes.requestMethod]: value }),\n methodOriginal: (value: string) => ({\n [HTTPAttributes.requestMethodOriginal]: value,\n }),\n resendCount: (value: number) => ({\n [HTTPAttributes.requestResendCount]: value,\n }),\n size: (value: number) => ({ [HTTPAttributes.requestSize]: value }),\n bodySize: (value: number) => ({\n [HTTPAttributes.requestBodySize]: value,\n }),\n },\n\n response: {\n statusCode: (value: number) => ({\n [HTTPAttributes.responseStatusCode]: value,\n }),\n size: (value: number) => ({ [HTTPAttributes.responseSize]: value }),\n bodySize: (value: number) => ({\n [HTTPAttributes.responseBodySize]: value,\n }),\n },\n\n route: (value: string) => ({ [HTTPAttributes.route]: value }),\n connectionState: (value: string) => ({\n [HTTPAttributes.connectionState]: value,\n }),\n\n server: (data: HTTPServerAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.method !== undefined)\n result[HTTPAttributes.requestMethod] = data.method;\n if (data.route !== undefined) result[HTTPAttributes.route] = data.route;\n if (data.statusCode !== undefined)\n result[HTTPAttributes.responseStatusCode] = data.statusCode;\n if (data.bodySize !== undefined)\n result[HTTPAttributes.requestBodySize] = data.bodySize;\n if (data.requestSize !== undefined)\n result[HTTPAttributes.requestSize] = data.requestSize;\n if (data.responseSize !== undefined)\n result[HTTPAttributes.responseSize] = data.responseSize;\n if (data.resendCount !== undefined)\n result[HTTPAttributes.requestResendCount] = data.resendCount;\n return result;\n },\n\n client: (data: HTTPClientAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.method !== undefined)\n result[HTTPAttributes.requestMethod] = data.method;\n if (data.url !== undefined) result[HTTPAttributes.route] = data.url;\n if (data.statusCode !== undefined)\n result[HTTPAttributes.responseStatusCode] = data.statusCode;\n return result;\n },\n },\n\n db: {\n client: {\n system: (value: string) => ({ [DBAttributes.systemName]: value }),\n operation: (value: string) => ({ [DBAttributes.operationName]: value }),\n collectionName: (value: string) => ({\n [DBAttributes.collectionName]: value,\n }),\n namespace: (value: string) => ({ [DBAttributes.namespace]: value }),\n statement: (value: string) => ({ [DBAttributes.statement]: value }),\n querySummary: (value: string) => ({ [DBAttributes.querySummary]: value }),\n queryText: (value: string) => ({ [DBAttributes.queryText]: value }),\n responseStatus: (value: string | number) => ({\n [DBAttributes.responseStatusCode]: value,\n }),\n rowsReturned: (value: number) => ({\n [DBAttributes.responseReturnedRows]: value,\n }),\n\n data: (data: DBAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.system !== undefined)\n result[DBAttributes.systemName] = data.system;\n if (data.operation !== undefined)\n result[DBAttributes.operationName] = data.operation;\n if (data.collectionName !== undefined)\n result[DBAttributes.collectionName] = data.collectionName;\n // 'name' maps to db.namespace (db.name is deprecated per OTel semantic conventions)\n if (data.name !== undefined) result[DBAttributes.namespace] = data.name;\n // 'namespace' takes precedence over 'name' if both are provided\n if (data.namespace !== undefined)\n result[DBAttributes.namespace] = data.namespace;\n if (data.statement !== undefined)\n result[DBAttributes.statement] = data.statement;\n if (data.querySummary !== undefined)\n result[DBAttributes.querySummary] = data.querySummary;\n if (data.queryText !== undefined)\n result[DBAttributes.queryText] = data.queryText;\n if (data.responseStatus !== undefined)\n result[DBAttributes.responseStatusCode] = data.responseStatus;\n if (data.rowsReturned !== undefined)\n result[DBAttributes.responseReturnedRows] = data.rowsReturned;\n return result;\n },\n },\n },\n\n service: {\n name: (value: string) => ({ [ServiceAttributes.name]: value }),\n instance: (value: string) => ({ [ServiceAttributes.instance]: value }),\n version: (value: string) => ({ [ServiceAttributes.version]: value }),\n\n data: (data: ServiceAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.name !== undefined) result[ServiceAttributes.name] = data.name;\n if (data.instance !== undefined)\n result[ServiceAttributes.instance] = data.instance;\n if (data.version !== undefined)\n result[ServiceAttributes.version] = data.version;\n return result;\n },\n },\n\n network: {\n peerAddress: (value: string) => ({\n [NetworkAttributes.peerAddress]: value,\n }),\n peerPort: (value: number) => ({ [NetworkAttributes.peerPort]: value }),\n transport: (value: string) => ({ [NetworkAttributes.transport]: value }),\n protocolName: (value: string) => ({\n [NetworkAttributes.protocolName]: value,\n }),\n protocolVersion: (value: string) => ({\n [NetworkAttributes.protocolVersion]: value,\n }),\n\n data: (data: NetworkAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.peerAddress !== undefined)\n result[NetworkAttributes.peerAddress] = data.peerAddress;\n if (data.peerPort !== undefined)\n result[NetworkAttributes.peerPort] = data.peerPort;\n if (data.transport !== undefined)\n result[NetworkAttributes.transport] = data.transport;\n if (data.protocolName !== undefined)\n result[NetworkAttributes.protocolName] = data.protocolName;\n if (data.protocolVersion !== undefined)\n result[NetworkAttributes.protocolVersion] = data.protocolVersion;\n return result;\n },\n },\n\n server: {\n address: (value: string) => ({ [ServerAddressAttributes.address]: value }),\n port: (value: number) => ({ [ServerAddressAttributes.port]: value }),\n socketAddress: (value: string) => ({\n [ServerAddressAttributes.socketAddress]: value,\n }),\n\n data: (data: ServerAddressAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.address !== undefined)\n result[ServerAddressAttributes.address] = data.address;\n if (data.port !== undefined)\n result[ServerAddressAttributes.port] = data.port;\n if (data.socketAddress !== undefined)\n result[ServerAddressAttributes.socketAddress] = data.socketAddress;\n return result;\n },\n },\n\n url: {\n scheme: (value: string) => ({ [URLAttributes.scheme]: value }),\n full: (value: string) => ({ [URLAttributes.full]: value }),\n path: (value: string) => ({ [URLAttributes.path]: value }),\n query: (value: string) => ({ [URLAttributes.query]: value }),\n fragment: (value: string) => ({ [URLAttributes.fragment]: value }),\n\n data: (data: URLAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.scheme !== undefined) result[URLAttributes.scheme] = data.scheme;\n if (data.full !== undefined) result[URLAttributes.full] = data.full;\n if (data.path !== undefined) result[URLAttributes.path] = data.path;\n if (data.query !== undefined) result[URLAttributes.query] = data.query;\n if (data.fragment !== undefined)\n result[URLAttributes.fragment] = data.fragment;\n return result;\n },\n },\n\n error: {\n type: (value: string) => ({ [ErrorAttributes.type]: value }),\n message: (value: string) => ({ [ErrorAttributes.message]: value }),\n stackTrace: (value: string) => ({ [ErrorAttributes.stackTrace]: value }),\n code: (value: string | number) => ({ [ErrorAttributes.code]: value }),\n\n data: (data: ErrorAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.type !== undefined) result[ErrorAttributes.type] = data.type;\n if (data.message !== undefined)\n result[ErrorAttributes.message] = data.message;\n if (data.stackTrace !== undefined)\n result[ErrorAttributes.stackTrace] = data.stackTrace;\n if (data.code !== undefined) result[ErrorAttributes.code] = data.code;\n return result;\n },\n },\n\n exception: {\n escaped: (value: boolean) => ({ [ExceptionAttributes.escaped]: value }),\n message: (value: string) => ({ [ExceptionAttributes.message]: value }),\n stackTrace: (value: string) => ({\n [ExceptionAttributes.stackTrace]: value,\n }),\n type: (value: string) => ({ [ExceptionAttributes.type]: value }),\n moduleName: (value: string) => ({\n [ExceptionAttributes.moduleName]: value,\n }),\n\n data: (data: ExceptionAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.escaped !== undefined)\n result[ExceptionAttributes.escaped] = data.escaped;\n if (data.message !== undefined)\n result[ExceptionAttributes.message] = data.message;\n if (data.stackTrace !== undefined)\n result[ExceptionAttributes.stackTrace] = data.stackTrace;\n if (data.type !== undefined) result[ExceptionAttributes.type] = data.type;\n if (data.moduleName !== undefined)\n result[ExceptionAttributes.moduleName] = data.moduleName;\n return result;\n },\n },\n\n process: {\n pid: (value: number) => ({ [ProcessAttributes.pid]: value }),\n executablePath: (value: string) => ({\n [ProcessAttributes.executablePath]: value,\n }),\n command: (value: string) => ({ [ProcessAttributes.command]: value }),\n owner: (value: string) => ({ [ProcessAttributes.owner]: value }),\n\n data: (data: ProcessAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.pid !== undefined) result[ProcessAttributes.pid] = data.pid;\n if (data.executablePath !== undefined)\n result[ProcessAttributes.executablePath] = data.executablePath;\n if (data.command !== undefined)\n result[ProcessAttributes.command] = data.command;\n if (data.owner !== undefined)\n result[ProcessAttributes.owner] = data.owner;\n return result;\n },\n },\n\n thread: {\n id: (value: number) => ({ [ThreadAttributes.id]: value }),\n name: (value: string) => ({ [ThreadAttributes.name]: value }),\n },\n\n container: {\n id: (value: string) => ({ [ContainerAttributes.id]: value }),\n name: (value: string) => ({ [ContainerAttributes.name]: value }),\n image: (value: string) => ({ [ContainerAttributes.image]: value }),\n tag: (value: string) => ({ [ContainerAttributes.tag]: value }),\n\n data: (data: ContainerAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.id !== undefined) result[ContainerAttributes.id] = data.id;\n if (data.name !== undefined) result[ContainerAttributes.name] = data.name;\n if (data.image !== undefined)\n result[ContainerAttributes.image] = data.image;\n if (data.tag !== undefined) result[ContainerAttributes.tag] = data.tag;\n return result;\n },\n },\n\n k8s: {\n podName: (value: string) => ({ [K8sAttributes.podName]: value }),\n namespaceName: (value: string) => ({\n [K8sAttributes.namespaceName]: value,\n }),\n deploymentName: (value: string) => ({\n [K8sAttributes.deploymentName]: value,\n }),\n state: (value: string) => ({ [K8sAttributes.state]: value }),\n },\n\n cloud: {\n provider: (value: string) => ({ [CloudAttributes.provider]: value }),\n accountId: (value: string) => ({ [CloudAttributes.accountId]: value }),\n region: (value: string) => ({ [CloudAttributes.region]: value }),\n availabilityZone: (value: string) => ({\n [CloudAttributes.availabilityZone]: value,\n }),\n platform: (value: string) => ({ [CloudAttributes.platform]: value }),\n\n data: (data: CloudAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.provider !== undefined)\n result[CloudAttributes.provider] = data.provider;\n if (data.accountId !== undefined)\n result[CloudAttributes.accountId] = data.accountId;\n if (data.region !== undefined)\n result[CloudAttributes.region] = data.region;\n if (data.availabilityZone !== undefined)\n result[CloudAttributes.availabilityZone] = data.availabilityZone;\n if (data.platform !== undefined)\n result[CloudAttributes.platform] = data.platform;\n return result;\n },\n },\n\n faas: {\n name: (value: string) => ({ [FaaSAttributes.name]: value }),\n version: (value: string) => ({ [FaaSAttributes.version]: value }),\n instance: (value: string) => ({ [FaaSAttributes.instance]: value }),\n execution: (value: string) => ({ [FaaSAttributes.execution]: value }),\n coldstart: (value: boolean) => ({ [FaaSAttributes.coldstart]: value }),\n },\n\n featureFlag: {\n key: (value: string) => ({ [FeatureFlagAttributes.key]: value }),\n provider: (value: string) => ({ [FeatureFlagAttributes.provider]: value }),\n variant: (value: string) => ({ [FeatureFlagAttributes.variant]: value }),\n },\n\n messaging: {\n system: (value: string) => ({ [MessagingAttributes.system]: value }),\n destination: (value: string) => ({\n [MessagingAttributes.destination]: value,\n }),\n operation: (value: 'publish' | 'receive' | 'process') => ({\n [MessagingAttributes.operation]: value,\n }),\n messageId: (value: string) => ({ [MessagingAttributes.messageId]: value }),\n conversationId: (value: string) => ({\n [MessagingAttributes.conversationId]: value,\n }),\n\n data: (data: MessagingAttrs) => {\n const result: Record<string, unknown> = {};\n if (data.system !== undefined)\n result[MessagingAttributes.system] = data.system;\n if (data.destination !== undefined)\n result[MessagingAttributes.destination] = data.destination;\n if (data.operation !== undefined)\n result[MessagingAttributes.operation] = data.operation;\n if (data.messageId !== undefined)\n result[MessagingAttributes.messageId] = data.messageId;\n if (data.conversationId !== undefined)\n result[MessagingAttributes.conversationId] = data.conversationId;\n return result;\n },\n },\n\n // GenAI/LLM attribute builders moved to the `autotel-genai` package\n // (canonical `gen_ai.*` semantic conventions).\n\n rpc: {\n system: (value: string) => ({ [RPCAttributes.system]: value }),\n service: (value: string) => ({ [RPCAttributes.service]: value }),\n method: (value: string) => ({ [RPCAttributes.method]: value }),\n grpcStatusCode: (value: number) => ({\n [RPCAttributes.grpcStatusCode]: value,\n }),\n },\n\n graphql: {\n document: (value: string) => ({ [GraphQLAttributes.document]: value }),\n operationName: (value: string) => ({\n [GraphQLAttributes.operationName]: value,\n }),\n operationType: (value: 'query' | 'mutation' | 'subscription') => ({\n [GraphQLAttributes.operationType]: value,\n }),\n },\n\n otel: {\n libraryName: (value: string) => ({ [OTelAttributes.libraryName]: value }),\n libraryVersion: (value: string) => ({\n [OTelAttributes.libraryVersion]: value,\n }),\n statusCode: (value: string) => ({ [OTelAttributes.statusCode]: value }),\n },\n\n code: {\n namespace: (value: string) => ({ [CodeAttributes.namespace]: value }),\n filepath: (value: string) => ({ [CodeAttributes.filepath]: value }),\n function: (value: string) => ({ [CodeAttributes.function]: value }),\n class: (value: string) => ({ [CodeAttributes.class]: value }),\n method: (value: string) => ({ [CodeAttributes.method]: value }),\n column: (value: string) => ({ [CodeAttributes.column]: value }),\n lineNumber: (value: number) => ({ [CodeAttributes.lineNumber]: value }),\n repository: (value: string) => ({ [CodeAttributes.repository]: value }),\n revision: (value: string) => ({ [CodeAttributes.revision]: value }),\n },\n\n tls: {\n protocolVersion: (value: string) => ({\n [TLSAttributes.protocolVersion]: value,\n }),\n cipher: (value: string) => ({ [TLSAttributes.cipher]: value }),\n curveName: (value: string) => ({ [TLSAttributes.curveName]: value }),\n resumed: (value: boolean) => ({ [TLSAttributes.resumed]: value }),\n },\n} as const;\n","/**\n * Attribute validation, PII detection, and guardrails\n * Provides safe-by-default attribute handling with configurable policies\n */\n\nimport { REDACTOR_PATTERNS } from '../attribute-redacting-processor';\n\nexport interface AttributeGuardrails {\n /** How to handle PII in attributes */\n pii?: 'allow' | 'redact' | 'hash' | 'block';\n\n /** Maximum length for attribute values */\n maxLength?: number;\n\n /** Validate enum values against known values */\n validateEnum?: boolean;\n\n /** Log warnings for deprecated attributes instead of throwing */\n warnDeprecated?: boolean;\n\n /** Custom deprecation warnings */\n deprecatedWarnings?: Record<string, string>;\n}\n\nexport interface AttributePolicy {\n guardrails?: AttributeGuardrails;\n /** Custom deprecation warnings for specific attributes */\n deprecatedWarnings?: Record<string, string>;\n}\n\nconst DEPRECATED_ATTRIBUTES = {\n 'enduser.id': 'user.id',\n 'enduser.role': 'user.roles',\n 'enduser.scope': undefined,\n 'http.method': 'http.request.method',\n 'http.host': 'server.address',\n 'http.status_code': 'http.response.status_code',\n 'http.target': 'url.path',\n 'http.url': 'url.full',\n 'http.user_agent': 'user_agent.original',\n 'http.flavor': 'network.protocol.name',\n 'http.scheme': 'url.scheme',\n 'http.server_name': 'server.address',\n 'db.name': 'db.namespace',\n 'db.operation': 'db.operation.name',\n 'db.statement': 'db.query.text',\n 'db.system': 'db.system.name',\n 'db.collection': 'db.collection.name',\n 'db.instance.id': undefined,\n 'db.jdbc.driver_classname': undefined,\n 'db.mssql.instance_name': 'mssql.instance.name',\n 'db.sql.table': 'db.collection.name',\n 'http.client_ip': 'client.address',\n 'user_agent.original': 'user_agent.original',\n} as const;\n\nconst HTTP_METHODS = new Set([\n 'GET',\n 'POST',\n 'PUT',\n 'DELETE',\n 'PATCH',\n 'HEAD',\n 'OPTIONS',\n 'TRACE',\n 'QUERY',\n '_OTHER',\n]);\n\nexport function validateAttribute(\n key: string,\n value: unknown,\n policy: AttributePolicy = {},\n): unknown {\n const { guardrails = {} } = policy;\n\n if (value === undefined || value === null) {\n return undefined;\n }\n\n // For non-string values that don't need transformation, preserve the original type\n if (typeof value !== 'string') {\n // PII checks only apply to strings\n // maxLength only applies to strings\n // validateEnum only applies to strings\n return value;\n }\n\n const stringValue = value;\n\n if (guardrails.pii) {\n const piiResult = applyPIIPolicy(key, stringValue, guardrails.pii);\n if (piiResult !== stringValue) {\n return piiResult;\n }\n }\n\n if (guardrails.maxLength && stringValue.length > guardrails.maxLength) {\n return truncateValue(key, stringValue, guardrails.maxLength);\n }\n\n if (guardrails.validateEnum && HTTP_METHODS.has(stringValue)) {\n const normalizedMethod = normalizeHTTPMethod(stringValue);\n if (normalizedMethod !== stringValue) {\n return normalizedMethod;\n }\n }\n\n return stringValue;\n}\n\nfunction applyPIIPolicy(\n key: string,\n value: string,\n pii: AttributeGuardrails['pii'],\n): string {\n if (pii === 'allow') {\n return value;\n }\n\n if (pii === 'redact') {\n return redactIfPII(key, value);\n }\n\n if (pii === 'hash') {\n return hashIfPII(key, value);\n }\n\n if (pii === 'block' && isPIIKey(key)) {\n throw new Error(\n `PII attribute \"${key}\" is blocked by guardrails. Use pii: \"allow\" to enable it.`,\n );\n }\n\n return value;\n}\n\nfunction isPIIKey(key: string): boolean {\n const piiKeyPatterns = [\n 'email',\n 'phone',\n 'ssn',\n 'credit_card',\n 'password',\n 'secret',\n 'token',\n 'api_key',\n 'authorization',\n ];\n const lowerKey = key.toLowerCase();\n return piiKeyPatterns.some((pattern) => lowerKey.includes(pattern));\n}\n\nfunction redactIfPII(key: string, value: string): string {\n if (isPIIKey(key)) {\n // REDACTOR_PATTERNS values are RegExp patterns\n for (const [, pattern] of Object.entries(REDACTOR_PATTERNS)) {\n if (pattern instanceof RegExp && pattern.test(value)) {\n return '[REDACTED]';\n }\n }\n // If no pattern matched but key is PII, still redact\n return '[REDACTED]';\n }\n return value;\n}\n\nfunction hashIfPII(key: string, value: string): string {\n if (!isPIIKey(key)) {\n return value;\n }\n\n // Use a simple but consistent hash that produces 32-char hex\n // FNV-1a hash variant producing 128-bit output (32 hex chars)\n const FNV_PRIME = 0x01_00_01_93;\n const FNV_OFFSET = 0x81_1c_9d_c5;\n\n // Generate 4 32-bit hashes to produce 32 hex chars\n const hashes: number[] = [];\n for (let round = 0; round < 4; round++) {\n let hash = FNV_OFFSET;\n for (let i = 0; i < value.length; i++) {\n hash ^= (value.codePointAt(i) ?? 0) + round;\n hash = Math.imul(hash, FNV_PRIME);\n }\n hashes.push(hash >>> 0); // Convert to unsigned\n }\n\n return `hash_${hashes.map((h) => h.toString(16).padStart(8, '0')).join('')}`;\n}\n\nfunction truncateValue(key: string, value: string, maxLength: number): string {\n if (value.length <= maxLength) {\n return value;\n }\n return value.slice(0, maxLength - 3) + '...';\n}\n\nfunction normalizeHTTPMethod(method: string): string {\n const upper = method.toUpperCase();\n if (HTTP_METHODS.has(upper)) {\n return upper;\n }\n return upper;\n}\n\nexport function checkDeprecatedAttribute(\n key: string,\n policy: AttributePolicy = {},\n): string | null {\n const { guardrails = {}, deprecatedWarnings = {} } = policy;\n const { warnDeprecated = true } = guardrails;\n\n if (!warnDeprecated) {\n return null;\n }\n\n // Check if the key exists in the deprecated attributes map\n const isDeprecated = key in DEPRECATED_ATTRIBUTES;\n if (isDeprecated) {\n const replacement =\n DEPRECATED_ATTRIBUTES[key as keyof typeof DEPRECATED_ATTRIBUTES];\n if (replacement === undefined) {\n // Deprecated with no replacement (e.g., enduser.scope)\n console.warn(\n `[autotel/attributes] Attribute \"${key}\" is deprecated and has no replacement. ` +\n `Remove or find a replacement in OpenTelemetry semantic conventions.`,\n );\n } else {\n // Deprecated with a known replacement\n console.warn(\n `[autotel/attributes] Attribute \"${key}\" is deprecated. Use \"${replacement}\" instead.`,\n );\n }\n }\n\n if (deprecatedWarnings[key]) {\n console.warn(`[autotel/attributes] ${deprecatedWarnings[key]}`);\n }\n\n const replacement =\n DEPRECATED_ATTRIBUTES[key as keyof typeof DEPRECATED_ATTRIBUTES];\n return replacement ?? null;\n}\n\nexport function autoRedactPII(\n attributes: Record<string, unknown>,\n policy: AttributePolicy = {},\n): Record<string, unknown> {\n const { guardrails = { pii: 'redact' } } = policy;\n\n const redacted: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(attributes)) {\n redacted[key] = validateAttribute(key, value, { guardrails });\n }\n return redacted;\n}\n\nexport function defaultGuardrails(): AttributeGuardrails {\n return {\n pii: 'redact',\n maxLength: 255,\n validateEnum: true,\n warnDeprecated: true,\n };\n}\n","/**\n * Attribute utility functions\n */\n\nimport type { AttributeValue } from '../trace-context';\nimport {\n validateAttribute,\n autoRedactPII,\n defaultGuardrails,\n checkDeprecatedAttribute,\n type AttributePolicy,\n} from './validators';\n\n// Type for objects that have setAttributes method (spans or contexts)\n// Using a generic parameter to accommodate different AttributeValue types\ntype AttributeSetter = {\n setAttributes: (attrs: Record<string, AttributeValue>) => void;\n};\n\nexport function mergeAttrs(\n ...attrSets: Array<Record<string, unknown> | undefined>\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const attrSet of attrSets) {\n if (attrSet) {\n Object.assign(result, attrSet);\n }\n }\n return result;\n}\n\nexport function safeSetAttributes(\n span: AttributeSetter,\n attrs: Record<string, unknown>,\n policy?: AttributePolicy,\n): void {\n // Merge user-supplied guardrails with defaults so callers can tweak\n // a single option without opting out of the rest\n const mergedGuardrails = {\n ...defaultGuardrails(),\n ...policy?.guardrails,\n };\n const effectivePolicy: AttributePolicy = {\n ...policy,\n guardrails: mergedGuardrails,\n };\n\n const validated = autoRedactPII(attrs, effectivePolicy);\n\n const sanitizedAttrs: Record<string, AttributeValue> = {};\n for (const [key, value] of Object.entries(validated)) {\n if (value !== undefined) {\n // Check for deprecated attributes and log warnings\n checkDeprecatedAttribute(key, effectivePolicy);\n const validatedValue = validateAttribute(key, value, effectivePolicy);\n if (validatedValue !== undefined) {\n // Cast to AttributeValue since validateAttribute ensures valid types\n sanitizedAttrs[key] = validatedValue as AttributeValue;\n }\n }\n }\n\n span.setAttributes(sanitizedAttrs);\n}\n","/**\n * Signal attachment helpers\n * These functions know WHERE to attach attributes automatically\n * They handle span, resource, and log signals correctly\n */\n\nimport type { Span, Attributes } from '@opentelemetry/api';\nimport {\n resourceFromAttributes,\n type Resource,\n} from '@opentelemetry/resources';\nimport type { TraceContext } from '../trace-context';\nimport { attrs } from './builders';\nimport { safeSetAttributes } from './utils';\n\nexport function setUser(\n spanOrContext: Span | TraceContext,\n data: import('./types').UserAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.user.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setSession(\n spanOrContext: Span | TraceContext,\n data: import('./types').SessionAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.session.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setDevice(\n spanOrContext: Span | TraceContext,\n data: import('./types').DeviceAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.device.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function httpServer(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPServerAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.http.server(data);\n\n if ('updateName' in spanOrContext && data.method && data.route) {\n const span = spanOrContext as Span;\n span.updateName(`HTTP ${data.method} ${data.route}`);\n }\n\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function httpClient(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPClientAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.http.client(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function dbClient(\n spanOrContext: Span | TraceContext,\n data: import('./types').DBAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.db.client.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\n/**\n * Merge service attributes into a Resource and return a new Resource.\n *\n * Resource.attributes is readonly, so this function returns a new merged\n * Resource rather than mutating the input.\n *\n * @param resource - The existing resource to merge with\n * @param data - Service attributes to add\n * @returns A new Resource with the merged attributes\n *\n * @example\n * ```typescript\n * const baseResource = Resource.default();\n * const enrichedResource = mergeServiceResource(baseResource, {\n * name: 'my-service',\n * version: '1.0.0',\n * });\n * ```\n */\nexport function mergeServiceResource(\n resource: Resource,\n data: import('./types').ServiceAttrs,\n): Resource {\n const attributes = attrs.service.data(data);\n return resource.merge(resourceFromAttributes(attributes as Attributes));\n}\n\nexport function identify(\n spanOrContext: Span | TraceContext,\n data: {\n user?: import('./types').UserAttrs;\n session?: import('./types').SessionAttrs;\n device?: import('./types').DeviceAttrs;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const allAttrs = [];\n\n if (data.user) {\n allAttrs.push(attrs.user.data(data.user));\n }\n if (data.session) {\n allAttrs.push(attrs.session.data(data.session));\n }\n if (data.device) {\n allAttrs.push(attrs.device.data(data.device));\n }\n\n const merged: Record<string, unknown> = {};\n for (const attrSet of allAttrs) {\n Object.assign(merged, attrSet);\n }\n\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n\nexport function request(\n spanOrContext: Span | TraceContext,\n data: import('./types').HTTPServerAttrs & {\n clientIp?: string;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const httpAttrs = attrs.http.server(data);\n const networkAttrs = attrs.network.peerAddress(data.clientIp || '');\n const merged = { ...httpAttrs, ...networkAttrs };\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n\nexport function setError(\n spanOrContext: Span | TraceContext,\n data: import('./types').ErrorAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.error.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n\nexport function setException(\n spanOrContext: Span | TraceContext,\n data: import('./types').ExceptionAttrs,\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const attributes = attrs.exception.data(data);\n safeSetAttributes(spanOrContext, attributes, guardrails);\n}\n","/**\n * Domain helpers for common attribute patterns\n * These bundle multiple attribute groups into semantic helpers\n */\n\nimport { attrs } from './builders';\nimport { safeSetAttributes } from './utils';\n\nexport function transaction(\n spanOrContext: import('../trace-context').TraceContext,\n config: {\n user?: import('./types').UserAttrs;\n session?: import('./types').SessionAttrs;\n method?: string;\n route?: string;\n statusCode?: number;\n clientIp?: string;\n },\n guardrails?: import('./validators').AttributePolicy,\n): void {\n const userAttrs = attrs.user.data(config.user || {});\n const sessionAttrs = attrs.session.data(config.session || {});\n const httpAttrs = attrs.http.server({\n method: config.method,\n route: config.route,\n statusCode: config.statusCode,\n });\n const networkAttrs = attrs.network.peerAddress(config.clientIp || '');\n\n const merged = {\n ...userAttrs,\n ...sessionAttrs,\n ...httpAttrs,\n ...networkAttrs,\n };\n\n if (config.method && config.route && 'updateName' in spanOrContext) {\n spanOrContext.updateName(`HTTP ${config.method} ${config.route}`);\n }\n\n safeSetAttributes(spanOrContext, merged, guardrails);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAa,QAAQ;CACnB,MAAM;EACJ,KAAK,WAAmB,GAAG,eAAe,KAAK,MAAM;EACrD,QAAQ,WAAmB,GAAG,eAAe,QAAQ,MAAM;EAC3D,OAAO,WAAmB,GAAG,eAAe,OAAO,MAAM;EACzD,WAAW,WAAmB,GAAG,eAAe,WAAW,MAAM;EACjE,OAAO,WAAmB,GAAG,eAAe,OAAO,MAAM;EACzD,QAAQ,WAAqB,GAAG,eAAe,QAAQ,MAAM;EAE7D,OAAO,SAAoB;GACzB,MAAM,SAAkC,CAAC;GACzC,IAAI,KAAK,OAAO,QAAW,OAAO,eAAe,MAAM,KAAK;GAC5D,IAAI,KAAK,UAAU,QAAW,OAAO,eAAe,SAAS,KAAK;GAClE,IAAI,KAAK,SAAS,QAAW,OAAO,eAAe,QAAQ,KAAK;GAChE,IAAI,KAAK,aAAa,QACpB,OAAO,eAAe,YAAY,KAAK;GACzC,IAAI,KAAK,SAAS,QAAW,OAAO,eAAe,QAAQ,KAAK;GAChE,IAAI,KAAK,UAAU,QAAW,OAAO,eAAe,SAAS,KAAK;GAClE,OAAO;EACT;CACF;CAEA,SAAS;EACP,KAAK,WAAmB,GAAG,kBAAkB,KAAK,MAAM;EACxD,aAA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