autotel 3.0.0 → 3.0.4

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 (114) hide show
  1. package/README.md +21 -4
  2. package/dist/attribute-redacting-processor.cjs +8 -8
  3. package/dist/attribute-redacting-processor.d.cts +10 -1
  4. package/dist/attribute-redacting-processor.d.ts +10 -1
  5. package/dist/attribute-redacting-processor.js +1 -1
  6. package/dist/attributes.cjs +21 -21
  7. package/dist/attributes.js +2 -2
  8. package/dist/auto.cjs +3 -3
  9. package/dist/auto.js +2 -2
  10. package/dist/{chunk-IUDXKLS4.js → chunk-34X3TKHA.js} +3 -3
  11. package/dist/{chunk-IUDXKLS4.js.map → chunk-34X3TKHA.js.map} +1 -1
  12. package/dist/{chunk-3QMFLJHJ.js → chunk-4LF6FV2V.js} +3 -3
  13. package/dist/{chunk-3QMFLJHJ.js.map → chunk-4LF6FV2V.js.map} +1 -1
  14. package/dist/{chunk-L7JDUDJD.cjs → chunk-AAYCDHH6.cjs} +7 -7
  15. package/dist/{chunk-L7JDUDJD.cjs.map → chunk-AAYCDHH6.cjs.map} +1 -1
  16. package/dist/{chunk-DWOBIBLY.cjs → chunk-AY2SY3MO.cjs} +5 -5
  17. package/dist/{chunk-DWOBIBLY.cjs.map → chunk-AY2SY3MO.cjs.map} +1 -1
  18. package/dist/{chunk-563EL6O6.cjs → chunk-BPO2PQ3T.cjs} +12 -8
  19. package/dist/chunk-BPO2PQ3T.cjs.map +1 -0
  20. package/dist/{chunk-ZSABTI3C.cjs → chunk-DAZ7EGR4.cjs} +17 -17
  21. package/dist/{chunk-ZSABTI3C.cjs.map → chunk-DAZ7EGR4.cjs.map} +1 -1
  22. package/dist/{chunk-ER43K7ES.js → chunk-DDXIUZEG.js} +3 -3
  23. package/dist/{chunk-ER43K7ES.js.map → chunk-DDXIUZEG.js.map} +1 -1
  24. package/dist/{chunk-JKIMEPI2.cjs → chunk-DQ2SUROF.cjs} +4 -4
  25. package/dist/{chunk-JKIMEPI2.cjs.map → chunk-DQ2SUROF.cjs.map} +1 -1
  26. package/dist/{chunk-DAAJLUTO.js → chunk-F3TNRW2P.js} +6 -5
  27. package/dist/chunk-F3TNRW2P.js.map +1 -0
  28. package/dist/{chunk-7HNQYHK4.js → chunk-HBLWOI6P.js} +3 -3
  29. package/dist/{chunk-7HNQYHK4.js.map → chunk-HBLWOI6P.js.map} +1 -1
  30. package/dist/{chunk-TDNKIHKT.js → chunk-JVWJDHDB.js} +13 -4
  31. package/dist/chunk-JVWJDHDB.js.map +1 -0
  32. package/dist/{chunk-CJ4PD2TZ.cjs → chunk-KKGM42RQ.cjs} +13 -13
  33. package/dist/{chunk-CJ4PD2TZ.cjs.map → chunk-KKGM42RQ.cjs.map} +1 -1
  34. package/dist/{chunk-KHGA4OST.cjs → chunk-LMFPZHI4.cjs} +5 -5
  35. package/dist/{chunk-KHGA4OST.cjs.map → chunk-LMFPZHI4.cjs.map} +1 -1
  36. package/dist/{chunk-CMNGGTQL.cjs → chunk-NXLRY2CE.cjs} +13 -4
  37. package/dist/chunk-NXLRY2CE.cjs.map +1 -0
  38. package/dist/{chunk-4DAG3RFS.js → chunk-OM4OSBOP.js} +4 -4
  39. package/dist/{chunk-4DAG3RFS.js.map → chunk-OM4OSBOP.js.map} +1 -1
  40. package/dist/{chunk-MOK3E54E.cjs → chunk-WSGAHSZQ.cjs} +34 -33
  41. package/dist/chunk-WSGAHSZQ.cjs.map +1 -0
  42. package/dist/{chunk-QG3U5ONP.js → chunk-Z7VAOK5X.js} +3 -3
  43. package/dist/{chunk-QG3U5ONP.js.map → chunk-Z7VAOK5X.js.map} +1 -1
  44. package/dist/{chunk-W35FVJBC.js → chunk-ZDPIWKWD.js} +9 -5
  45. package/dist/chunk-ZDPIWKWD.js.map +1 -0
  46. package/dist/correlation-id.cjs +11 -11
  47. package/dist/correlation-id.js +3 -3
  48. package/dist/decorators.cjs +5 -5
  49. package/dist/decorators.js +4 -4
  50. package/dist/event.cjs +7 -7
  51. package/dist/event.js +4 -4
  52. package/dist/functional.cjs +11 -11
  53. package/dist/functional.d.cts +20 -17
  54. package/dist/functional.d.ts +20 -17
  55. package/dist/functional.js +4 -4
  56. package/dist/http.cjs +4 -4
  57. package/dist/http.js +3 -3
  58. package/dist/index.cjs +226 -92
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.d.cts +67 -3
  61. package/dist/index.d.ts +67 -3
  62. package/dist/index.js +138 -15
  63. package/dist/index.js.map +1 -1
  64. package/dist/instrumentation.cjs +9 -9
  65. package/dist/instrumentation.js +2 -2
  66. package/dist/messaging.cjs +8 -8
  67. package/dist/messaging.js +5 -5
  68. package/dist/semantic-helpers.cjs +9 -9
  69. package/dist/semantic-helpers.js +5 -5
  70. package/dist/webhook.cjs +6 -6
  71. package/dist/webhook.js +4 -4
  72. package/dist/workflow-distributed.cjs +6 -6
  73. package/dist/workflow-distributed.js +4 -4
  74. package/dist/workflow.cjs +9 -9
  75. package/dist/workflow.js +5 -5
  76. package/package.json +43 -45
  77. package/skills/analyze-traces/SKILL.md +178 -0
  78. package/skills/autotel-core/SKILL.md +0 -7
  79. package/skills/autotel-events/SKILL.md +0 -6
  80. package/skills/autotel-frameworks/SKILL.md +0 -9
  81. package/skills/autotel-instrumentation/SKILL.md +0 -7
  82. package/skills/autotel-request-logging/SKILL.md +0 -8
  83. package/skills/autotel-structured-errors/SKILL.md +0 -7
  84. package/skills/build-audit-trails/SKILL.md +302 -0
  85. package/skills/debug-missing-spans/SKILL.md +248 -0
  86. package/skills/migrate-to-autotel/SKILL.md +268 -0
  87. package/skills/review-otel-patterns/SKILL.md +488 -0
  88. package/skills/review-otel-patterns/references/code-review.md +75 -0
  89. package/skills/review-otel-patterns/references/processor-pipeline.md +205 -0
  90. package/skills/review-otel-patterns/references/structured-errors.md +102 -0
  91. package/skills/review-otel-patterns/references/wide-spans.md +85 -0
  92. package/skills/tune-sampling/SKILL.md +210 -0
  93. package/src/attribute-redacting-processor.test.ts +6 -4
  94. package/src/attribute-redacting-processor.ts +11 -2
  95. package/src/drain-toolkit.test.ts +113 -0
  96. package/src/drain-toolkit.ts +129 -0
  97. package/src/enricher-toolkit.test.ts +67 -0
  98. package/src/enricher-toolkit.ts +79 -0
  99. package/src/functional.test.ts +18 -0
  100. package/src/functional.ts +32 -20
  101. package/src/index.ts +19 -0
  102. package/src/redact-values.test.ts +24 -10
  103. package/src/redact-values.ts +9 -2
  104. package/src/request-logger.test.ts +91 -0
  105. package/src/request-logger.ts +36 -2
  106. package/src/structured-error.test.ts +4 -1
  107. package/bin/intent.js +0 -6
  108. package/dist/chunk-563EL6O6.cjs.map +0 -1
  109. package/dist/chunk-CMNGGTQL.cjs.map +0 -1
  110. package/dist/chunk-DAAJLUTO.js.map +0 -1
  111. package/dist/chunk-MOK3E54E.cjs.map +0 -1
  112. package/dist/chunk-TDNKIHKT.js.map +0 -1
  113. package/dist/chunk-W35FVJBC.js.map +0 -1
  114. package/src/package-manifest.test.ts +0 -24
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkL7JDUDJD_cjs = require('./chunk-L7JDUDJD.cjs');
4
- require('./chunk-MOK3E54E.cjs');
3
+ var chunkAAYCDHH6_cjs = require('./chunk-AAYCDHH6.cjs');
4
+ require('./chunk-WSGAHSZQ.cjs');
5
5
  require('./chunk-NCSMD3TK.cjs');
6
6
  require('./chunk-VQTCQKHQ.cjs');
7
- require('./chunk-CJ4PD2TZ.cjs');
8
- require('./chunk-563EL6O6.cjs');
7
+ require('./chunk-KKGM42RQ.cjs');
8
+ require('./chunk-BPO2PQ3T.cjs');
9
9
  require('./chunk-OC6X2VIN.cjs');
10
10
  require('./chunk-CEAQK2QY.cjs');
11
11
  require('./chunk-ZNMBW67B.cjs');
12
12
  require('./chunk-IOYFAFHJ.cjs');
13
- require('./chunk-CMNGGTQL.cjs');
13
+ require('./chunk-NXLRY2CE.cjs');
14
14
  require('./chunk-CU6IDACR.cjs');
15
15
  require('./chunk-6S5RUKU3.cjs');
16
16
  require('./chunk-YS6C2YJE.cjs');
@@ -24,19 +24,19 @@ require('./chunk-JEQ2X3Z6.cjs');
24
24
 
25
25
  Object.defineProperty(exports, "traceDB", {
26
26
  enumerable: true,
27
- get: function () { return chunkL7JDUDJD_cjs.traceDB; }
27
+ get: function () { return chunkAAYCDHH6_cjs.traceDB; }
28
28
  });
29
29
  Object.defineProperty(exports, "traceHTTP", {
30
30
  enumerable: true,
31
- get: function () { return chunkL7JDUDJD_cjs.traceHTTP; }
31
+ get: function () { return chunkAAYCDHH6_cjs.traceHTTP; }
32
32
  });
33
33
  Object.defineProperty(exports, "traceLLM", {
34
34
  enumerable: true,
35
- get: function () { return chunkL7JDUDJD_cjs.traceLLM; }
35
+ get: function () { return chunkAAYCDHH6_cjs.traceLLM; }
36
36
  });
37
37
  Object.defineProperty(exports, "traceMessaging", {
38
38
  enumerable: true,
39
- get: function () { return chunkL7JDUDJD_cjs.traceMessaging; }
39
+ get: function () { return chunkAAYCDHH6_cjs.traceMessaging; }
40
40
  });
41
41
  //# sourceMappingURL=semantic-helpers.cjs.map
42
42
  //# sourceMappingURL=semantic-helpers.cjs.map
@@ -1,14 +1,14 @@
1
- export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-7HNQYHK4.js';
2
- import './chunk-DAAJLUTO.js';
1
+ export { traceDB, traceHTTP, traceLLM, traceMessaging } from './chunk-HBLWOI6P.js';
2
+ import './chunk-F3TNRW2P.js';
3
3
  import './chunk-DSMSIVTG.js';
4
4
  import './chunk-SEO6NAQT.js';
5
- import './chunk-QG3U5ONP.js';
6
- import './chunk-W35FVJBC.js';
5
+ import './chunk-Z7VAOK5X.js';
6
+ import './chunk-ZDPIWKWD.js';
7
7
  import './chunk-3SDILILG.js';
8
8
  import './chunk-A4E5AQFK.js';
9
9
  import './chunk-WGWSHJ2N.js';
10
10
  import './chunk-GYR5K654.js';
11
- import './chunk-TDNKIHKT.js';
11
+ import './chunk-JVWJDHDB.js';
12
12
  import './chunk-6UQRVUN3.js';
13
13
  import './chunk-3QXBFGKP.js';
14
14
  import './chunk-33WTKH7X.js';
package/dist/webhook.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
4
- var chunkMOK3E54E_cjs = require('./chunk-MOK3E54E.cjs');
4
+ var chunkWSGAHSZQ_cjs = require('./chunk-WSGAHSZQ.cjs');
5
5
  require('./chunk-NCSMD3TK.cjs');
6
6
  require('./chunk-VQTCQKHQ.cjs');
7
- var chunkCJ4PD2TZ_cjs = require('./chunk-CJ4PD2TZ.cjs');
8
- require('./chunk-563EL6O6.cjs');
7
+ var chunkKKGM42RQ_cjs = require('./chunk-KKGM42RQ.cjs');
8
+ require('./chunk-BPO2PQ3T.cjs');
9
9
  require('./chunk-OC6X2VIN.cjs');
10
10
  require('./chunk-CEAQK2QY.cjs');
11
11
  require('./chunk-ZNMBW67B.cjs');
12
12
  require('./chunk-IOYFAFHJ.cjs');
13
- require('./chunk-CMNGGTQL.cjs');
13
+ require('./chunk-NXLRY2CE.cjs');
14
14
  require('./chunk-CU6IDACR.cjs');
15
15
  require('./chunk-6S5RUKU3.cjs');
16
16
  require('./chunk-YS6C2YJE.cjs');
@@ -158,7 +158,7 @@ function createParkingLot(config) {
158
158
  },
159
159
  traceCallback(callbackConfig) {
160
160
  return (fnFactory) => {
161
- return chunkMOK3E54E_cjs.trace(
161
+ return chunkWSGAHSZQ_cjs.trace(
162
162
  {
163
163
  name: callbackConfig.name,
164
164
  spanKind: api.SpanKind.SERVER
@@ -202,7 +202,7 @@ function createParkingLot(config) {
202
202
  const error = new Error(
203
203
  `Required parked context not found for key: ${correlationKey}`
204
204
  );
205
- chunkCJ4PD2TZ_cjs.recordStructuredError(baseCtx, error);
205
+ chunkKKGM42RQ_cjs.recordStructuredError(baseCtx, error);
206
206
  throw error;
207
207
  }
208
208
  }
package/dist/webhook.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { emitCorrelatedEvent } from './chunk-KIL5CUN6.js';
2
- import { trace } from './chunk-DAAJLUTO.js';
2
+ import { trace } from './chunk-F3TNRW2P.js';
3
3
  import './chunk-DSMSIVTG.js';
4
4
  import './chunk-SEO6NAQT.js';
5
- import { recordStructuredError } from './chunk-QG3U5ONP.js';
6
- import './chunk-W35FVJBC.js';
5
+ import { recordStructuredError } from './chunk-Z7VAOK5X.js';
6
+ import './chunk-ZDPIWKWD.js';
7
7
  import './chunk-3SDILILG.js';
8
8
  import './chunk-A4E5AQFK.js';
9
9
  import './chunk-WGWSHJ2N.js';
10
10
  import './chunk-GYR5K654.js';
11
- import './chunk-TDNKIHKT.js';
11
+ import './chunk-JVWJDHDB.js';
12
12
  import './chunk-6UQRVUN3.js';
13
13
  import './chunk-3QXBFGKP.js';
14
14
  import './chunk-33WTKH7X.js';
@@ -2,16 +2,16 @@
2
2
 
3
3
  var chunk4P6ZOARG_cjs = require('./chunk-4P6ZOARG.cjs');
4
4
  var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
5
- var chunkMOK3E54E_cjs = require('./chunk-MOK3E54E.cjs');
5
+ var chunkWSGAHSZQ_cjs = require('./chunk-WSGAHSZQ.cjs');
6
6
  require('./chunk-NCSMD3TK.cjs');
7
7
  require('./chunk-VQTCQKHQ.cjs');
8
- require('./chunk-CJ4PD2TZ.cjs');
9
- require('./chunk-563EL6O6.cjs');
8
+ require('./chunk-KKGM42RQ.cjs');
9
+ require('./chunk-BPO2PQ3T.cjs');
10
10
  require('./chunk-OC6X2VIN.cjs');
11
11
  require('./chunk-CEAQK2QY.cjs');
12
12
  require('./chunk-ZNMBW67B.cjs');
13
13
  require('./chunk-IOYFAFHJ.cjs');
14
- require('./chunk-CMNGGTQL.cjs');
14
+ require('./chunk-NXLRY2CE.cjs');
15
15
  require('./chunk-CU6IDACR.cjs');
16
16
  require('./chunk-6S5RUKU3.cjs');
17
17
  require('./chunk-YS6C2YJE.cjs');
@@ -59,7 +59,7 @@ var WorkflowBaggage = chunkINJD3G4K_cjs.createSafeBaggageSchema(workflowBaggageF
59
59
  function traceDistributedWorkflow(config) {
60
60
  const spanName = `workflow.${config.name}`;
61
61
  return (fnFactory) => {
62
- return chunkMOK3E54E_cjs.trace(
62
+ return chunkWSGAHSZQ_cjs.trace(
63
63
  { name: spanName, spanKind: api.SpanKind.INTERNAL },
64
64
  (baseCtx) => {
65
65
  return async (...args) => {
@@ -158,7 +158,7 @@ function traceDistributedWorkflow(config) {
158
158
  function traceDistributedStep(config) {
159
159
  const spanName = `workflow.step.${config.name}`;
160
160
  return (fnFactory) => {
161
- return chunkMOK3E54E_cjs.trace(
161
+ return chunkWSGAHSZQ_cjs.trace(
162
162
  { name: spanName, spanKind: api.SpanKind.INTERNAL },
163
163
  (baseCtx) => {
164
164
  return async (...args) => {
@@ -1,15 +1,15 @@
1
1
  import { emitCorrelatedEvent } from './chunk-KIL5CUN6.js';
2
2
  import { createSafeBaggageSchema } from './chunk-4IFSYQVX.js';
3
- import { trace } from './chunk-DAAJLUTO.js';
3
+ import { trace } from './chunk-F3TNRW2P.js';
4
4
  import './chunk-DSMSIVTG.js';
5
5
  import './chunk-SEO6NAQT.js';
6
- import './chunk-QG3U5ONP.js';
7
- import './chunk-W35FVJBC.js';
6
+ import './chunk-Z7VAOK5X.js';
7
+ import './chunk-ZDPIWKWD.js';
8
8
  import './chunk-3SDILILG.js';
9
9
  import './chunk-A4E5AQFK.js';
10
10
  import './chunk-WGWSHJ2N.js';
11
11
  import './chunk-GYR5K654.js';
12
- import './chunk-TDNKIHKT.js';
12
+ import './chunk-JVWJDHDB.js';
13
13
  import './chunk-6UQRVUN3.js';
14
14
  import './chunk-3QXBFGKP.js';
15
15
  import './chunk-33WTKH7X.js';
package/dist/workflow.cjs CHANGED
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkDWOBIBLY_cjs = require('./chunk-DWOBIBLY.cjs');
3
+ var chunkAY2SY3MO_cjs = require('./chunk-AY2SY3MO.cjs');
4
4
  require('./chunk-4P6ZOARG.cjs');
5
- require('./chunk-MOK3E54E.cjs');
5
+ require('./chunk-WSGAHSZQ.cjs');
6
6
  require('./chunk-NCSMD3TK.cjs');
7
7
  require('./chunk-VQTCQKHQ.cjs');
8
- require('./chunk-CJ4PD2TZ.cjs');
9
- require('./chunk-563EL6O6.cjs');
8
+ require('./chunk-KKGM42RQ.cjs');
9
+ require('./chunk-BPO2PQ3T.cjs');
10
10
  require('./chunk-OC6X2VIN.cjs');
11
11
  require('./chunk-CEAQK2QY.cjs');
12
12
  require('./chunk-ZNMBW67B.cjs');
13
13
  require('./chunk-IOYFAFHJ.cjs');
14
- require('./chunk-CMNGGTQL.cjs');
14
+ require('./chunk-NXLRY2CE.cjs');
15
15
  require('./chunk-CU6IDACR.cjs');
16
16
  require('./chunk-6S5RUKU3.cjs');
17
17
  require('./chunk-YS6C2YJE.cjs');
@@ -25,19 +25,19 @@ require('./chunk-JEQ2X3Z6.cjs');
25
25
 
26
26
  Object.defineProperty(exports, "getCurrentWorkflowContext", {
27
27
  enumerable: true,
28
- get: function () { return chunkDWOBIBLY_cjs.getCurrentWorkflowContext; }
28
+ get: function () { return chunkAY2SY3MO_cjs.getCurrentWorkflowContext; }
29
29
  });
30
30
  Object.defineProperty(exports, "isInWorkflow", {
31
31
  enumerable: true,
32
- get: function () { return chunkDWOBIBLY_cjs.isInWorkflow; }
32
+ get: function () { return chunkAY2SY3MO_cjs.isInWorkflow; }
33
33
  });
34
34
  Object.defineProperty(exports, "traceStep", {
35
35
  enumerable: true,
36
- get: function () { return chunkDWOBIBLY_cjs.traceStep; }
36
+ get: function () { return chunkAY2SY3MO_cjs.traceStep; }
37
37
  });
38
38
  Object.defineProperty(exports, "traceWorkflow", {
39
39
  enumerable: true,
40
- get: function () { return chunkDWOBIBLY_cjs.traceWorkflow; }
40
+ get: function () { return chunkAY2SY3MO_cjs.traceWorkflow; }
41
41
  });
42
42
  //# sourceMappingURL=workflow.cjs.map
43
43
  //# sourceMappingURL=workflow.cjs.map
package/dist/workflow.js CHANGED
@@ -1,15 +1,15 @@
1
- export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-3QMFLJHJ.js';
1
+ export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-4LF6FV2V.js';
2
2
  import './chunk-KIL5CUN6.js';
3
- import './chunk-DAAJLUTO.js';
3
+ import './chunk-F3TNRW2P.js';
4
4
  import './chunk-DSMSIVTG.js';
5
5
  import './chunk-SEO6NAQT.js';
6
- import './chunk-QG3U5ONP.js';
7
- import './chunk-W35FVJBC.js';
6
+ import './chunk-Z7VAOK5X.js';
7
+ import './chunk-ZDPIWKWD.js';
8
8
  import './chunk-3SDILILG.js';
9
9
  import './chunk-A4E5AQFK.js';
10
10
  import './chunk-WGWSHJ2N.js';
11
11
  import './chunk-GYR5K654.js';
12
- import './chunk-TDNKIHKT.js';
12
+ import './chunk-JVWJDHDB.js';
13
13
  import './chunk-6UQRVUN3.js';
14
14
  import './chunk-3QXBFGKP.js';
15
15
  import './chunk-33WTKH7X.js';
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "autotel",
3
- "version": "3.0.0",
3
+ "version": "3.0.4",
4
4
  "description": "Write Once, Observe Anywhere",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "type": "module",
8
- "sideEffects": false,
8
+ "sideEffects": [
9
+ "./dist/chunk-*.js",
10
+ "./dist/chunk-*.cjs"
11
+ ],
9
12
  "exports": {
10
13
  ".": {
11
14
  "types": "./dist/index.d.ts",
@@ -225,9 +228,7 @@
225
228
  "dist",
226
229
  "src",
227
230
  "README.md",
228
- "skills",
229
- "!skills/_artifacts",
230
- "bin"
231
+ "skills"
231
232
  ],
232
233
  "keywords": [
233
234
  "opentelemetry",
@@ -250,33 +251,32 @@
250
251
  "license": "MIT",
251
252
  "dependencies": {
252
253
  "@opentelemetry/api": "^1.9.1",
253
- "@opentelemetry/api-logs": "^0.215.0",
254
- "@opentelemetry/exporter-logs-otlp-http": "^0.215.0",
255
- "@opentelemetry/exporter-metrics-otlp-http": "^0.215.0",
256
- "@opentelemetry/exporter-trace-otlp-http": "^0.215.0",
257
- "@opentelemetry/instrumentation": "^0.215.0",
258
- "@opentelemetry/resources": "^2.7.0",
259
- "@opentelemetry/sdk-logs": "^0.215.0",
260
- "@opentelemetry/sdk-metrics": "^2.7.0",
261
- "@opentelemetry/sdk-node": "^0.215.0",
262
- "@opentelemetry/sdk-trace-base": "^2.7.0",
254
+ "@opentelemetry/api-logs": "^0.216.0",
255
+ "@opentelemetry/exporter-logs-otlp-http": "^0.216.0",
256
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.216.0",
257
+ "@opentelemetry/exporter-trace-otlp-http": "^0.216.0",
258
+ "@opentelemetry/instrumentation": "^0.216.0",
259
+ "@opentelemetry/resources": "^2.7.1",
260
+ "@opentelemetry/sdk-logs": "^0.216.0",
261
+ "@opentelemetry/sdk-metrics": "^2.7.1",
262
+ "@opentelemetry/sdk-node": "^0.216.0",
263
+ "@opentelemetry/sdk-trace-base": "^2.7.1",
263
264
  "@opentelemetry/semantic-conventions": "^1.40.0",
264
- "import-in-the-middle": "^3.0.1",
265
- "@tanstack/intent": "^0.0.36"
265
+ "import-in-the-middle": "^3.0.1"
266
266
  },
267
267
  "peerDependencies": {
268
- "@opentelemetry/auto-instrumentations-node": "^0.73.0",
269
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.215.0",
270
- "@opentelemetry/exporter-metrics-otlp-grpc": "^0.215.0",
271
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.215.0",
272
- "@opentelemetry/resource-detector-aws": "^2.15.0",
273
- "@opentelemetry/resource-detector-container": "^0.8.6",
274
- "@opentelemetry/resource-detector-gcp": "^0.50.0",
275
- "@opentelemetry/sdk-trace-node": "^2.7.0",
268
+ "@opentelemetry/auto-instrumentations-node": "^0.74.0",
269
+ "@opentelemetry/exporter-logs-otlp-grpc": "^0.216.0",
270
+ "@opentelemetry/exporter-metrics-otlp-grpc": "^0.216.0",
271
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.216.0",
272
+ "@opentelemetry/resource-detector-aws": "^2.16.0",
273
+ "@opentelemetry/resource-detector-container": "^0.8.7",
274
+ "@opentelemetry/resource-detector-gcp": "^0.51.0",
275
+ "@opentelemetry/sdk-trace-node": "^2.7.1",
276
276
  "@traceloop/node-server-sdk": "^0.26.0",
277
277
  "pino": "^10.3.1",
278
278
  "pino-pretty": "^13.1.3",
279
- "yaml": "^2.8.3"
279
+ "yaml": "^2.8.4"
280
280
  },
281
281
  "peerDependenciesMeta": {
282
282
  "@opentelemetry/auto-instrumentations-node": {
@@ -319,22 +319,22 @@
319
319
  "devDependencies": {
320
320
  "@arethetypeswrong/cli": "^0.18.2",
321
321
  "@edge-runtime/vm": "^5.0.0",
322
- "@opentelemetry/auto-instrumentations-node": "^0.73.0",
323
- "@opentelemetry/context-async-hooks": "^2.7.0",
324
- "@opentelemetry/exporter-logs-otlp-grpc": "^0.215.0",
325
- "@opentelemetry/exporter-metrics-otlp-grpc": "^0.215.0",
326
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.215.0",
327
- "@opentelemetry/resource-detector-aws": "^2.15.0",
328
- "@opentelemetry/resource-detector-container": "^0.8.6",
329
- "@opentelemetry/resource-detector-gcp": "^0.50.0",
330
- "@opentelemetry/sdk-trace-node": "^2.7.0",
331
- "@swc/core": "^1.15.30",
322
+ "@opentelemetry/auto-instrumentations-node": "^0.74.0",
323
+ "@opentelemetry/context-async-hooks": "^2.7.1",
324
+ "@opentelemetry/exporter-logs-otlp-grpc": "^0.216.0",
325
+ "@opentelemetry/exporter-metrics-otlp-grpc": "^0.216.0",
326
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.216.0",
327
+ "@opentelemetry/resource-detector-aws": "^2.16.0",
328
+ "@opentelemetry/resource-detector-container": "^0.8.7",
329
+ "@opentelemetry/resource-detector-gcp": "^0.51.0",
330
+ "@opentelemetry/sdk-trace-node": "^2.7.1",
331
+ "@swc/core": "^1.15.32",
332
332
  "@total-typescript/ts-reset": "^0.6.1",
333
333
  "@total-typescript/tsconfig": "^1.0.4",
334
334
  "@types/eslint-config-prettier": "^6.11.3",
335
335
  "@types/node": "^25.6.0",
336
- "@typescript-eslint/eslint-plugin": "^8.59.0",
337
- "@typescript-eslint/parser": "^8.59.0",
336
+ "@typescript-eslint/eslint-plugin": "^8.59.1",
337
+ "@typescript-eslint/parser": "^8.59.1",
338
338
  "eslint-config-prettier": "^10.1.8",
339
339
  "eslint-plugin-unicorn": "^64.0.0",
340
340
  "pino": "^10.3.1",
@@ -343,13 +343,13 @@
343
343
  "tsup": "^8.5.1",
344
344
  "tsx": "^4.21.0",
345
345
  "typescript": "^6.0.3",
346
- "typescript-eslint": "^8.59.0",
346
+ "typescript-eslint": "^8.59.1",
347
347
  "unplugin-swc": "^1.5.9",
348
348
  "vite-tsconfig-paths": "^6.1.1",
349
349
  "vitest": "^4.1.5",
350
350
  "vitest-mock-extended": "^4.0.0",
351
351
  "winston": "^3.19.0",
352
- "yaml": "^2.8.3"
352
+ "yaml": "^2.8.4"
353
353
  },
354
354
  "repository": {
355
355
  "type": "git",
@@ -359,15 +359,12 @@
359
359
  "url": "https://github.com/jagreehal/autotel/issues"
360
360
  },
361
361
  "homepage": "https://github.com/jagreehal/autotel#readme",
362
- "bin": {
363
- "intent": "./bin/intent.js"
364
- },
365
362
  "scripts": {
366
363
  "build": "tsup",
367
364
  "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
368
365
  "dev": "tsup --watch",
369
- "lint": "npx eslint src/**/*.ts",
370
- "lint:fix": "npx eslint src/**/*.ts --fix",
366
+ "lint": "eslint src/**/*.ts",
367
+ "lint:fix": "eslint src/**/*.ts --fix",
371
368
  "format": "prettier --write .",
372
369
  "format:check": "prettier --check src/**/*.ts",
373
370
  "type-check": "tsc --noEmit",
@@ -375,6 +372,7 @@
375
372
  "test:watch": "vitest --config vitest.unit.config.ts",
376
373
  "test:integration": "vitest run --config vitest.integration.config.ts",
377
374
  "test:integration:watch": "vitest --config vitest.integration.config.ts",
375
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
378
376
  "test:all": "pnpm test && pnpm test:integration",
379
377
  "check-format": "prettier --check ./src",
380
378
  "check-exports": "attw --pack . --ignore-rules false-esm no-resolution cjs-resolves-to-esm",
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: analyze-traces
3
+ description: >
4
+ Analyze OpenTelemetry traces and structured logs from a running autotel service to debug errors,
5
+ investigate latency, follow requests across services, and surface cardinality / attribute hygiene
6
+ problems. Works with traces from any OTLP backend (Honeycomb, Grafana Tempo, Datadog, Jaeger,
7
+ Sentry, Axiom, HyperDX, …) plus the local `.autotel/spans/` dump and `InMemorySpanExporter` in tests.
8
+ license: MIT
9
+ ---
10
+
11
+ # Analyze traces
12
+
13
+ This skill teaches an AI assistant how to read and reason about OpenTelemetry traces produced by autotel — whether they're sitting in a backend, exported to a local JSON dump, or captured in a test.
14
+
15
+ ## When to use
16
+
17
+ - Debugging a failing endpoint after deploy
18
+ - Investigating latency regressions (p50 / p95 / p99 spike)
19
+ - Following a single request across browser → server → queue → worker
20
+ - Auditing attribute hygiene (cardinality, PII leak risk, noise)
21
+ - Spot-checking that a new instrumentation actually produces the spans you expected
22
+
23
+ ## Input formats
24
+
25
+ | Source | How to access |
26
+ | ------------------------------ | ------------------------------------------------------------------ |
27
+ | Local debug dump | `.autotel/spans/*.ndjson` — one span per line, OTLP JSON shape |
28
+ | `InMemorySpanExporter` (tests) | `exporter.getFinishedSpans()` |
29
+ | Backend (interactive) | Jaeger / Tempo / Honeycomb UI; Datadog Trace Search; etc. |
30
+ | Backend (programmatic) | Honeycomb Query API, Tempo `/api/search`, Datadog Logs / Trace API |
31
+
32
+ ## The shape of an autotel span
33
+
34
+ ```json
35
+ {
36
+ "name": "POST /api/checkout",
37
+ "context": { "traceId": "…", "spanId": "…" },
38
+ "parentSpanId": "…",
39
+ "kind": "SERVER",
40
+ "startTimeUnixNano": "…",
41
+ "endTimeUnixNano": "…",
42
+ "status": { "code": "OK" },
43
+ "attributes": {
44
+ "service.name": "checkout",
45
+ "http.request.method": "POST",
46
+ "url.full": "https://api.example.com/api/checkout",
47
+ "http.response.status_code": 200,
48
+ "user.id": "usr_123",
49
+ "user.plan": "enterprise",
50
+ "cart.items": 3,
51
+ "cart.total": 14999,
52
+ "_correlationId": "01J…"
53
+ },
54
+ "events": [
55
+ {
56
+ "name": "log.emit.manual",
57
+ "attributes": { "level": "info", "stage": "validated" }
58
+ }
59
+ ],
60
+ "links": [],
61
+ "resource": {
62
+ "service.name": "checkout",
63
+ "deploy.id": "v2025.05.04-1"
64
+ }
65
+ }
66
+ ```
67
+
68
+ Key conventions to recognise:
69
+
70
+ - `service.name` distinguishes services in a multi-service trace.
71
+ - `_correlationId` (autotel-specific) is stable within a logical unit of work even across forked child spans (`_parentCorrelationId` ties them).
72
+ - `gen_ai.*` attributes follow OpenTelemetry gen-ai semantic conventions for LLM calls.
73
+ - `exception.*` attributes (auto-set by `createStructuredError`) carry `type`, `message`, `stacktrace`.
74
+
75
+ ## Common investigations
76
+
77
+ ### "Why is endpoint X failing?"
78
+
79
+ 1. Find the trace: filter `service.name = "<svc>" AND http.route = "<route>" AND status = error` for the last hour.
80
+ 2. Open the slowest / latest matching trace.
81
+ 3. Inspect the root span's `exception.message` and `exception.stacktrace`.
82
+ 4. Walk down the child spans — the deepest span with `status.code = ERROR` is usually the culprit.
83
+ 5. If using `createStructuredError`, look for `code`, `why`, `internal.*` attributes. They usually answer the "why" without you reading code.
84
+
85
+ ### "Why is endpoint X slow?"
86
+
87
+ 1. Find a slow trace: `service.name = "<svc>" AND http.route = "<route>" AND duration > p99(duration)`.
88
+ 2. View the waterfall — pinpoint the longest child span by self-time (not wall time).
89
+ 3. Common offenders:
90
+ - **Sequential awaits that should be parallel** — sibling spans run end-to-end instead of overlapping.
91
+ - **N+1 queries** — many short same-named spans (`SELECT * FROM …`) under one parent.
92
+ - **Cold starts** — `faas.coldstart=true` in Workers or Lambda.
93
+ - **Tool retries** — gen-ai spans with `gen_ai.response.finish_reason = error` followed by another call.
94
+
95
+ ### "Follow this user across services"
96
+
97
+ Use `_correlationId` (or `user.id` if you have it):
98
+
99
+ ```
100
+ service.name in (web, api, worker) AND _correlationId = "01J…"
101
+ ORDER BY startTime
102
+ ```
103
+
104
+ Each service contributes spans with the same `traceId` (W3C trace context propagation handles this automatically with autotel's global fetch instrumentation).
105
+
106
+ ### "Did the new instrumentation actually fire?"
107
+
108
+ In a test, dump the in-memory exporter:
109
+
110
+ ```typescript
111
+ import { InMemorySpanExporter } from 'autotel/exporters';
112
+ const exporter = new InMemorySpanExporter();
113
+ // … run the code under test
114
+ const spans = exporter.getFinishedSpans();
115
+ console.log(spans.map((s) => ({ name: s.name, attrs: s.attributes })));
116
+ ```
117
+
118
+ Or live, point the SDK at a local file dump:
119
+
120
+ ```typescript
121
+ init({ service: 'my-app', debug: 'pretty', spanDumpPath: '.autotel/spans' });
122
+ ```
123
+
124
+ …then `tail -f .autotel/spans/*.ndjson | jq` while exercising the feature.
125
+
126
+ ## Cardinality / hygiene audits
127
+
128
+ | Check | Query / heuristic |
129
+ | ----------------------------- | --------------------------------------------------------------------------------------------------------------- |
130
+ | **Span name cardinality** | Top-K distinct `name` per service. Anything > a few hundred is a red flag — likely an unnormalised URL. |
131
+ | **Per-attribute cardinality** | `unique(attribute_value)` per `attribute_key`. UUIDs / emails / `Date.now()` ids in attributes blow up storage. |
132
+ | **Missing `service.name`** | Spans where the resource attribute is empty or `"app"` — fix at the SDK init. |
133
+ | **PII smell** | Look for raw `@`, leading digit-runs of length 16, or `eyJ` prefixes — your redactor is off. |
134
+ | **Health-check noise** | Spans with `http.route in (/healthz, /ready)`. Drop with `FilteringSpanProcessor`. |
135
+
136
+ ## Reading gen-ai traces
137
+
138
+ LLM calls produce a parent span (kind `CLIENT`) with children for each tool call:
139
+
140
+ | Attribute | Meaning |
141
+ | ---------------------------------------------------------- | ---------------------------------------- |
142
+ | `gen_ai.system` | Provider (`openai`, `anthropic`, …) |
143
+ | `gen_ai.request.model` | Model id |
144
+ | `gen_ai.usage.input_tokens` / `output_tokens` | Token count |
145
+ | `gen_ai.usage.cache_read_tokens` / `cache_creation_tokens` | Cache hits |
146
+ | `gen_ai.response.finish_reason` | `stop`, `tool_calls`, `length`, `error` |
147
+ | `gen_ai.tool.name` | Tool invoked (on tool-call child spans) |
148
+ | `gen_ai.cost.usd` | Estimated cost (if pricing map provided) |
149
+
150
+ Common findings:
151
+
152
+ - High `gen_ai.usage.input_tokens` with low `cache_read_tokens` → enable prompt caching.
153
+ - Many sequential tool-call spans → consider parallel tool calls if the model supports it.
154
+ - `gen_ai.response.finish_reason = length` → bump `max_tokens`.
155
+
156
+ ## When the trace is missing
157
+
158
+ If you expected a span and there isn't one:
159
+
160
+ 1. **Sampling.** Did head sampling drop it? Check `sampling.rates` and `recordedSpans` in any subscriber.
161
+ 2. **Workers without `waitUntil`.** Did the request return before the exporter flushed? Move to `defineWorkerFetch` / `wrapModule`.
162
+ 3. **`instrumentation.disabled = true`** — check env-conditional config.
163
+ 4. **Exporter rejected.** Check service logs for `OTLP exporter` 4xx / 5xx — bad token, wrong dataset.
164
+
165
+ ## Output format
166
+
167
+ When summarising an investigation, lead with the **decision-changing fact**, then the supporting evidence:
168
+
169
+ ```
170
+ Failure cause: payment.declined (Stripe code: insufficient_funds)
171
+ - Trace: 9d3a…b21
172
+ - 38 / 412 checkout requests in the last hour failed with status=402.
173
+ - All in eu-west-1, all on plan=free.
174
+ - exception.cause.stripeChargeId starts with ch_3M…
175
+ - Suggest: surface the structured `fix` field to the client; current 402 body returns generic message.
176
+ ```
177
+
178
+ Keep raw span dumps out of the summary; link to the trace ID instead.
@@ -2,13 +2,6 @@
2
2
  name: autotel-core
3
3
  description: >
4
4
  When to use trace vs span vs request logger vs events in Autotel. Init once at startup, package exports (autotel, autotel/event, autotel/testing). Use for setup and choosing the right API.
5
- type: core
6
- library: autotel
7
- library_version: '2.23.0'
8
- sources:
9
- - jagreehal/autotel:AGENTS.md
10
- - jagreehal/autotel:docs/AGENT-GUIDE.md
11
- - jagreehal/autotel:packages/autotel/CLAUDE.md
12
5
  ---
13
6
 
14
7
  # Autotel — Core
@@ -2,12 +2,6 @@
2
2
  name: autotel-events
3
3
  description: >
4
4
  track(), Event API, subscribers (e.g. PostHog). Configure subscribers in init(); use track() or Event for product/analytics events.
5
- type: core
6
- library: autotel
7
- library_version: '2.23.0'
8
- sources:
9
- - jagreehal/autotel:packages/autotel/src/event.ts
10
- - jagreehal/autotel:packages/autotel/src/event-subscriber.ts
11
5
  ---
12
6
 
13
7
  # Autotel — Events
@@ -2,15 +2,6 @@
2
2
  name: autotel-frameworks
3
3
  description: >
4
4
  Hono, Fastify, TanStack Start, Cloudflare Workers. Middleware and init; getRequestLogger() in handlers. Load when adding Autotel to a web framework.
5
- type: framework
6
- library: autotel
7
- library_version: '2.23.0'
8
- requires:
9
- - autotel-instrumentation
10
- sources:
11
- - jagreehal/autotel:packages/autotel-hono/src/index.ts
12
- - jagreehal/autotel:docs/AGENT-GUIDE.md
13
- - jagreehal/autotel:AGENTS.md
14
5
  ---
15
6
 
16
7
  # Autotel — Framework Integration
@@ -2,13 +2,6 @@
2
2
  name: autotel-instrumentation
3
3
  description: >
4
4
  trace(), span(), instrument(), init(). Factory vs direct pattern, name inference. Sync init; use node-require for optional deps. Load when wrapping handlers or functions with spans.
5
- type: core
6
- library: autotel
7
- library_version: '2.23.0'
8
- sources:
9
- - jagreehal/autotel:docs/ARCHITECTURE.md
10
- - jagreehal/autotel:packages/autotel/src/functional.ts
11
- - jagreehal/autotel:packages/autotel/CLAUDE.md
12
5
  ---
13
6
 
14
7
  # Autotel — Instrumentation