autotel 2.22.0 → 2.23.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.
- package/README.md +112 -6
- package/bin/intent.js +6 -0
- package/dist/auto.cjs +3 -3
- package/dist/auto.js +2 -2
- package/dist/{chunk-EWH2542B.js → chunk-3AMR5XLZ.js} +3 -3
- package/dist/{chunk-EWH2542B.js.map → chunk-3AMR5XLZ.js.map} +1 -1
- package/dist/chunk-3QXBFGKP.js +344 -0
- package/dist/chunk-3QXBFGKP.js.map +1 -0
- package/dist/{chunk-VQFF2WMP.cjs → chunk-3ZFDJJWZ.cjs} +37 -29
- package/dist/chunk-3ZFDJJWZ.cjs.map +1 -0
- package/dist/{chunk-CQC6RVLR.cjs → chunk-4RZ4JUBY.cjs} +5 -5
- package/dist/{chunk-CQC6RVLR.cjs.map → chunk-4RZ4JUBY.cjs.map} +1 -1
- package/dist/{chunk-PAVYKPCQ.js → chunk-5XUEHX7J.js} +3 -3
- package/dist/{chunk-PAVYKPCQ.js.map → chunk-5XUEHX7J.js.map} +1 -1
- package/dist/chunk-6S5RUKU3.cjs +347 -0
- package/dist/chunk-6S5RUKU3.cjs.map +1 -0
- package/dist/{chunk-BS757SL2.js → chunk-724XLWR3.js} +9 -4
- package/dist/chunk-724XLWR3.js.map +1 -0
- package/dist/chunk-7EQ4G4SI.cjs +146 -0
- package/dist/chunk-7EQ4G4SI.cjs.map +1 -0
- package/dist/{chunk-CQP5SQT4.cjs → chunk-AXFWWJF3.cjs} +7 -7
- package/dist/{chunk-CQP5SQT4.cjs.map → chunk-AXFWWJF3.cjs.map} +1 -1
- package/dist/{chunk-7NH625MS.cjs → chunk-BSZP4URK.cjs} +5 -5
- package/dist/{chunk-7NH625MS.cjs.map → chunk-BSZP4URK.cjs.map} +1 -1
- package/dist/{chunk-GZFH6P5U.js → chunk-GY4CRZSV.js} +14 -6
- package/dist/chunk-GY4CRZSV.js.map +1 -0
- package/dist/{chunk-QKUGUDXJ.cjs → chunk-HSEIUH7F.cjs} +10 -5
- package/dist/chunk-HSEIUH7F.cjs.map +1 -0
- package/dist/{chunk-DTW3WB7Z.js → chunk-IPKXURBW.js} +3 -3
- package/dist/{chunk-DTW3WB7Z.js.map → chunk-IPKXURBW.js.map} +1 -1
- package/dist/chunk-J7VGRIAJ.js +64 -0
- package/dist/chunk-J7VGRIAJ.js.map +1 -0
- package/dist/chunk-KFOHQK7X.js +144 -0
- package/dist/chunk-KFOHQK7X.js.map +1 -0
- package/dist/{chunk-4UYR46UP.cjs → chunk-MSUHW2I4.cjs} +13 -13
- package/dist/{chunk-4UYR46UP.cjs.map → chunk-MSUHW2I4.cjs.map} +1 -1
- package/dist/chunk-T4B5LB6E.cjs +66 -0
- package/dist/chunk-T4B5LB6E.cjs.map +1 -0
- package/dist/{chunk-QHT4MUED.js → chunk-WCIIFRGL.js} +3 -3
- package/dist/{chunk-QHT4MUED.js.map → chunk-WCIIFRGL.js.map} +1 -1
- package/dist/decorators.cjs +3 -3
- package/dist/decorators.js +3 -3
- package/dist/drain-pipeline.cjs +13 -0
- package/dist/drain-pipeline.cjs.map +1 -0
- package/dist/drain-pipeline.d.cts +37 -0
- package/dist/drain-pipeline.d.ts +37 -0
- package/dist/drain-pipeline.js +4 -0
- package/dist/drain-pipeline.js.map +1 -0
- package/dist/enrichers.cjs +90 -0
- package/dist/enrichers.cjs.map +1 -0
- package/dist/enrichers.d.cts +23 -0
- package/dist/enrichers.d.ts +23 -0
- package/dist/enrichers.js +86 -0
- package/dist/enrichers.js.map +1 -0
- package/dist/event.cjs +6 -6
- package/dist/event.js +3 -3
- package/dist/functional.cjs +10 -10
- package/dist/functional.js +3 -3
- package/dist/index.cjs +274 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -3
- package/dist/index.d.ts +73 -3
- package/dist/index.js +227 -11
- package/dist/index.js.map +1 -1
- package/dist/{init-BMiXSJNM.d.cts → init-BC5aN8bh.d.cts} +18 -0
- package/dist/{init-ByRbNTRo.d.ts → init-_FG4IbhF.d.ts} +18 -0
- package/dist/instrumentation.cjs +9 -9
- package/dist/instrumentation.js +2 -2
- package/dist/messaging.cjs +7 -7
- package/dist/messaging.js +4 -4
- package/dist/parse-error.cjs +13 -0
- package/dist/parse-error.cjs.map +1 -0
- package/dist/parse-error.d.cts +13 -0
- package/dist/parse-error.d.ts +13 -0
- package/dist/parse-error.js +4 -0
- package/dist/parse-error.js.map +1 -0
- package/dist/processors.cjs +2 -2
- package/dist/processors.d.cts +40 -4
- package/dist/processors.d.ts +40 -4
- package/dist/processors.js +1 -1
- package/dist/semantic-helpers.cjs +8 -8
- package/dist/semantic-helpers.js +4 -4
- package/dist/webhook.cjs +4 -4
- package/dist/webhook.js +3 -3
- package/dist/workflow-distributed.cjs +5 -5
- package/dist/workflow-distributed.js +3 -3
- package/dist/workflow.cjs +8 -8
- package/dist/workflow.js +4 -4
- package/dist/yaml-config.d.cts +2 -1
- package/dist/yaml-config.d.ts +2 -1
- package/package.json +55 -33
- package/skills/autotel-core/SKILL.md +162 -0
- package/skills/autotel-events/SKILL.md +88 -0
- package/skills/autotel-frameworks/SKILL.md +97 -0
- package/skills/autotel-instrumentation/SKILL.md +125 -0
- package/skills/autotel-request-logging/SKILL.md +100 -0
- package/skills/autotel-structured-errors/SKILL.md +130 -0
- package/src/drain-pipeline.test.ts +68 -0
- package/src/drain-pipeline.ts +199 -0
- package/src/enrichers.test.ts +150 -0
- package/src/enrichers.ts +145 -0
- package/src/flatten-attributes.test.ts +76 -0
- package/src/flatten-attributes.ts +80 -0
- package/src/functional.test.ts +63 -0
- package/src/functional.ts +11 -3
- package/src/index.ts +34 -0
- package/src/init.ts +22 -0
- package/src/package-manifest.test.ts +24 -0
- package/src/parse-error.test.ts +73 -0
- package/src/parse-error.ts +112 -0
- package/src/pretty-log-formatter.test.ts +123 -0
- package/src/pretty-log-formatter.ts +210 -0
- package/src/processors/canonical-log-line-processor.test.ts +81 -25
- package/src/processors/canonical-log-line-processor.ts +130 -42
- package/src/request-logger.test.ts +137 -0
- package/src/request-logger.ts +150 -0
- package/src/structured-error.test.ts +106 -0
- package/src/structured-error.ts +97 -0
- package/dist/chunk-2RQDNGV3.js +0 -126
- package/dist/chunk-2RQDNGV3.js.map +0 -1
- package/dist/chunk-BS757SL2.js.map +0 -1
- package/dist/chunk-GZFH6P5U.js.map +0 -1
- package/dist/chunk-ONK2Y22L.cjs +0 -128
- package/dist/chunk-ONK2Y22L.cjs.map +0 -1
- package/dist/chunk-QKUGUDXJ.cjs.map +0 -1
- package/dist/chunk-VQFF2WMP.cjs.map +0 -1
package/dist/webhook.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { trace } from './chunk-
|
|
1
|
+
import { trace } from './chunk-GY4CRZSV.js';
|
|
2
2
|
import './chunk-SR35DG5A.js';
|
|
3
3
|
import './chunk-B3ZHLLMP.js';
|
|
4
4
|
import './chunk-WD4RP6IV.js';
|
|
5
5
|
import './chunk-USSL3D6L.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-724XLWR3.js';
|
|
7
7
|
import './chunk-YTGF4L2C.js';
|
|
8
8
|
import './chunk-X4RMFFMR.js';
|
|
9
9
|
import './chunk-WGWSHJ2N.js';
|
|
10
10
|
import './chunk-GYR5K654.js';
|
|
11
11
|
import './chunk-SNINLBEE.js';
|
|
12
12
|
import './chunk-6UQRVUN3.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-3QXBFGKP.js';
|
|
14
14
|
import './chunk-33WTKH7X.js';
|
|
15
15
|
import './chunk-XND7WBVX.js';
|
|
16
16
|
import './chunk-B33XPEKY.js';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk3ZFDJJWZ_cjs = require('./chunk-3ZFDJJWZ.cjs');
|
|
5
5
|
require('./chunk-W4EUTSB2.cjs');
|
|
6
6
|
require('./chunk-GML3FBOT.cjs');
|
|
7
7
|
require('./chunk-D5LMF53P.cjs');
|
|
8
8
|
require('./chunk-XRKAL7WJ.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-HSEIUH7F.cjs');
|
|
10
10
|
require('./chunk-6YIDHH2S.cjs');
|
|
11
11
|
require('./chunk-GVLK7YUU.cjs');
|
|
12
12
|
require('./chunk-ZNMBW67B.cjs');
|
|
13
13
|
require('./chunk-IOYFAFHJ.cjs');
|
|
14
14
|
require('./chunk-ELW34S4C.cjs');
|
|
15
15
|
require('./chunk-CU6IDACR.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-6S5RUKU3.cjs');
|
|
17
17
|
require('./chunk-YS6C2YJE.cjs');
|
|
18
18
|
require('./chunk-BGVKKL2N.cjs');
|
|
19
19
|
require('./chunk-AZ24DJAG.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
|
|
62
|
+
return chunk3ZFDJJWZ_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
|
|
161
|
+
return chunk3ZFDJJWZ_cjs.trace(
|
|
162
162
|
{ name: spanName, spanKind: api.SpanKind.INTERNAL },
|
|
163
163
|
(baseCtx) => {
|
|
164
164
|
return async (...args) => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createSafeBaggageSchema } from './chunk-4IFSYQVX.js';
|
|
2
|
-
import { trace } from './chunk-
|
|
2
|
+
import { trace } from './chunk-GY4CRZSV.js';
|
|
3
3
|
import './chunk-SR35DG5A.js';
|
|
4
4
|
import './chunk-B3ZHLLMP.js';
|
|
5
5
|
import './chunk-WD4RP6IV.js';
|
|
6
6
|
import './chunk-USSL3D6L.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-724XLWR3.js';
|
|
8
8
|
import './chunk-YTGF4L2C.js';
|
|
9
9
|
import './chunk-X4RMFFMR.js';
|
|
10
10
|
import './chunk-WGWSHJ2N.js';
|
|
11
11
|
import './chunk-GYR5K654.js';
|
|
12
12
|
import './chunk-SNINLBEE.js';
|
|
13
13
|
import './chunk-6UQRVUN3.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-3QXBFGKP.js';
|
|
15
15
|
import './chunk-33WTKH7X.js';
|
|
16
16
|
import './chunk-XND7WBVX.js';
|
|
17
17
|
import './chunk-B33XPEKY.js';
|
package/dist/workflow.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkBSZP4URK_cjs = require('./chunk-BSZP4URK.cjs');
|
|
4
|
+
require('./chunk-3ZFDJJWZ.cjs');
|
|
5
5
|
require('./chunk-W4EUTSB2.cjs');
|
|
6
6
|
require('./chunk-GML3FBOT.cjs');
|
|
7
7
|
require('./chunk-D5LMF53P.cjs');
|
|
8
8
|
require('./chunk-XRKAL7WJ.cjs');
|
|
9
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-HSEIUH7F.cjs');
|
|
10
10
|
require('./chunk-6YIDHH2S.cjs');
|
|
11
11
|
require('./chunk-GVLK7YUU.cjs');
|
|
12
12
|
require('./chunk-ZNMBW67B.cjs');
|
|
13
13
|
require('./chunk-IOYFAFHJ.cjs');
|
|
14
14
|
require('./chunk-ELW34S4C.cjs');
|
|
15
15
|
require('./chunk-CU6IDACR.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-6S5RUKU3.cjs');
|
|
17
17
|
require('./chunk-YS6C2YJE.cjs');
|
|
18
18
|
require('./chunk-BGVKKL2N.cjs');
|
|
19
19
|
require('./chunk-AZ24DJAG.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
|
|
28
|
+
get: function () { return chunkBSZP4URK_cjs.getCurrentWorkflowContext; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "isInWorkflow", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkBSZP4URK_cjs.isInWorkflow; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "traceStep", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkBSZP4URK_cjs.traceStep; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "traceWorkflow", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkBSZP4URK_cjs.traceWorkflow; }
|
|
41
41
|
});
|
|
42
42
|
//# sourceMappingURL=workflow.cjs.map
|
|
43
43
|
//# sourceMappingURL=workflow.cjs.map
|
package/dist/workflow.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from './chunk-WCIIFRGL.js';
|
|
2
|
+
import './chunk-GY4CRZSV.js';
|
|
3
3
|
import './chunk-SR35DG5A.js';
|
|
4
4
|
import './chunk-B3ZHLLMP.js';
|
|
5
5
|
import './chunk-WD4RP6IV.js';
|
|
6
6
|
import './chunk-USSL3D6L.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-724XLWR3.js';
|
|
8
8
|
import './chunk-YTGF4L2C.js';
|
|
9
9
|
import './chunk-X4RMFFMR.js';
|
|
10
10
|
import './chunk-WGWSHJ2N.js';
|
|
11
11
|
import './chunk-GYR5K654.js';
|
|
12
12
|
import './chunk-SNINLBEE.js';
|
|
13
13
|
import './chunk-6UQRVUN3.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-3QXBFGKP.js';
|
|
15
15
|
import './chunk-33WTKH7X.js';
|
|
16
16
|
import './chunk-XND7WBVX.js';
|
|
17
17
|
import './chunk-B33XPEKY.js';
|
package/dist/yaml-config.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AutotelConfig } from './init-
|
|
1
|
+
import { A as AutotelConfig } from './init-BC5aN8bh.cjs';
|
|
2
2
|
import '@opentelemetry/sdk-trace-base';
|
|
3
3
|
import '@opentelemetry/sdk-node';
|
|
4
4
|
import '@opentelemetry/resources';
|
|
@@ -12,6 +12,7 @@ import '@opentelemetry/sdk-logs';
|
|
|
12
12
|
import './filtering-span-processor.cjs';
|
|
13
13
|
import './span-name-normalizer.cjs';
|
|
14
14
|
import './attribute-redacting-processor.cjs';
|
|
15
|
+
import './processors.cjs';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* YAML configuration loader for autotel
|
package/dist/yaml-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AutotelConfig } from './init-
|
|
1
|
+
import { A as AutotelConfig } from './init-_FG4IbhF.js';
|
|
2
2
|
import '@opentelemetry/sdk-trace-base';
|
|
3
3
|
import '@opentelemetry/sdk-node';
|
|
4
4
|
import '@opentelemetry/resources';
|
|
@@ -12,6 +12,7 @@ import '@opentelemetry/sdk-logs';
|
|
|
12
12
|
import './filtering-span-processor.js';
|
|
13
13
|
import './span-name-normalizer.js';
|
|
14
14
|
import './attribute-redacting-processor.js';
|
|
15
|
+
import './processors.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* YAML configuration loader for autotel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autotel",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.1",
|
|
4
4
|
"description": "Write Once, Observe Anywhere",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -202,12 +202,30 @@
|
|
|
202
202
|
"types": "./dist/test-span-collector.d.ts",
|
|
203
203
|
"import": "./dist/test-span-collector.js",
|
|
204
204
|
"require": "./dist/test-span-collector.cjs"
|
|
205
|
+
},
|
|
206
|
+
"./parse-error": {
|
|
207
|
+
"types": "./dist/parse-error.d.ts",
|
|
208
|
+
"import": "./dist/parse-error.js",
|
|
209
|
+
"require": "./dist/parse-error.cjs"
|
|
210
|
+
},
|
|
211
|
+
"./drain-pipeline": {
|
|
212
|
+
"types": "./dist/drain-pipeline.d.ts",
|
|
213
|
+
"import": "./dist/drain-pipeline.js",
|
|
214
|
+
"require": "./dist/drain-pipeline.cjs"
|
|
215
|
+
},
|
|
216
|
+
"./enrichers": {
|
|
217
|
+
"types": "./dist/enrichers.d.ts",
|
|
218
|
+
"import": "./dist/enrichers.js",
|
|
219
|
+
"require": "./dist/enrichers.cjs"
|
|
205
220
|
}
|
|
206
221
|
},
|
|
207
222
|
"files": [
|
|
208
223
|
"dist",
|
|
209
224
|
"src",
|
|
210
|
-
"README.md"
|
|
225
|
+
"README.md",
|
|
226
|
+
"skills",
|
|
227
|
+
"!skills/_artifacts",
|
|
228
|
+
"bin"
|
|
211
229
|
],
|
|
212
230
|
"keywords": [
|
|
213
231
|
"opentelemetry",
|
|
@@ -230,29 +248,30 @@
|
|
|
230
248
|
"license": "MIT",
|
|
231
249
|
"dependencies": {
|
|
232
250
|
"@opentelemetry/api": "^1.9.0",
|
|
233
|
-
"@
|
|
234
|
-
"@opentelemetry/
|
|
235
|
-
"@opentelemetry/exporter-
|
|
236
|
-
"@opentelemetry/
|
|
237
|
-
"@opentelemetry/
|
|
238
|
-
"@opentelemetry/
|
|
239
|
-
"@opentelemetry/sdk-
|
|
240
|
-
"@opentelemetry/sdk-
|
|
251
|
+
"@tanstack/intent": "^0.0.13",
|
|
252
|
+
"@opentelemetry/api-logs": "^0.213.0",
|
|
253
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.213.0",
|
|
254
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.213.0",
|
|
255
|
+
"@opentelemetry/instrumentation": "^0.213.0",
|
|
256
|
+
"@opentelemetry/resources": "^2.6.0",
|
|
257
|
+
"@opentelemetry/sdk-metrics": "^2.6.0",
|
|
258
|
+
"@opentelemetry/sdk-node": "^0.213.0",
|
|
259
|
+
"@opentelemetry/sdk-trace-base": "^2.6.0",
|
|
241
260
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
242
261
|
"import-in-the-middle": "^3.0.0"
|
|
243
262
|
},
|
|
244
263
|
"peerDependencies": {
|
|
245
|
-
"@opentelemetry/auto-instrumentations-node": "^0.
|
|
246
|
-
"@opentelemetry/exporter-logs-otlp-grpc": "^0.
|
|
247
|
-
"@opentelemetry/exporter-logs-otlp-http": "^0.
|
|
248
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.
|
|
249
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
250
|
-
"@opentelemetry/resource-detector-aws": "^2.
|
|
251
|
-
"@opentelemetry/resource-detector-container": "^0.8.
|
|
252
|
-
"@opentelemetry/resource-detector-gcp": "^0.
|
|
253
|
-
"@opentelemetry/sdk-logs": "^0.
|
|
254
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
255
|
-
"@traceloop/node-server-sdk": "^0.22.
|
|
264
|
+
"@opentelemetry/auto-instrumentations-node": "^0.71.0",
|
|
265
|
+
"@opentelemetry/exporter-logs-otlp-grpc": "^0.213.0",
|
|
266
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.213.0",
|
|
267
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.213.0",
|
|
268
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.213.0",
|
|
269
|
+
"@opentelemetry/resource-detector-aws": "^2.13.0",
|
|
270
|
+
"@opentelemetry/resource-detector-container": "^0.8.4",
|
|
271
|
+
"@opentelemetry/resource-detector-gcp": "^0.48.0",
|
|
272
|
+
"@opentelemetry/sdk-logs": "^0.213.0",
|
|
273
|
+
"@opentelemetry/sdk-trace-node": "^2.6.0",
|
|
274
|
+
"@traceloop/node-server-sdk": "^0.22.8",
|
|
256
275
|
"pino": "^10.3.1",
|
|
257
276
|
"pino-pretty": "^13.1.3",
|
|
258
277
|
"yaml": "^2.8.2"
|
|
@@ -304,21 +323,21 @@
|
|
|
304
323
|
"devDependencies": {
|
|
305
324
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
306
325
|
"@edge-runtime/vm": "^5.0.0",
|
|
307
|
-
"@opentelemetry/auto-instrumentations-node": "^0.
|
|
308
|
-
"@opentelemetry/context-async-hooks": "^2.
|
|
309
|
-
"@opentelemetry/exporter-logs-otlp-grpc": "^0.
|
|
310
|
-
"@opentelemetry/exporter-logs-otlp-http": "^0.
|
|
311
|
-
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.
|
|
312
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
313
|
-
"@opentelemetry/resource-detector-aws": "^2.
|
|
314
|
-
"@opentelemetry/resource-detector-container": "^0.8.
|
|
315
|
-
"@opentelemetry/resource-detector-gcp": "^0.
|
|
316
|
-
"@opentelemetry/sdk-logs": "^0.
|
|
317
|
-
"@opentelemetry/sdk-trace-node": "^2.
|
|
326
|
+
"@opentelemetry/auto-instrumentations-node": "^0.71.0",
|
|
327
|
+
"@opentelemetry/context-async-hooks": "^2.6.0",
|
|
328
|
+
"@opentelemetry/exporter-logs-otlp-grpc": "^0.213.0",
|
|
329
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.213.0",
|
|
330
|
+
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.213.0",
|
|
331
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.213.0",
|
|
332
|
+
"@opentelemetry/resource-detector-aws": "^2.13.0",
|
|
333
|
+
"@opentelemetry/resource-detector-container": "^0.8.4",
|
|
334
|
+
"@opentelemetry/resource-detector-gcp": "^0.48.0",
|
|
335
|
+
"@opentelemetry/sdk-logs": "^0.213.0",
|
|
336
|
+
"@opentelemetry/sdk-trace-node": "^2.6.0",
|
|
318
337
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
319
338
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
320
339
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
321
|
-
"@types/node": "^25.3.
|
|
340
|
+
"@types/node": "^25.3.5",
|
|
322
341
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
323
342
|
"@typescript-eslint/parser": "^8.56.1",
|
|
324
343
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -344,6 +363,9 @@
|
|
|
344
363
|
"url": "https://github.com/jagreehal/autotel/issues"
|
|
345
364
|
},
|
|
346
365
|
"homepage": "https://github.com/jagreehal/autotel#readme",
|
|
366
|
+
"bin": {
|
|
367
|
+
"intent": "./bin/intent.js"
|
|
368
|
+
},
|
|
347
369
|
"scripts": {
|
|
348
370
|
"build": "tsup",
|
|
349
371
|
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autotel-core
|
|
3
|
+
description: >
|
|
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
|
+
---
|
|
13
|
+
|
|
14
|
+
# Autotel — Core
|
|
15
|
+
|
|
16
|
+
OpenTelemetry instrumentation for Node.js and edge. Instrument once; stream to any OTLP backend. Use `trace()`/`span()` for spans, `getRequestLogger()` for one snapshot per request, `createStructuredError`/`parseError` for errors, `track()` for product events.
|
|
17
|
+
|
|
18
|
+
## When to Use What
|
|
19
|
+
|
|
20
|
+
| Need | API | Import |
|
|
21
|
+
| ------------------------------------- | ---------------------------------------------------------------- | -------------------------------------- |
|
|
22
|
+
| Wrap a function with a span | `trace(fn)`, `span('Name', fn)` | `autotel` |
|
|
23
|
+
| Request-scoped attributes + emit once | `getRequestLogger(ctx?)` → `.set()`, `.emitNow()` | `autotel` |
|
|
24
|
+
| Throw with why/fix/link | `createStructuredError({ message, why?, fix?, link?, status? })` | `autotel` |
|
|
25
|
+
| Parse API errors (client) | `parseError(err)` → `message`, `why`, `fix`, `link` | `autotel` |
|
|
26
|
+
| Product/analytics events | `track(name, attrs)` or `Event` from `autotel/event` | `autotel`, `autotel/event` |
|
|
27
|
+
| Init (once at startup) | `init({ service, ... })` | `autotel` or `autotel/instrumentation` |
|
|
28
|
+
| Testing | `createTraceCollector()`, `InMemorySpanExporter` | `autotel/testing`, `autotel/exporters` |
|
|
29
|
+
|
|
30
|
+
Request logger requires an active span. Wrap HTTP handlers with `trace()` or framework middleware that creates a span, then call `getRequestLogger()` inside.
|
|
31
|
+
|
|
32
|
+
## Setup
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { init, trace, getRequestLogger } from 'autotel';
|
|
36
|
+
|
|
37
|
+
init({ service: 'my-app' });
|
|
38
|
+
|
|
39
|
+
const handler = trace((ctx) => async (req: Request) => {
|
|
40
|
+
const log = getRequestLogger(ctx);
|
|
41
|
+
log.set({ path: req.url });
|
|
42
|
+
const result = await doWork(req);
|
|
43
|
+
log.emitNow();
|
|
44
|
+
return result;
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Core Patterns
|
|
49
|
+
|
|
50
|
+
**Factory pattern when you need context (attributes, request logger):**
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
const createUser = trace((ctx) => async (data: UserInput) => {
|
|
54
|
+
ctx.setAttribute('user.id', data.id);
|
|
55
|
+
const log = getRequestLogger(ctx);
|
|
56
|
+
log.set({ user: { id: data.id } });
|
|
57
|
+
return db.users.create(data);
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Direct pattern when you don't need context:**
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const getUser = trace(async (id: string) => {
|
|
65
|
+
return db.users.findById(id);
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Structured errors in API routes:**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { createStructuredError } from 'autotel';
|
|
73
|
+
throw createStructuredError({
|
|
74
|
+
message: 'Not found',
|
|
75
|
+
status: 404,
|
|
76
|
+
why: `No user "${id}"`,
|
|
77
|
+
fix: 'Check the ID and try again',
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Client: parseError for UI:**
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { parseError } from 'autotel';
|
|
85
|
+
const e = parseError(err);
|
|
86
|
+
toast.error(e.message, { description: e.why });
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Common Mistakes
|
|
90
|
+
|
|
91
|
+
### HIGH Call getRequestLogger() without active span
|
|
92
|
+
|
|
93
|
+
Wrong:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
app.get('/api/x', () => {
|
|
97
|
+
const log = getRequestLogger();
|
|
98
|
+
log.set({ route: 'x' });
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Correct:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
app.use(autotelMiddleware()); // or wrap route with trace()
|
|
106
|
+
app.get('/api/x', () => {
|
|
107
|
+
const log = getRequestLogger();
|
|
108
|
+
log.set({ route: 'x' });
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
getRequestLogger() requires an active span. Register middleware that creates a span per request, or wrap the handler with `trace()`.
|
|
113
|
+
|
|
114
|
+
Source: packages/autotel/src/request-logger.ts
|
|
115
|
+
|
|
116
|
+
### HIGH Use await import() for init-time optional deps
|
|
117
|
+
|
|
118
|
+
Wrong:
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
const pkg = await import('optional-dep');
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Correct:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { safeRequire } from 'autotel';
|
|
128
|
+
const pkg = safeRequire('optional-dep');
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
init() must stay synchronous. Use node-require helpers for optional dependencies.
|
|
132
|
+
|
|
133
|
+
Source: packages/autotel/CLAUDE.md
|
|
134
|
+
|
|
135
|
+
### MEDIUM Use trace() without ctx when you need attributes or request logger
|
|
136
|
+
|
|
137
|
+
Wrong:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
const handler = trace(async (req) => {
|
|
141
|
+
const log = getRequestLogger(); // may throw if span not set up for request logger
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Correct:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
const handler = trace((ctx) => async (req) => {
|
|
149
|
+
const log = getRequestLogger(ctx);
|
|
150
|
+
log.set({ route: req.url });
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Use the factory pattern `(ctx) => async (...)` when you need to set attributes or use the request logger.
|
|
155
|
+
|
|
156
|
+
Source: docs/AGENT-GUIDE.md
|
|
157
|
+
|
|
158
|
+
## Version
|
|
159
|
+
|
|
160
|
+
Targets autotel v2.23.x.
|
|
161
|
+
|
|
162
|
+
See also: autotel-instrumentation/SKILL.md — init and trace/span in depth. autotel-request-logging/SKILL.md — request logger usage.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autotel-events
|
|
3
|
+
description: >
|
|
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
|
+
---
|
|
12
|
+
|
|
13
|
+
# Autotel — Events
|
|
14
|
+
|
|
15
|
+
Send product and analytics events with `track(name, attributes)` or the `Event` class from `autotel/event`. Configure subscribers (e.g. PostHog) in `init()`; they receive events automatically.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { init, track } from 'autotel';
|
|
21
|
+
import { PostHogSubscriber } from 'autotel-subscribers/posthog';
|
|
22
|
+
|
|
23
|
+
init({
|
|
24
|
+
service: 'my-app',
|
|
25
|
+
subscribers: [new PostHogSubscriber({ apiKey: 'phc_...' })],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
track('checkout.started', { userId: 'u_123', cartId: 'c_456' });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
With Event instance (optional override of subscribers):
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { Event } from 'autotel/event';
|
|
35
|
+
|
|
36
|
+
const event = new Event('checkout');
|
|
37
|
+
event.trackEvent('application.submitted', { jobId: '123', userId: '456' });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Core Patterns
|
|
41
|
+
|
|
42
|
+
**Simple track (uses subscribers from init):**
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
track('signup.completed', { plan: 'pro', source: 'web' });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Event with custom subscribers:**
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { Event } from 'autotel/event';
|
|
52
|
+
import { PostHogSubscriber } from 'autotel-subscribers/posthog';
|
|
53
|
+
|
|
54
|
+
const event = new Event('onboarding', {
|
|
55
|
+
subscribers: [new PostHogSubscriber({ apiKey: 'phc_other_project' })],
|
|
56
|
+
});
|
|
57
|
+
event.trackEvent('step.completed', { step: 2 });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Validation and config:** See `getEventsConfig()`, `getValidationConfig()` from init; event names and attributes can be validated.
|
|
61
|
+
|
|
62
|
+
## Common Mistakes
|
|
63
|
+
|
|
64
|
+
### MEDIUM Call track() before init() with subscribers
|
|
65
|
+
|
|
66
|
+
Wrong:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
track('signup', { plan: 'pro' });
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Correct:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
init({
|
|
76
|
+
service: 'my-app',
|
|
77
|
+
subscribers: [new PostHogSubscriber({ apiKey: 'phc_...' })],
|
|
78
|
+
});
|
|
79
|
+
track('signup', { plan: 'pro' });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Subscribers are configured in init(). track() sends to those subscribers; without init or without subscribers, events may not reach the backend.
|
|
83
|
+
|
|
84
|
+
Source: packages/autotel/src/event.ts
|
|
85
|
+
|
|
86
|
+
## Version
|
|
87
|
+
|
|
88
|
+
Targets autotel v2.23.x.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autotel-frameworks
|
|
3
|
+
description: >
|
|
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
|
+
---
|
|
15
|
+
|
|
16
|
+
# Autotel — Framework Integration
|
|
17
|
+
|
|
18
|
+
This skill builds on autotel-instrumentation. Read it first for init() and span creation.
|
|
19
|
+
|
|
20
|
+
Use framework-specific middleware or wrappers to create a span per request; then call `getRequestLogger()` inside handlers. Each framework package (autotel-hono, autotel-tanstack, autotel-cloudflare) provides the glue.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
### Hono
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { Hono } from 'hono';
|
|
28
|
+
import { init, getRequestLogger } from 'autotel';
|
|
29
|
+
import { otel } from 'autotel-hono';
|
|
30
|
+
|
|
31
|
+
init({ service: 'my-api' });
|
|
32
|
+
|
|
33
|
+
const app = new Hono();
|
|
34
|
+
app.use('*', otel({ serviceName: 'my-api' }));
|
|
35
|
+
|
|
36
|
+
app.post('/api/checkout', async (c) => {
|
|
37
|
+
const log = getRequestLogger();
|
|
38
|
+
log.set({ route: 'checkout' });
|
|
39
|
+
const body = await c.req.json();
|
|
40
|
+
log.set({ cart: { items: body.items?.length } });
|
|
41
|
+
log.emitNow();
|
|
42
|
+
return c.json({ ok: true });
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Fastify
|
|
47
|
+
|
|
48
|
+
Use middleware or a wrapper that creates a span per request (see apps/example-fastify). Inside the route, wrap with `trace()` or ensure a span is active, then `getRequestLogger(ctx)` or `getRequestLogger()`.
|
|
49
|
+
|
|
50
|
+
### TanStack Start
|
|
51
|
+
|
|
52
|
+
See packages/autotel-tanstack and apps/example-tanstack-start: middleware and env config. Use `getRequestLogger()` inside server handlers when a span is active.
|
|
53
|
+
|
|
54
|
+
### Cloudflare Workers
|
|
55
|
+
|
|
56
|
+
See packages/autotel-cloudflare: init at top level, wrap the fetch handler so each request gets a span. Use `getRequestLogger()` or trace context inside the handler.
|
|
57
|
+
|
|
58
|
+
## Core Patterns
|
|
59
|
+
|
|
60
|
+
**Register middleware before routes:** Middleware creates the span; getRequestLogger() needs that active span.
|
|
61
|
+
|
|
62
|
+
**Framework-specific packages:** autotel-hono, autotel-tanstack, autotel-cloudflare. Install the package for your framework and follow its README or CLAUDE.md.
|
|
63
|
+
|
|
64
|
+
## Common Mistakes
|
|
65
|
+
|
|
66
|
+
### HIGH Use getRequestLogger() in Hono without registering middleware first
|
|
67
|
+
|
|
68
|
+
Wrong:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const app = new Hono();
|
|
72
|
+
app.get('/api/x', (c) => {
|
|
73
|
+
const log = getRequestLogger();
|
|
74
|
+
return c.json({});
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Correct:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const app = new Hono();
|
|
82
|
+
app.use('*', otel());
|
|
83
|
+
app.get('/api/x', (c) => {
|
|
84
|
+
const log = getRequestLogger();
|
|
85
|
+
return c.json({});
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Middleware creates the span per request. Without it, getRequestLogger() has no active span and will throw.
|
|
90
|
+
|
|
91
|
+
Source: packages/autotel-hono, docs/AGENT-GUIDE.md
|
|
92
|
+
|
|
93
|
+
## Version
|
|
94
|
+
|
|
95
|
+
Targets autotel v2.23.x.
|
|
96
|
+
|
|
97
|
+
See also: autotel-instrumentation/SKILL.md — init and spans. autotel-request-logging/SKILL.md — request logger usage.
|