autotel 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1946 -0
  3. package/dist/chunk-2LNRY4QK.js +273 -0
  4. package/dist/chunk-2LNRY4QK.js.map +1 -0
  5. package/dist/chunk-3HENGDW2.js +587 -0
  6. package/dist/chunk-3HENGDW2.js.map +1 -0
  7. package/dist/chunk-4OAT42CA.cjs +73 -0
  8. package/dist/chunk-4OAT42CA.cjs.map +1 -0
  9. package/dist/chunk-5GWX5LFW.js +70 -0
  10. package/dist/chunk-5GWX5LFW.js.map +1 -0
  11. package/dist/chunk-5R2M36QB.js +195 -0
  12. package/dist/chunk-5R2M36QB.js.map +1 -0
  13. package/dist/chunk-5ZN622AO.js +73 -0
  14. package/dist/chunk-5ZN622AO.js.map +1 -0
  15. package/dist/chunk-77MSMAUQ.cjs +498 -0
  16. package/dist/chunk-77MSMAUQ.cjs.map +1 -0
  17. package/dist/chunk-ABPEQ6RK.cjs +596 -0
  18. package/dist/chunk-ABPEQ6RK.cjs.map +1 -0
  19. package/dist/chunk-BWYGJKRB.js +95 -0
  20. package/dist/chunk-BWYGJKRB.js.map +1 -0
  21. package/dist/chunk-BZHG5IZ4.js +73 -0
  22. package/dist/chunk-BZHG5IZ4.js.map +1 -0
  23. package/dist/chunk-G7VZBCD6.cjs +35 -0
  24. package/dist/chunk-G7VZBCD6.cjs.map +1 -0
  25. package/dist/chunk-GVLK7YUU.cjs +30 -0
  26. package/dist/chunk-GVLK7YUU.cjs.map +1 -0
  27. package/dist/chunk-HCCXC7XG.js +205 -0
  28. package/dist/chunk-HCCXC7XG.js.map +1 -0
  29. package/dist/chunk-HE6T6FIX.cjs +203 -0
  30. package/dist/chunk-HE6T6FIX.cjs.map +1 -0
  31. package/dist/chunk-KIXWPOCO.cjs +100 -0
  32. package/dist/chunk-KIXWPOCO.cjs.map +1 -0
  33. package/dist/chunk-KVGNW3FC.js +87 -0
  34. package/dist/chunk-KVGNW3FC.js.map +1 -0
  35. package/dist/chunk-LITNXTTT.js +3 -0
  36. package/dist/chunk-LITNXTTT.js.map +1 -0
  37. package/dist/chunk-M4ANN7RL.js +114 -0
  38. package/dist/chunk-M4ANN7RL.js.map +1 -0
  39. package/dist/chunk-NC52UBR2.cjs +32 -0
  40. package/dist/chunk-NC52UBR2.cjs.map +1 -0
  41. package/dist/chunk-NHCNRQD3.cjs +212 -0
  42. package/dist/chunk-NHCNRQD3.cjs.map +1 -0
  43. package/dist/chunk-NZ72VDNY.cjs +4 -0
  44. package/dist/chunk-NZ72VDNY.cjs.map +1 -0
  45. package/dist/chunk-P6JUDYNO.js +57 -0
  46. package/dist/chunk-P6JUDYNO.js.map +1 -0
  47. package/dist/chunk-RJYY7BWX.js +1349 -0
  48. package/dist/chunk-RJYY7BWX.js.map +1 -0
  49. package/dist/chunk-TRI4V5BF.cjs +126 -0
  50. package/dist/chunk-TRI4V5BF.cjs.map +1 -0
  51. package/dist/chunk-UL33I6IS.js +139 -0
  52. package/dist/chunk-UL33I6IS.js.map +1 -0
  53. package/dist/chunk-URRW6M2C.cjs +61 -0
  54. package/dist/chunk-URRW6M2C.cjs.map +1 -0
  55. package/dist/chunk-UY3UYPBZ.cjs +77 -0
  56. package/dist/chunk-UY3UYPBZ.cjs.map +1 -0
  57. package/dist/chunk-W3253FGB.cjs +277 -0
  58. package/dist/chunk-W3253FGB.cjs.map +1 -0
  59. package/dist/chunk-W7LHZVQF.js +26 -0
  60. package/dist/chunk-W7LHZVQF.js.map +1 -0
  61. package/dist/chunk-WBWNM6LB.cjs +1360 -0
  62. package/dist/chunk-WBWNM6LB.cjs.map +1 -0
  63. package/dist/chunk-WFJ7L2RV.js +494 -0
  64. package/dist/chunk-WFJ7L2RV.js.map +1 -0
  65. package/dist/chunk-X4RMFFMR.js +28 -0
  66. package/dist/chunk-X4RMFFMR.js.map +1 -0
  67. package/dist/chunk-Y4Y2S7BM.cjs +92 -0
  68. package/dist/chunk-Y4Y2S7BM.cjs.map +1 -0
  69. package/dist/chunk-YLPNXZFI.cjs +143 -0
  70. package/dist/chunk-YLPNXZFI.cjs.map +1 -0
  71. package/dist/chunk-YTXEZ4SD.cjs +77 -0
  72. package/dist/chunk-YTXEZ4SD.cjs.map +1 -0
  73. package/dist/chunk-Z6ZWNWWR.js +30 -0
  74. package/dist/chunk-Z6ZWNWWR.js.map +1 -0
  75. package/dist/config.cjs +26 -0
  76. package/dist/config.cjs.map +1 -0
  77. package/dist/config.d.cts +75 -0
  78. package/dist/config.d.ts +75 -0
  79. package/dist/config.js +5 -0
  80. package/dist/config.js.map +1 -0
  81. package/dist/db.cjs +233 -0
  82. package/dist/db.cjs.map +1 -0
  83. package/dist/db.d.cts +123 -0
  84. package/dist/db.d.ts +123 -0
  85. package/dist/db.js +228 -0
  86. package/dist/db.js.map +1 -0
  87. package/dist/decorators.cjs +67 -0
  88. package/dist/decorators.cjs.map +1 -0
  89. package/dist/decorators.d.cts +91 -0
  90. package/dist/decorators.d.ts +91 -0
  91. package/dist/decorators.js +65 -0
  92. package/dist/decorators.js.map +1 -0
  93. package/dist/event-subscriber.cjs +6 -0
  94. package/dist/event-subscriber.cjs.map +1 -0
  95. package/dist/event-subscriber.d.cts +116 -0
  96. package/dist/event-subscriber.d.ts +116 -0
  97. package/dist/event-subscriber.js +3 -0
  98. package/dist/event-subscriber.js.map +1 -0
  99. package/dist/event-testing.cjs +21 -0
  100. package/dist/event-testing.cjs.map +1 -0
  101. package/dist/event-testing.d.cts +110 -0
  102. package/dist/event-testing.d.ts +110 -0
  103. package/dist/event-testing.js +4 -0
  104. package/dist/event-testing.js.map +1 -0
  105. package/dist/event.cjs +30 -0
  106. package/dist/event.cjs.map +1 -0
  107. package/dist/event.d.cts +282 -0
  108. package/dist/event.d.ts +282 -0
  109. package/dist/event.js +13 -0
  110. package/dist/event.js.map +1 -0
  111. package/dist/exporters.cjs +17 -0
  112. package/dist/exporters.cjs.map +1 -0
  113. package/dist/exporters.d.cts +1 -0
  114. package/dist/exporters.d.ts +1 -0
  115. package/dist/exporters.js +4 -0
  116. package/dist/exporters.js.map +1 -0
  117. package/dist/functional.cjs +46 -0
  118. package/dist/functional.cjs.map +1 -0
  119. package/dist/functional.d.cts +478 -0
  120. package/dist/functional.d.ts +478 -0
  121. package/dist/functional.js +13 -0
  122. package/dist/functional.js.map +1 -0
  123. package/dist/http.cjs +189 -0
  124. package/dist/http.cjs.map +1 -0
  125. package/dist/http.d.cts +169 -0
  126. package/dist/http.d.ts +169 -0
  127. package/dist/http.js +184 -0
  128. package/dist/http.js.map +1 -0
  129. package/dist/index.cjs +333 -0
  130. package/dist/index.cjs.map +1 -0
  131. package/dist/index.d.cts +758 -0
  132. package/dist/index.d.ts +758 -0
  133. package/dist/index.js +143 -0
  134. package/dist/index.js.map +1 -0
  135. package/dist/instrumentation.cjs +182 -0
  136. package/dist/instrumentation.cjs.map +1 -0
  137. package/dist/instrumentation.d.cts +49 -0
  138. package/dist/instrumentation.d.ts +49 -0
  139. package/dist/instrumentation.js +179 -0
  140. package/dist/instrumentation.js.map +1 -0
  141. package/dist/logger.cjs +19 -0
  142. package/dist/logger.cjs.map +1 -0
  143. package/dist/logger.d.cts +146 -0
  144. package/dist/logger.d.ts +146 -0
  145. package/dist/logger.js +6 -0
  146. package/dist/logger.js.map +1 -0
  147. package/dist/metric-helpers.cjs +31 -0
  148. package/dist/metric-helpers.cjs.map +1 -0
  149. package/dist/metric-helpers.d.cts +13 -0
  150. package/dist/metric-helpers.d.ts +13 -0
  151. package/dist/metric-helpers.js +6 -0
  152. package/dist/metric-helpers.js.map +1 -0
  153. package/dist/metric-testing.cjs +21 -0
  154. package/dist/metric-testing.cjs.map +1 -0
  155. package/dist/metric-testing.d.cts +110 -0
  156. package/dist/metric-testing.d.ts +110 -0
  157. package/dist/metric-testing.js +4 -0
  158. package/dist/metric-testing.js.map +1 -0
  159. package/dist/metric.cjs +26 -0
  160. package/dist/metric.cjs.map +1 -0
  161. package/dist/metric.d.cts +240 -0
  162. package/dist/metric.d.ts +240 -0
  163. package/dist/metric.js +9 -0
  164. package/dist/metric.js.map +1 -0
  165. package/dist/processors.cjs +17 -0
  166. package/dist/processors.cjs.map +1 -0
  167. package/dist/processors.d.cts +1 -0
  168. package/dist/processors.d.ts +1 -0
  169. package/dist/processors.js +4 -0
  170. package/dist/processors.js.map +1 -0
  171. package/dist/sampling.cjs +40 -0
  172. package/dist/sampling.cjs.map +1 -0
  173. package/dist/sampling.d.cts +260 -0
  174. package/dist/sampling.d.ts +260 -0
  175. package/dist/sampling.js +7 -0
  176. package/dist/sampling.js.map +1 -0
  177. package/dist/semantic-helpers.cjs +35 -0
  178. package/dist/semantic-helpers.cjs.map +1 -0
  179. package/dist/semantic-helpers.d.cts +442 -0
  180. package/dist/semantic-helpers.d.ts +442 -0
  181. package/dist/semantic-helpers.js +14 -0
  182. package/dist/semantic-helpers.js.map +1 -0
  183. package/dist/tail-sampling-processor.cjs +13 -0
  184. package/dist/tail-sampling-processor.cjs.map +1 -0
  185. package/dist/tail-sampling-processor.d.cts +27 -0
  186. package/dist/tail-sampling-processor.d.ts +27 -0
  187. package/dist/tail-sampling-processor.js +4 -0
  188. package/dist/tail-sampling-processor.js.map +1 -0
  189. package/dist/testing.cjs +286 -0
  190. package/dist/testing.cjs.map +1 -0
  191. package/dist/testing.d.cts +291 -0
  192. package/dist/testing.d.ts +291 -0
  193. package/dist/testing.js +263 -0
  194. package/dist/testing.js.map +1 -0
  195. package/dist/trace-context-DRZdUvVY.d.cts +181 -0
  196. package/dist/trace-context-DRZdUvVY.d.ts +181 -0
  197. package/dist/trace-helpers.cjs +54 -0
  198. package/dist/trace-helpers.cjs.map +1 -0
  199. package/dist/trace-helpers.d.cts +524 -0
  200. package/dist/trace-helpers.d.ts +524 -0
  201. package/dist/trace-helpers.js +5 -0
  202. package/dist/trace-helpers.js.map +1 -0
  203. package/dist/tracer-provider.cjs +21 -0
  204. package/dist/tracer-provider.cjs.map +1 -0
  205. package/dist/tracer-provider.d.cts +169 -0
  206. package/dist/tracer-provider.d.ts +169 -0
  207. package/dist/tracer-provider.js +4 -0
  208. package/dist/tracer-provider.js.map +1 -0
  209. package/package.json +280 -0
  210. package/src/baggage-span-processor.test.ts +202 -0
  211. package/src/baggage-span-processor.ts +98 -0
  212. package/src/circuit-breaker.test.ts +341 -0
  213. package/src/circuit-breaker.ts +184 -0
  214. package/src/config.test.ts +94 -0
  215. package/src/config.ts +169 -0
  216. package/src/db.test.ts +252 -0
  217. package/src/db.ts +447 -0
  218. package/src/decorators.test.ts +203 -0
  219. package/src/decorators.ts +188 -0
  220. package/src/env-config.test.ts +246 -0
  221. package/src/env-config.ts +158 -0
  222. package/src/event-queue.test.ts +222 -0
  223. package/src/event-queue.ts +203 -0
  224. package/src/event-subscriber.ts +136 -0
  225. package/src/event-testing.ts +197 -0
  226. package/src/event.test.ts +718 -0
  227. package/src/event.ts +556 -0
  228. package/src/exporters.ts +96 -0
  229. package/src/functional.test.ts +1059 -0
  230. package/src/functional.ts +2295 -0
  231. package/src/http.test.ts +487 -0
  232. package/src/http.ts +424 -0
  233. package/src/index.ts +158 -0
  234. package/src/init.customization.test.ts +210 -0
  235. package/src/init.integrations.test.ts +366 -0
  236. package/src/init.openllmetry.test.ts +282 -0
  237. package/src/init.protocol.test.ts +215 -0
  238. package/src/init.ts +1426 -0
  239. package/src/instrumentation.test.ts +108 -0
  240. package/src/instrumentation.ts +308 -0
  241. package/src/logger.test.ts +117 -0
  242. package/src/logger.ts +246 -0
  243. package/src/metric-helpers.ts +47 -0
  244. package/src/metric-testing.ts +197 -0
  245. package/src/metric.ts +434 -0
  246. package/src/metrics.test.ts +205 -0
  247. package/src/operation-context.ts +93 -0
  248. package/src/processors.ts +106 -0
  249. package/src/rate-limiter.test.ts +199 -0
  250. package/src/rate-limiter.ts +98 -0
  251. package/src/sampling.test.ts +513 -0
  252. package/src/sampling.ts +428 -0
  253. package/src/semantic-helpers.test.ts +311 -0
  254. package/src/semantic-helpers.ts +584 -0
  255. package/src/shutdown.test.ts +311 -0
  256. package/src/shutdown.ts +222 -0
  257. package/src/stub.integration.test.ts +361 -0
  258. package/src/tail-sampling-processor.test.ts +226 -0
  259. package/src/tail-sampling-processor.ts +51 -0
  260. package/src/testing.ts +670 -0
  261. package/src/trace-context.ts +470 -0
  262. package/src/trace-helpers.new.test.ts +278 -0
  263. package/src/trace-helpers.test.ts +242 -0
  264. package/src/trace-helpers.ts +690 -0
  265. package/src/tracer-provider.test.ts +183 -0
  266. package/src/tracer-provider.ts +266 -0
  267. package/src/track.test.ts +153 -0
  268. package/src/track.ts +120 -0
  269. package/src/validation.test.ts +306 -0
  270. package/src/validation.ts +239 -0
  271. package/src/variable-name-inference.test.ts +178 -0
  272. package/src/variable-name-inference.ts +242 -0
@@ -0,0 +1,92 @@
1
+ 'use strict';
2
+
3
+ var chunkURRW6M2C_cjs = require('./chunk-URRW6M2C.cjs');
4
+ var api = require('@opentelemetry/api');
5
+
6
+ var IS_PRODUCTION = process.env.NODE_ENV === "production";
7
+ var IS_DEV = process.env.NODE_ENV === "development";
8
+ process.env.NODE_ENV === "test";
9
+ var FEATURE_FLAGS = {
10
+ /** Enable full auto-instrumentation (expensive, production only) */
11
+ ENABLE_AUTO_INSTRUMENTATION: IS_PRODUCTION && process.env.autotel_AUTO_INSTRUMENT !== "false",
12
+ /** Enable verbose logging (development only) */
13
+ ENABLE_VERBOSE_LOGGING: IS_DEV || process.env.autotel_VERBOSE === "true",
14
+ /** Enable metrics collection (production only) */
15
+ ENABLE_METRICS_BY_DEFAULT: IS_PRODUCTION && process.env.autotel_METRICS !== "false",
16
+ /** Enable async resource detection (production only) */
17
+ ENABLE_RESOURCE_DETECTION: IS_PRODUCTION && process.env.autotel_RESOURCE_DETECTION === "true",
18
+ /** Enable tracing in all environments (can be disabled via autotel_TRACING=false) */
19
+ ENABLE_TRACING: process.env.autotel_TRACING !== "false",
20
+ /** Enable log redaction for sensitive fields (can be disabled via autotel_REDACTION=false) */
21
+ ENABLE_REDACTION: process.env.autotel_REDACTION !== "false"
22
+ };
23
+ var Config = class {
24
+ config = {
25
+ tracerName: "app",
26
+ meterName: "app",
27
+ tracer: chunkURRW6M2C_cjs.getAutotelTracer("app"),
28
+ meter: api.metrics.getMeter("app")
29
+ };
30
+ /**
31
+ * Get feature flags
32
+ */
33
+ get featureFlags() {
34
+ return FEATURE_FLAGS;
35
+ }
36
+ /**
37
+ * Update global configuration
38
+ */
39
+ configure(options) {
40
+ if (options.tracerName) {
41
+ this.config.tracerName = options.tracerName;
42
+ this.config.tracer = chunkURRW6M2C_cjs.getAutotelTracer(options.tracerName);
43
+ }
44
+ if (options.meterName) {
45
+ this.config.meterName = options.meterName;
46
+ this.config.meter = api.metrics.getMeter(options.meterName);
47
+ }
48
+ if (options.tracer) {
49
+ this.config.tracer = options.tracer;
50
+ }
51
+ if (options.meter) {
52
+ this.config.meter = options.meter;
53
+ }
54
+ }
55
+ /**
56
+ * Get current configuration
57
+ */
58
+ get() {
59
+ return this.config;
60
+ }
61
+ /**
62
+ * Reset to defaults (mainly for testing)
63
+ */
64
+ reset() {
65
+ this.config = {
66
+ tracerName: "app",
67
+ meterName: "app",
68
+ tracer: api.trace.getTracer("app"),
69
+ meter: api.metrics.getMeter("app")
70
+ };
71
+ }
72
+ };
73
+ var globalConfig = new Config();
74
+ function configure(options) {
75
+ globalConfig.configure(options);
76
+ }
77
+ function getConfig() {
78
+ return {
79
+ ...globalConfig.get(),
80
+ featureFlags: FEATURE_FLAGS
81
+ };
82
+ }
83
+ function resetConfig() {
84
+ globalConfig.reset();
85
+ }
86
+
87
+ exports.FEATURE_FLAGS = FEATURE_FLAGS;
88
+ exports.configure = configure;
89
+ exports.getConfig = getConfig;
90
+ exports.resetConfig = resetConfig;
91
+ //# sourceMappingURL=chunk-Y4Y2S7BM.cjs.map
92
+ //# sourceMappingURL=chunk-Y4Y2S7BM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":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file":"chunk-Y4Y2S7BM.cjs","sourcesContent":["/**\n * Global configuration for OpenTelemetry decorators\n *\n * Allows users to inject custom loggers, tracers, and meters\n * while maintaining sensible defaults.\n */\n\nimport { trace, metrics, type Tracer, type Meter } from '@opentelemetry/api';\nimport { getAutotelTracer } from './tracer-provider';\n\nexport type { ILogger } from './logger';\n\n/**\n * Environment-based feature flags for performance optimization\n *\n * Disables expensive features in development while maintaining\n * full observability in production.\n */\nconst IS_PRODUCTION = process.env.NODE_ENV === 'production';\nconst IS_DEV = process.env.NODE_ENV === 'development';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport const FEATURE_FLAGS = {\n /** Enable full auto-instrumentation (expensive, production only) */\n ENABLE_AUTO_INSTRUMENTATION:\n IS_PRODUCTION && process.env.autotel_AUTO_INSTRUMENT !== 'false',\n\n /** Enable verbose logging (development only) */\n ENABLE_VERBOSE_LOGGING: IS_DEV || process.env.autotel_VERBOSE === 'true',\n\n /** Enable metrics collection (production only) */\n ENABLE_METRICS_BY_DEFAULT:\n IS_PRODUCTION && process.env.autotel_METRICS !== 'false',\n\n /** Enable async resource detection (production only) */\n ENABLE_RESOURCE_DETECTION:\n IS_PRODUCTION && process.env.autotel_RESOURCE_DETECTION === 'true',\n\n /** Enable tracing in all environments (can be disabled via autotel_TRACING=false) */\n ENABLE_TRACING: process.env.autotel_TRACING !== 'false',\n\n /** Enable log redaction for sensitive fields (can be disabled via autotel_REDACTION=false) */\n ENABLE_REDACTION: process.env.autotel_REDACTION !== 'false',\n} as const;\n\n/**\n * Global configuration options\n */\nexport interface InstrumentationConfig {\n /**\n * Tracer name for OpenTelemetry\n * @default 'app'\n */\n tracerName?: string;\n\n /**\n * Meter name for OpenTelemetry metrics\n * @default 'app'\n */\n meterName?: string;\n\n /**\n * Custom tracer instance (for advanced use cases like Datadog direct)\n * @default trace.getTracer(tracerName)\n */\n tracer?: Tracer;\n\n /**\n * Custom meter instance\n * @default metrics.getMeter(meterName)\n */\n meter?: Meter;\n}\n\n/**\n * Internal configuration state\n */\nclass Config {\n private config: Required<InstrumentationConfig> = {\n tracerName: 'app',\n meterName: 'app',\n tracer: getAutotelTracer('app'),\n meter: metrics.getMeter('app'),\n };\n\n /**\n * Get feature flags\n */\n get featureFlags() {\n return FEATURE_FLAGS;\n }\n\n /**\n * Update global configuration\n */\n configure(options: InstrumentationConfig): void {\n if (options.tracerName) {\n this.config.tracerName = options.tracerName;\n this.config.tracer = getAutotelTracer(options.tracerName);\n }\n if (options.meterName) {\n this.config.meterName = options.meterName;\n this.config.meter = metrics.getMeter(options.meterName);\n }\n if (options.tracer) {\n this.config.tracer = options.tracer;\n }\n if (options.meter) {\n this.config.meter = options.meter;\n }\n }\n\n /**\n * Get current configuration\n */\n get(): Required<InstrumentationConfig> {\n return this.config;\n }\n\n /**\n * Reset to defaults (mainly for testing)\n */\n reset(): void {\n this.config = {\n tracerName: 'app',\n meterName: 'app',\n tracer: trace.getTracer('app'),\n meter: metrics.getMeter('app'),\n };\n }\n}\n\nconst globalConfig = new Config();\n\n/**\n * Configure global instrumentation behavior\n *\n * @example\n * ```typescript\n * import { configure } from 'autotel/config'\n *\n * configure({\n * tracerName: 'my-app'\n * })\n * ```\n */\nexport function configure(options: InstrumentationConfig): void {\n globalConfig.configure(options);\n}\n\n/**\n * Get current configuration (internal use)\n */\nexport function getConfig(): Required<InstrumentationConfig> & {\n featureFlags: typeof FEATURE_FLAGS;\n} {\n return {\n ...globalConfig.get(),\n featureFlags: FEATURE_FLAGS,\n };\n}\n\n/**\n * Reset configuration to defaults (internal use - mainly for testing)\n */\nexport function resetConfig(): void {\n globalConfig.reset();\n}\n"]}
@@ -0,0 +1,143 @@
1
+ 'use strict';
2
+
3
+ var async_hooks = require('async_hooks');
4
+
5
+ // src/validation.ts
6
+ var DEFAULT_CONFIG = {
7
+ maxEventNameLength: 100,
8
+ maxAttributeKeyLength: 100,
9
+ maxAttributeValueLength: 1e3,
10
+ maxAttributeCount: 50,
11
+ maxNestingDepth: 3,
12
+ sensitivePatterns: [
13
+ /password/i,
14
+ /secret/i,
15
+ /token/i,
16
+ /api[_-]?key/i,
17
+ /access[_-]?key/i,
18
+ /private[_-]?key/i,
19
+ /auth/i,
20
+ /credential/i,
21
+ /ssn/i,
22
+ /credit[_-]?card/i
23
+ ]
24
+ };
25
+ var ValidationError = class extends Error {
26
+ constructor(message) {
27
+ super(message);
28
+ this.name = "ValidationError";
29
+ }
30
+ };
31
+ function validateEventName(eventName, config = DEFAULT_CONFIG) {
32
+ if (typeof eventName !== "string") {
33
+ throw new ValidationError(
34
+ `Event name must be a string, got ${typeof eventName}`
35
+ );
36
+ }
37
+ const trimmed = eventName.trim();
38
+ if (trimmed.length === 0) {
39
+ throw new ValidationError("Event name cannot be empty");
40
+ }
41
+ if (trimmed.length > config.maxEventNameLength) {
42
+ throw new ValidationError(
43
+ `Event name too long (${trimmed.length} chars). Max: ${config.maxEventNameLength}`
44
+ );
45
+ }
46
+ if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {
47
+ throw new ValidationError(
48
+ `Event name contains invalid characters: "${trimmed}". Use only letters, numbers, dots, underscores, and hyphens.`
49
+ );
50
+ }
51
+ return trimmed;
52
+ }
53
+ function validateAttributes(attributes, config = DEFAULT_CONFIG) {
54
+ if (attributes === void 0 || attributes === null) {
55
+ return void 0;
56
+ }
57
+ if (typeof attributes !== "object" || Array.isArray(attributes)) {
58
+ throw new ValidationError("Attributes must be an object");
59
+ }
60
+ const keys = Object.keys(attributes);
61
+ if (keys.length > config.maxAttributeCount) {
62
+ throw new ValidationError(
63
+ `Too many attributes (${keys.length}). Max: ${config.maxAttributeCount}`
64
+ );
65
+ }
66
+ const sanitized = {};
67
+ for (const key of keys) {
68
+ if (key.length > config.maxAttributeKeyLength) {
69
+ throw new ValidationError(
70
+ `Attribute key too long: "${key.slice(0, 20)}..." (${key.length} chars). Max: ${config.maxAttributeKeyLength}`
71
+ );
72
+ }
73
+ const isSensitive = config.sensitivePatterns.some(
74
+ (pattern) => pattern.test(key)
75
+ );
76
+ if (isSensitive) {
77
+ sanitized[key] = "[REDACTED]";
78
+ continue;
79
+ }
80
+ const value = attributes[key];
81
+ sanitized[key] = sanitizeValue(value, config, 1);
82
+ }
83
+ return sanitized;
84
+ }
85
+ function sanitizeValue(value, config, depth) {
86
+ if (depth > config.maxNestingDepth) {
87
+ return "[MAX_DEPTH_EXCEEDED]";
88
+ }
89
+ if (value === null || value === void 0) {
90
+ return value;
91
+ }
92
+ if (typeof value === "string") {
93
+ if (value.length > config.maxAttributeValueLength) {
94
+ return value.slice(0, config.maxAttributeValueLength) + "...";
95
+ }
96
+ return value;
97
+ }
98
+ if (typeof value === "number" || typeof value === "boolean") {
99
+ return value;
100
+ }
101
+ if (Array.isArray(value)) {
102
+ return value.map((item) => sanitizeValue(item, config, depth + 1));
103
+ }
104
+ if (typeof value === "object") {
105
+ try {
106
+ JSON.stringify(value);
107
+ const sanitized = {};
108
+ for (const key in value) {
109
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
110
+ sanitized[key] = sanitizeValue(
111
+ value[key],
112
+ config,
113
+ depth + 1
114
+ );
115
+ }
116
+ }
117
+ return sanitized;
118
+ } catch {
119
+ return "[CIRCULAR]";
120
+ }
121
+ }
122
+ return `[${typeof value}]`;
123
+ }
124
+ function validateEvent(eventName, attributes, config) {
125
+ const fullConfig = { ...DEFAULT_CONFIG, ...config };
126
+ return {
127
+ eventName: validateEventName(eventName, fullConfig),
128
+ attributes: validateAttributes(attributes, fullConfig)
129
+ };
130
+ }
131
+ var operationStorage = new async_hooks.AsyncLocalStorage();
132
+ function getOperationContext() {
133
+ return operationStorage.getStore();
134
+ }
135
+ function runInOperationContext(name, fn) {
136
+ return operationStorage.run({ name }, fn);
137
+ }
138
+
139
+ exports.getOperationContext = getOperationContext;
140
+ exports.runInOperationContext = runInOperationContext;
141
+ exports.validateEvent = validateEvent;
142
+ //# sourceMappingURL=chunk-YLPNXZFI.cjs.map
143
+ //# sourceMappingURL=chunk-YLPNXZFI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/validation.ts","../src/operation-context.ts"],"names":["AsyncLocalStorage"],"mappings":";;;;;AA2BA,IAAM,cAAA,GAAmC;AAAA,EACvC,kBAAA,EAAoB,GAAA;AAAA,EACpB,qBAAA,EAAuB,GAAA;AAAA,EACvB,uBAAA,EAAyB,GAAA;AAAA,EACzB,iBAAA,EAAmB,EAAA;AAAA,EACnB,eAAA,EAAiB,CAAA;AAAA,EACjB,iBAAA,EAAmB;AAAA,IACjB,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,kBAAA;AAAA,IACA,OAAA;AAAA,IACA,aAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA;AAEJ,CAAA;AAEO,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EACzC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAA;AAAA,EACd;AACF,CAAA;AAMO,SAAS,iBAAA,CACd,SAAA,EACA,MAAA,GAA2B,cAAA,EACnB;AAER,EAAA,IAAI,OAAO,cAAc,QAAA,EAAU;AACjC,IAAA,MAAM,IAAI,eAAA;AAAA,MACR,CAAA,iCAAA,EAAoC,OAAO,SAAS,CAAA;AAAA,KACtD;AAAA,EACF;AAGA,EAAA,MAAM,OAAA,GAAU,UAAU,IAAA,EAAK;AAC/B,EAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,IAAA,MAAM,IAAI,gBAAgB,4BAA4B,CAAA;AAAA,EACxD;AAGA,EAAA,IAAI,OAAA,CAAQ,MAAA,GAAS,MAAA,CAAO,kBAAA,EAAoB;AAC9C,IAAA,MAAM,IAAI,eAAA;AAAA,MACR,CAAA,qBAAA,EAAwB,OAAA,CAAQ,MAAM,CAAA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EF,MAAA,IAAA,CAAK,UAAU,KAAK,CAAA;AAEpB,MAAA,MAAM,YAAqC,EAAC;AAC5C,MAAA,KAAA,MAAW,OAAO,KAAA,EAAO;AACvB,QAAA,IAAI,OAAO,SAAA,CAAU,cAAA,CAAe,IAAA,CAAK,KAAA,EAAO,GAAG,CAAA,EAAG;AACpD,UAAA,SAAA,CAAU,GAAG,CAAA,GAAI,aAAA;AAAA,YACd,MAAkC,GAAG,CAAA;AAAA,YACtC,MAAA;AAAA,YACA,KAAA,GAAQ;AAAA,WACV;AAAA,QACF;AAAA,MACF;AACA,MAAA,OAAO,SAAA;AAAA,IACT,CAAA,CAAA,MAAQ;AAEN,MAAA,OAAO,YAAA;AAAA,IACT;AAAA,EACF;AAGA,EAAA,OAAO,CAAA,CAAA,EAAI,OAAO,KAAK,CAAA,CAAA,CAAA;AACzB;AAMO,SAAS,aAAA,CACd,SAAA,EACA,UAAA,EACA,MAAA,EACqD;AACrD,EAAA,MAAM,UAAA,GAAa,EAAE,GAAG,cAAA,EAAgB,GAAG,MAAA,EAAO;AAElD,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,iBAAA,CAAkB,SAAA,EAAW,UAAU,CAAA;AAAA,IAClD,UAAA,EAAY,kBAAA,CAAmB,UAAA,EAAY,UAAU;AAAA,GACvD;AACF;AC7MA,IAAM,gBAAA,GAAmB,IAAIA,6BAAA,EAAoC;AAe1D,SAAS,mBAAA,GAAoD;AAClE,EAAA,OAAO,iBAAiB,QAAA,EAAS;AACnC;AAsBO,SAAS,qBAAA,CAAyB,MAAc,EAAA,EAAgB;AACrE,EAAA,OAAO,gBAAA,CAAiB,GAAA,CAAI,EAAE,IAAA,IAAQ,EAAE,CAAA;AAC1C","file":"chunk-YLPNXZFI.cjs","sourcesContent":["/**\n * Input validation for events events and attributes\n *\n * Prevents:\n * - Invalid event names\n * - Oversized payloads\n * - Circular references\n * - Sensitive data leaks\n */\n\nimport type { EventAttributes } from './event-subscriber';\n\nexport interface ValidationConfig {\n /** Max event name length (default: 100) */\n maxEventNameLength: number;\n /** Max attribute key length (default: 100) */\n maxAttributeKeyLength: number;\n /** Max attribute value length for strings (default: 1000) */\n maxAttributeValueLength: number;\n /** Max total attributes per event (default: 50) */\n maxAttributeCount: number;\n /** Max nesting depth for objects (default: 3) */\n maxNestingDepth: number;\n /** Sensitive field patterns to redact */\n sensitivePatterns: RegExp[];\n}\n\nconst DEFAULT_CONFIG: ValidationConfig = {\n maxEventNameLength: 100,\n maxAttributeKeyLength: 100,\n maxAttributeValueLength: 1000,\n maxAttributeCount: 50,\n maxNestingDepth: 3,\n sensitivePatterns: [\n /password/i,\n /secret/i,\n /token/i,\n /api[_-]?key/i,\n /access[_-]?key/i,\n /private[_-]?key/i,\n /auth/i,\n /credential/i,\n /ssn/i,\n /credit[_-]?card/i,\n ],\n};\n\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\n/**\n * Validate and sanitize event name\n * Throws ValidationError if invalid\n */\nexport function validateEventName(\n eventName: string,\n config: ValidationConfig = DEFAULT_CONFIG,\n): string {\n // Check type\n if (typeof eventName !== 'string') {\n throw new ValidationError(\n `Event name must be a string, got ${typeof eventName}`,\n );\n }\n\n // Check non-empty\n const trimmed = eventName.trim();\n if (trimmed.length === 0) {\n throw new ValidationError('Event name cannot be empty');\n }\n\n // Check length\n if (trimmed.length > config.maxEventNameLength) {\n throw new ValidationError(\n `Event name too long (${trimmed.length} chars). ` +\n `Max: ${config.maxEventNameLength}`,\n );\n }\n\n // Check valid characters (alphanumeric, dots, underscores, hyphens)\n if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {\n throw new ValidationError(\n `Event name contains invalid characters: \"${trimmed}\". ` +\n 'Use only letters, numbers, dots, underscores, and hyphens.',\n );\n }\n\n return trimmed;\n}\n\n/**\n * Validate and sanitize attributes\n * Returns sanitized attributes (sensitive data redacted)\n */\nexport function validateAttributes(\n attributes: EventAttributes | undefined,\n config: ValidationConfig = DEFAULT_CONFIG,\n): EventAttributes | undefined {\n if (attributes === undefined || attributes === null) {\n return undefined;\n }\n\n // Check type\n if (typeof attributes !== 'object' || Array.isArray(attributes)) {\n throw new ValidationError('Attributes must be an object');\n }\n\n // Count attributes\n const keys = Object.keys(attributes);\n if (keys.length > config.maxAttributeCount) {\n throw new ValidationError(\n `Too many attributes (${keys.length}). ` +\n `Max: ${config.maxAttributeCount}`,\n );\n }\n\n // Validate and sanitize each attribute\n const sanitized: EventAttributes = {};\n\n for (const key of keys) {\n // Validate key\n if (key.length > config.maxAttributeKeyLength) {\n throw new ValidationError(\n `Attribute key too long: \"${key.slice(0, 20)}...\" ` +\n `(${key.length} chars). Max: ${config.maxAttributeKeyLength}`,\n );\n }\n\n // Check for sensitive field\n const isSensitive = config.sensitivePatterns.some((pattern) =>\n pattern.test(key),\n );\n\n if (isSensitive) {\n // Redact sensitive data\n sanitized[key] = '[REDACTED]';\n continue;\n }\n\n // Sanitize value\n const value = attributes[key];\n sanitized[key] = sanitizeValue(value, config, 1) as\n | string\n | number\n | boolean;\n }\n\n return sanitized;\n}\n\n/**\n * Sanitize attribute value (recursive)\n */\nfunction sanitizeValue(\n value: unknown,\n config: ValidationConfig,\n depth: number,\n): unknown {\n // Check nesting depth\n if (depth > config.maxNestingDepth) {\n return '[MAX_DEPTH_EXCEEDED]';\n }\n\n // Handle null/undefined\n if (value === null || value === undefined) {\n return value;\n }\n\n // Handle primitives\n if (typeof value === 'string') {\n if (value.length > config.maxAttributeValueLength) {\n return value.slice(0, config.maxAttributeValueLength) + '...';\n }\n return value;\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value;\n }\n\n // Handle arrays\n if (Array.isArray(value)) {\n return value.map((item) => sanitizeValue(item, config, depth + 1));\n }\n\n // Handle objects\n if (typeof value === 'object') {\n try {\n // Check for circular references\n JSON.stringify(value);\n\n const sanitized: Record<string, unknown> = {};\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n sanitized[key] = sanitizeValue(\n (value as Record<string, unknown>)[key],\n config,\n depth + 1,\n );\n }\n }\n return sanitized;\n } catch {\n // Circular reference detected\n return '[CIRCULAR]';\n }\n }\n\n // Unsupported type (function, symbol, etc.)\n return `[${typeof value}]`;\n}\n\n/**\n * Validate and sanitize an events event\n * Returns { eventName, attributes } with sanitized values\n */\nexport function validateEvent(\n eventName: string,\n attributes?: EventAttributes,\n config?: Partial<ValidationConfig>,\n): { eventName: string; attributes?: EventAttributes } {\n const fullConfig = { ...DEFAULT_CONFIG, ...config };\n\n return {\n eventName: validateEventName(eventName, fullConfig),\n attributes: validateAttributes(attributes, fullConfig),\n };\n}\n\n/**\n * Get default validation config (for testing/customization)\n */\nexport function getDefaultValidationConfig(): ValidationConfig {\n return { ...DEFAULT_CONFIG };\n}\n","/**\n * Operation context tracking using AsyncLocalStorage\n *\n * This module provides a way to track operation names across async boundaries\n * so they can be automatically captured in events events.\n *\n * We cannot read span attributes from OpenTelemetry's API (it's write-only),\n * so we maintain our own async context storage.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\n/**\n * Operation context that flows through async operations\n */\nexport interface OperationContext {\n /**\n * The name of the current operation\n * This is set by trace() or span() and can be read by events\n */\n name: string;\n}\n\n/**\n * AsyncLocalStorage instance for tracking operation context\n */\nconst operationStorage = new AsyncLocalStorage<OperationContext>();\n\n/**\n * Get the current operation context (if any)\n *\n * @returns The current operation context, or undefined if not in an operation\n *\n * @example\n * ```typescript\n * const ctx = getOperationContext();\n * if (ctx) {\n * console.log('Current operation:', ctx.name);\n * }\n * ```\n */\nexport function getOperationContext(): OperationContext | undefined {\n return operationStorage.getStore();\n}\n\n/**\n * Run a function within an operation context\n *\n * This sets the operation name for the duration of the function execution,\n * including all async operations spawned from it.\n *\n * @param name - The operation name to set\n * @param fn - The function to execute within the context\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await runInOperationContext('user.create', async () => {\n * // Any events.trackEvent() calls here will automatically capture\n * // 'operation.name': 'user.create'\n * await createUser();\n * return 'success';\n * });\n * ```\n */\nexport function runInOperationContext<T>(name: string, fn: () => T): T {\n return operationStorage.run({ name }, fn);\n}\n\n/**\n * Update the operation name in the current context\n *\n * This is useful when you want to change the operation name within\n * an already-established context (e.g., when entering a nested span).\n *\n * @param name - The new operation name\n *\n * @example\n * ```typescript\n * runInOperationContext('parent.operation', () => {\n * // operation.name is 'parent.operation'\n *\n * updateOperationName('nested.operation');\n * // operation.name is now 'nested.operation'\n * });\n * ```\n */\nexport function updateOperationName(name: string): void {\n const store = operationStorage.getStore();\n if (store) {\n store.name = name;\n }\n}\n"]}
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ // src/metric-testing.ts
4
+ function createMetricsCollector() {
5
+ const events = [];
6
+ const funnelSteps = [];
7
+ const outcomes = [];
8
+ const values = [];
9
+ return {
10
+ getEvents() {
11
+ return [...events];
12
+ },
13
+ getFunnelSteps() {
14
+ return [...funnelSteps];
15
+ },
16
+ getOutcomes() {
17
+ return [...outcomes];
18
+ },
19
+ getValues() {
20
+ return [...values];
21
+ },
22
+ clear() {
23
+ events.length = 0;
24
+ funnelSteps.length = 0;
25
+ outcomes.length = 0;
26
+ values.length = 0;
27
+ },
28
+ recordEvent(event) {
29
+ events.push(event);
30
+ },
31
+ recordFunnelStep(step) {
32
+ funnelSteps.push(step);
33
+ },
34
+ recordOutcome(outcome) {
35
+ outcomes.push(outcome);
36
+ },
37
+ recordValue(value) {
38
+ values.push(value);
39
+ }
40
+ };
41
+ }
42
+ function assertEventTracked(options) {
43
+ const events = options.collector.getEvents();
44
+ const matching = events.filter((e) => e.event === options.eventName);
45
+ if (matching.length === 0) {
46
+ throw new Error(`No events found with name: ${options.eventName}`);
47
+ }
48
+ if (options.attributes) {
49
+ const matchingWithAttrs = matching.filter(
50
+ (e) => Object.entries(options.attributes).every(
51
+ ([key, value]) => e.attributes && e.attributes[key] === value
52
+ )
53
+ );
54
+ if (matchingWithAttrs.length === 0) {
55
+ throw new Error(
56
+ `Event ${options.eventName} found but attributes don't match: ${JSON.stringify(options.attributes)}`
57
+ );
58
+ }
59
+ }
60
+ }
61
+ function assertOutcomeTracked(options) {
62
+ const outcomes = options.collector.getOutcomes();
63
+ const matching = outcomes.filter(
64
+ (o) => o.operation === options.operation && o.status === options.status
65
+ );
66
+ if (matching.length === 0) {
67
+ throw new Error(
68
+ `No outcomes found with operation: ${options.operation} and status: ${options.status}`
69
+ );
70
+ }
71
+ }
72
+
73
+ exports.assertEventTracked = assertEventTracked;
74
+ exports.assertOutcomeTracked = assertOutcomeTracked;
75
+ exports.createMetricsCollector = createMetricsCollector;
76
+ //# sourceMappingURL=chunk-YTXEZ4SD.cjs.map
77
+ //# sourceMappingURL=chunk-YTXEZ4SD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/metric-testing.ts"],"names":[],"mappings":";;;AAkFO,SAAS,sBAAA,GAA2C;AACzD,EAAA,MAAM,SAAyB,EAAC;AAChC,EAAA,MAAM,cAAmC,EAAC;AAC1C,EAAA,MAAM,WAA6B,EAAC;AACpC,EAAA,MAAM,SAAyB,EAAC;AAEhC,EAAA,OAAO;AAAA,IACL,SAAA,GAA4B;AAC1B,MAAA,OAAO,CAAC,GAAG,MAAM,CAAA;AAAA,IACnB,CAAA;AAAA,IAEA,cAAA,GAAsC;AACpC,MAAA,OAAO,CAAC,GAAG,WAAW,CAAA;AAAA,IACxB,CAAA;AAAA,IAEA,WAAA,GAAgC;AAC9B,MAAA,OAAO,CAAC,GAAG,QAAQ,CAAA;AAAA,IACrB,CAAA;AAAA,IAEA,SAAA,GAA4B;AAC1B,MAAA,OAAO,CAAC,GAAG,MAAM,CAAA;AAAA,IACnB,CAAA;AAAA,IAEA,KAAA,GAAc;AACZ,MAAA,MAAA,CAAO,MAAA,GAAS,CAAA;AAChB,MAAA,WAAA,CAAY,MAAA,GAAS,CAAA;AACrB,MAAA,QAAA,CAAS,MAAA,GAAS,CAAA;AAClB,MAAA,MAAA,CAAO,M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AAA,CAAU,OAAA,CAAQ,UAAU,CAAC,CAAA;AAAA,OACpG;AAAA,IACF;AAAA,EACF;AACF;AAcO,SAAS,qBAAqB,OAAA,EAI5B;AACP,EAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,SAAA,CAAU,WAAA,EAAY;AAC/C,EAAA,MAAM,WAAW,QAAA,CAAS,MAAA;AAAA,IACxB,CAAC,MAAM,CAAA,CAAE,SAAA,KAAc,QAAQ,SAAA,IAAa,CAAA,CAAE,WAAW,OAAA,CAAQ;AAAA,GACnE;AAEA,EAAA,IAAI,QAAA,CAAS,WAAW,CAAA,EAAG;AACzB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,kCAAA,EAAqC,OAAA,CAAQ,SAAS,CAAA,aAAA,EAAgB,QAAQ,MAAM,CAAA;AAAA,KACtF;AAAA,EACF;AACF","file":"chunk-YTXEZ4SD.cjs","sourcesContent":["/**\n * Testing utilities for Metrics\n *\n * Provides in-memory collection of metrics for testing purposes.\n */\n\nimport type {\n EventAttributes,\n FunnelStatus,\n OutcomeStatus,\n} from './event-subscriber';\n\nexport interface MetricsEvent {\n event: string;\n attributes?: EventAttributes;\n service: string;\n timestamp: number;\n}\n\nexport interface MetricsFunnelStep {\n funnel: string;\n status: FunnelStatus;\n attributes?: EventAttributes;\n service: string;\n timestamp: number;\n}\n\nexport interface MetricsOutcome {\n operation: string;\n status: OutcomeStatus;\n attributes?: EventAttributes;\n service: string;\n timestamp: number;\n}\n\nexport interface MetricsValue {\n metric: string;\n value: number;\n attributes?: EventAttributes;\n service: string;\n timestamp: number;\n}\n\n/**\n * In-memory metrics collector for testing\n */\nexport interface MetricsCollector {\n /** Get all collected events */\n getEvents(): MetricsEvent[];\n /** Get all collected funnel steps */\n getFunnelSteps(): MetricsFunnelStep[];\n /** Get all collected outcomes */\n getOutcomes(): MetricsOutcome[];\n /** Get all collected values */\n getValues(): MetricsValue[];\n /** Clear all collected metrics */\n clear(): void;\n /** Record an event (internal use) */\n recordEvent(event: MetricsEvent): void;\n /** Record a funnel step (internal use) */\n recordFunnelStep(step: MetricsFunnelStep): void;\n /** Record an outcome (internal use) */\n recordOutcome(outcome: MetricsOutcome): void;\n /** Record a value (internal use) */\n recordValue(value: MetricsValue): void;\n}\n\n/**\n * Create an in-memory metrics collector for testing\n *\n * @example\n * ```typescript\n * const collector = createMetricsCollector()\n *\n * const metrics = new Metric('test-service', { collector })\n * metrics.trackEvent('order.completed', { orderId: '123' })\n *\n * const event =collector.getEvents()\n * expect(events).toHaveLength(1)\n * expect(events[0].event).toBe('order.completed')\n * ```\n */\nexport function createMetricsCollector(): MetricsCollector {\n const events: MetricsEvent[] = [];\n const funnelSteps: MetricsFunnelStep[] = [];\n const outcomes: MetricsOutcome[] = [];\n const values: MetricsValue[] = [];\n\n return {\n getEvents(): MetricsEvent[] {\n return [...events];\n },\n\n getFunnelSteps(): MetricsFunnelStep[] {\n return [...funnelSteps];\n },\n\n getOutcomes(): MetricsOutcome[] {\n return [...outcomes];\n },\n\n getValues(): MetricsValue[] {\n return [...values];\n },\n\n clear(): void {\n events.length = 0;\n funnelSteps.length = 0;\n outcomes.length = 0;\n values.length = 0;\n },\n\n recordEvent(event: MetricsEvent): void {\n events.push(event);\n },\n\n recordFunnelStep(step: MetricsFunnelStep): void {\n funnelSteps.push(step);\n },\n\n recordOutcome(outcome: MetricsOutcome): void {\n outcomes.push(outcome);\n },\n\n recordValue(value: MetricsValue): void {\n values.push(value);\n },\n };\n}\n\n/**\n * Assert that a metric event was tracked\n *\n * @example\n * ```typescript\n * assertEventTracked({\n * collector,\n * eventName: 'order.completed',\n * attributes: { orderId: '123' }\n * })\n * ```\n */\nexport function assertEventTracked(options: {\n collector: MetricsCollector;\n eventName: string;\n attributes?: Record<string, unknown>;\n}): void {\n const events = options.collector.getEvents();\n const matching = events.filter((e) => e.event === options.eventName);\n\n if (matching.length === 0) {\n throw new Error(`No events found with name: ${options.eventName}`);\n }\n\n if (options.attributes) {\n const matchingWithAttrs = matching.filter((e) =>\n Object.entries(options.attributes!).every(\n ([key, value]) => e.attributes && e.attributes[key] === value,\n ),\n );\n\n if (matchingWithAttrs.length === 0) {\n throw new Error(\n `Event ${options.eventName} found but attributes don't match: ${JSON.stringify(options.attributes)}`,\n );\n }\n }\n}\n\n/**\n * Assert that an outcome was tracked\n *\n * @example\n * ```typescript\n * assertOutcomeTracked({\n * collector,\n * operation: 'payment.process',\n * status: 'success'\n * })\n * ```\n */\nexport function assertOutcomeTracked(options: {\n collector: MetricsCollector;\n operation: string;\n status: 'success' | 'failure' | 'partial';\n}): void {\n const outcomes = options.collector.getOutcomes();\n const matching = outcomes.filter(\n (o) => o.operation === options.operation && o.status === options.status,\n );\n\n if (matching.length === 0) {\n throw new Error(\n `No outcomes found with operation: ${options.operation} and status: ${options.status}`,\n );\n }\n}\n"]}
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
6
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
7
+ }) : x)(function(x) {
8
+ if (typeof require !== "undefined") return require.apply(this, arguments);
9
+ throw Error('Dynamic require of "' + x + '" is not supported');
10
+ });
11
+ var __esm = (fn, res) => function __init() {
12
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ };
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+
28
+ export { __esm, __export, __require, __toCommonJS };
29
+ //# sourceMappingURL=chunk-Z6ZWNWWR.js.map
30
+ //# sourceMappingURL=chunk-Z6ZWNWWR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-Z6ZWNWWR.js"}
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var chunkY4Y2S7BM_cjs = require('./chunk-Y4Y2S7BM.cjs');
4
+ require('./chunk-URRW6M2C.cjs');
5
+ require('./chunk-G7VZBCD6.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "FEATURE_FLAGS", {
10
+ enumerable: true,
11
+ get: function () { return chunkY4Y2S7BM_cjs.FEATURE_FLAGS; }
12
+ });
13
+ Object.defineProperty(exports, "configure", {
14
+ enumerable: true,
15
+ get: function () { return chunkY4Y2S7BM_cjs.configure; }
16
+ });
17
+ Object.defineProperty(exports, "getConfig", {
18
+ enumerable: true,
19
+ get: function () { return chunkY4Y2S7BM_cjs.getConfig; }
20
+ });
21
+ Object.defineProperty(exports, "resetConfig", {
22
+ enumerable: true,
23
+ get: function () { return chunkY4Y2S7BM_cjs.resetConfig; }
24
+ });
25
+ //# sourceMappingURL=config.cjs.map
26
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"config.cjs"}
@@ -0,0 +1,75 @@
1
+ import { Tracer, Meter } from '@opentelemetry/api';
2
+ export { ILogger } from './logger.cjs';
3
+ import 'pino';
4
+
5
+ /**
6
+ * Global configuration for OpenTelemetry decorators
7
+ *
8
+ * Allows users to inject custom loggers, tracers, and meters
9
+ * while maintaining sensible defaults.
10
+ */
11
+
12
+ declare const FEATURE_FLAGS: {
13
+ /** Enable full auto-instrumentation (expensive, production only) */
14
+ readonly ENABLE_AUTO_INSTRUMENTATION: boolean;
15
+ /** Enable verbose logging (development only) */
16
+ readonly ENABLE_VERBOSE_LOGGING: boolean;
17
+ /** Enable metrics collection (production only) */
18
+ readonly ENABLE_METRICS_BY_DEFAULT: boolean;
19
+ /** Enable async resource detection (production only) */
20
+ readonly ENABLE_RESOURCE_DETECTION: boolean;
21
+ /** Enable tracing in all environments (can be disabled via autotel_TRACING=false) */
22
+ readonly ENABLE_TRACING: boolean;
23
+ /** Enable log redaction for sensitive fields (can be disabled via autotel_REDACTION=false) */
24
+ readonly ENABLE_REDACTION: boolean;
25
+ };
26
+ /**
27
+ * Global configuration options
28
+ */
29
+ interface InstrumentationConfig {
30
+ /**
31
+ * Tracer name for OpenTelemetry
32
+ * @default 'app'
33
+ */
34
+ tracerName?: string;
35
+ /**
36
+ * Meter name for OpenTelemetry metrics
37
+ * @default 'app'
38
+ */
39
+ meterName?: string;
40
+ /**
41
+ * Custom tracer instance (for advanced use cases like Datadog direct)
42
+ * @default trace.getTracer(tracerName)
43
+ */
44
+ tracer?: Tracer;
45
+ /**
46
+ * Custom meter instance
47
+ * @default metrics.getMeter(meterName)
48
+ */
49
+ meter?: Meter;
50
+ }
51
+ /**
52
+ * Configure global instrumentation behavior
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * import { configure } from 'autotel/config'
57
+ *
58
+ * configure({
59
+ * tracerName: 'my-app'
60
+ * })
61
+ * ```
62
+ */
63
+ declare function configure(options: InstrumentationConfig): void;
64
+ /**
65
+ * Get current configuration (internal use)
66
+ */
67
+ declare function getConfig(): Required<InstrumentationConfig> & {
68
+ featureFlags: typeof FEATURE_FLAGS;
69
+ };
70
+ /**
71
+ * Reset configuration to defaults (internal use - mainly for testing)
72
+ */
73
+ declare function resetConfig(): void;
74
+
75
+ export { FEATURE_FLAGS, type InstrumentationConfig, configure, getConfig, resetConfig };
@@ -0,0 +1,75 @@
1
+ import { Tracer, Meter } from '@opentelemetry/api';
2
+ export { ILogger } from './logger.js';
3
+ import 'pino';
4
+
5
+ /**
6
+ * Global configuration for OpenTelemetry decorators
7
+ *
8
+ * Allows users to inject custom loggers, tracers, and meters
9
+ * while maintaining sensible defaults.
10
+ */
11
+
12
+ declare const FEATURE_FLAGS: {
13
+ /** Enable full auto-instrumentation (expensive, production only) */
14
+ readonly ENABLE_AUTO_INSTRUMENTATION: boolean;
15
+ /** Enable verbose logging (development only) */
16
+ readonly ENABLE_VERBOSE_LOGGING: boolean;
17
+ /** Enable metrics collection (production only) */
18
+ readonly ENABLE_METRICS_BY_DEFAULT: boolean;
19
+ /** Enable async resource detection (production only) */
20
+ readonly ENABLE_RESOURCE_DETECTION: boolean;
21
+ /** Enable tracing in all environments (can be disabled via autotel_TRACING=false) */
22
+ readonly ENABLE_TRACING: boolean;
23
+ /** Enable log redaction for sensitive fields (can be disabled via autotel_REDACTION=false) */
24
+ readonly ENABLE_REDACTION: boolean;
25
+ };
26
+ /**
27
+ * Global configuration options
28
+ */
29
+ interface InstrumentationConfig {
30
+ /**
31
+ * Tracer name for OpenTelemetry
32
+ * @default 'app'
33
+ */
34
+ tracerName?: string;
35
+ /**
36
+ * Meter name for OpenTelemetry metrics
37
+ * @default 'app'
38
+ */
39
+ meterName?: string;
40
+ /**
41
+ * Custom tracer instance (for advanced use cases like Datadog direct)
42
+ * @default trace.getTracer(tracerName)
43
+ */
44
+ tracer?: Tracer;
45
+ /**
46
+ * Custom meter instance
47
+ * @default metrics.getMeter(meterName)
48
+ */
49
+ meter?: Meter;
50
+ }
51
+ /**
52
+ * Configure global instrumentation behavior
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * import { configure } from 'autotel/config'
57
+ *
58
+ * configure({
59
+ * tracerName: 'my-app'
60
+ * })
61
+ * ```
62
+ */
63
+ declare function configure(options: InstrumentationConfig): void;
64
+ /**
65
+ * Get current configuration (internal use)
66
+ */
67
+ declare function getConfig(): Required<InstrumentationConfig> & {
68
+ featureFlags: typeof FEATURE_FLAGS;
69
+ };
70
+ /**
71
+ * Reset configuration to defaults (internal use - mainly for testing)
72
+ */
73
+ declare function resetConfig(): void;
74
+
75
+ export { FEATURE_FLAGS, type InstrumentationConfig, configure, getConfig, resetConfig };
package/dist/config.js ADDED
@@ -0,0 +1,5 @@
1
+ export { FEATURE_FLAGS, configure, getConfig, resetConfig } from './chunk-KVGNW3FC.js';
2
+ import './chunk-P6JUDYNO.js';
3
+ import './chunk-Z6ZWNWWR.js';
4
+ //# sourceMappingURL=config.js.map
5
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"config.js"}