@autter/runtime-node 1.8.0 → 1.9.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 +69 -1
- package/dist/{chunk-MOZOUEMA.cjs → chunk-3P573RHA.cjs} +44 -3
- package/dist/{chunk-QKY2OQSO.js → chunk-D3PJ7TQ4.js} +550 -36
- package/dist/{chunk-37W7YYXO.cjs → chunk-FV64SIRQ.cjs} +613 -99
- package/dist/{chunk-UC3QH4PC.js → chunk-FYMEBULO.js} +4 -3
- package/dist/{chunk-7H3FCV4P.cjs → chunk-LYXQC4FI.cjs} +14 -13
- package/dist/{chunk-B5ZMOCEM.js → chunk-VIP2EL47.js} +44 -3
- package/dist/cli.cjs +8 -8
- package/dist/cli.js +2 -2
- package/dist/index.cjs +489 -252
- package/dist/index.d.cts +76 -4
- package/dist/index.d.ts +76 -4
- package/dist/index.js +263 -26
- package/dist/{sinks-CIdlmYwy.d.cts → sinks-BfUoE96B.d.cts} +42 -4
- package/dist/{sinks-CIdlmYwy.d.ts → sinks-BfUoE96B.d.ts} +42 -4
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -2
- package/package.json +7 -3
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
evaluateCompat,
|
|
6
6
|
fetchIngesterCompat,
|
|
7
7
|
versionAtLeast
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VIP2EL47.js";
|
|
9
9
|
|
|
10
10
|
// src/doctor.ts
|
|
11
11
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -52,7 +52,7 @@ async function checkKey(endpoint, key, timeoutMs) {
|
|
|
52
52
|
if (res.status >= 200 && res.status < 300) return "accepted";
|
|
53
53
|
if (res.status === 401) return "rejected";
|
|
54
54
|
if (res.status === 403) return "client_key";
|
|
55
|
-
if (res.status === 503) return "storage_unavailable";
|
|
55
|
+
if (res.status === 503) return res.headers["retry-after"] ? "unverified" : "storage_unavailable";
|
|
56
56
|
return "unknown";
|
|
57
57
|
}
|
|
58
58
|
async function runDoctor(options = {}) {
|
|
@@ -89,7 +89,7 @@ async function runDoctor(options = {}) {
|
|
|
89
89
|
const known = info?.version != null || feature.route !== void 0 && info?.routes?.[feature.route] !== void 0;
|
|
90
90
|
return [{ id, title: feature.title, status: bad ? "incompatible" : known ? "ok" : "unknown" }];
|
|
91
91
|
});
|
|
92
|
-
const exitCode = !info ? 2 : issues.length || key === "rejected" || key === "client_key" || key === "storage_unavailable" ? 1 : 0;
|
|
92
|
+
const exitCode = !info ? 2 : issues.length || key === "rejected" || key === "client_key" || key === "storage_unavailable" || key === "unverified" ? 1 : 0;
|
|
93
93
|
return {
|
|
94
94
|
endpoint,
|
|
95
95
|
sdks,
|
|
@@ -125,6 +125,7 @@ function formatDoctorReport(report) {
|
|
|
125
125
|
rejected: "REJECTED (401): check AUTTER_RUNTIME_KEY",
|
|
126
126
|
client_key: "is a client/browser key; server SDKs need a server key",
|
|
127
127
|
storage_unavailable: "accepted, but the ingester's ClickHouse is unavailable (503)",
|
|
128
|
+
unverified: "could not be checked: the ingester's key validator is unavailable (503); exporters retry",
|
|
128
129
|
unknown: "could not be verified"
|
|
129
130
|
}[report.key];
|
|
130
131
|
lines.push(` key ${text}`);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk3P573RHAcjs = require('./chunk-3P573RHA.cjs');
|
|
9
9
|
|
|
10
10
|
// src/doctor.ts
|
|
11
11
|
var _fs = require('fs');
|
|
@@ -30,19 +30,19 @@ function installedSdks(cwd) {
|
|
|
30
30
|
}
|
|
31
31
|
if (_path.dirname.call(void 0, dir) === dir) break;
|
|
32
32
|
}
|
|
33
|
-
if (!found.has(
|
|
33
|
+
if (!found.has(_chunk3P573RHAcjs.SDK_IDENTITY.name)) found.set(_chunk3P573RHAcjs.SDK_IDENTITY.name, _chunk3P573RHAcjs.SDK_IDENTITY.version);
|
|
34
34
|
return [...found].map(([name, version]) => ({ name, version }));
|
|
35
35
|
}
|
|
36
36
|
function featuresInUse(sdks) {
|
|
37
|
-
return
|
|
37
|
+
return _chunk3P573RHAcjs.COMPAT_MANIFEST.features.filter(
|
|
38
38
|
(feature) => sdks.some((sdk) => {
|
|
39
39
|
const min = feature.sdks[sdk.name];
|
|
40
|
-
return min !== void 0 &&
|
|
40
|
+
return min !== void 0 && _chunk3P573RHAcjs.versionAtLeast.call(void 0, sdk.version, min) === true;
|
|
41
41
|
})
|
|
42
42
|
).map((feature) => feature.id);
|
|
43
43
|
}
|
|
44
44
|
async function checkKey(endpoint, key, timeoutMs) {
|
|
45
|
-
const res = await
|
|
45
|
+
const res = await _chunk3P573RHAcjs.compatRequest.call(void 0, "POST", `${endpoint}/v1/traces`, {
|
|
46
46
|
body: JSON.stringify({ resourceSpans: [] }),
|
|
47
47
|
headers: { authorization: `Bearer ${key}` },
|
|
48
48
|
unref: false,
|
|
@@ -52,7 +52,7 @@ async function checkKey(endpoint, key, timeoutMs) {
|
|
|
52
52
|
if (res.status >= 200 && res.status < 300) return "accepted";
|
|
53
53
|
if (res.status === 401) return "rejected";
|
|
54
54
|
if (res.status === 403) return "client_key";
|
|
55
|
-
if (res.status === 503) return "storage_unavailable";
|
|
55
|
+
if (res.status === 503) return res.headers["retry-after"] ? "unverified" : "storage_unavailable";
|
|
56
56
|
return "unknown";
|
|
57
57
|
}
|
|
58
58
|
async function runDoctor(options = {}) {
|
|
@@ -62,10 +62,10 @@ async function runDoctor(options = {}) {
|
|
|
62
62
|
const features = _optionalChain([options, 'access', _ => _.features, 'optionalAccess', _2 => _2.length]) ? options.features : featuresInUse(sdks);
|
|
63
63
|
const routes = [
|
|
64
64
|
...new Set(
|
|
65
|
-
features.map((id) => _optionalChain([
|
|
65
|
+
features.map((id) => _optionalChain([_chunk3P573RHAcjs.COMPAT_MANIFEST, 'access', _3 => _3.features, 'access', _4 => _4.find, 'call', _5 => _5((f) => f.id === id), 'optionalAccess', _6 => _6.route])).filter((route) => Boolean(route))
|
|
66
66
|
)
|
|
67
67
|
];
|
|
68
|
-
const { info, error } = await
|
|
68
|
+
const { info, error } = await _chunk3P573RHAcjs.fetchIngesterCompat.call(void 0, endpoint, { probeRoutes: routes, unref: false, timeoutMs });
|
|
69
69
|
const issues = [];
|
|
70
70
|
const seen = /* @__PURE__ */ new Set();
|
|
71
71
|
const add = (issue) => {
|
|
@@ -75,21 +75,21 @@ async function runDoctor(options = {}) {
|
|
|
75
75
|
issues.push(issue);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
_chunk3P573RHAcjs.evaluateCompat.call(void 0, { features, ingester: info }).forEach(add);
|
|
79
79
|
for (const sdk of sdks) {
|
|
80
80
|
if (_optionalChain([options, 'access', _7 => _7.features, 'optionalAccess', _8 => _8.length])) {
|
|
81
|
-
|
|
81
|
+
_chunk3P573RHAcjs.evaluateCompat.call(void 0, { features: options.features, ingester: null, sdk }).forEach(add);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
const key = options.key ? await checkKey(endpoint, options.key, timeoutMs) : void 0;
|
|
85
85
|
const featureRows = features.flatMap((id) => {
|
|
86
|
-
const feature =
|
|
86
|
+
const feature = _chunk3P573RHAcjs.COMPAT_MANIFEST.features.find((f) => f.id === id);
|
|
87
87
|
if (!feature) return [];
|
|
88
88
|
const bad = issues.some((issue) => issue.feature === id);
|
|
89
89
|
const known = _optionalChain([info, 'optionalAccess', _9 => _9.version]) != null || feature.route !== void 0 && _optionalChain([info, 'optionalAccess', _10 => _10.routes, 'optionalAccess', _11 => _11[feature.route]]) !== void 0;
|
|
90
90
|
return [{ id, title: feature.title, status: bad ? "incompatible" : known ? "ok" : "unknown" }];
|
|
91
91
|
});
|
|
92
|
-
const exitCode = !info ? 2 : issues.length || key === "rejected" || key === "client_key" || key === "storage_unavailable" ? 1 : 0;
|
|
92
|
+
const exitCode = !info ? 2 : issues.length || key === "rejected" || key === "client_key" || key === "storage_unavailable" || key === "unverified" ? 1 : 0;
|
|
93
93
|
return {
|
|
94
94
|
endpoint,
|
|
95
95
|
sdks,
|
|
@@ -125,6 +125,7 @@ function formatDoctorReport(report) {
|
|
|
125
125
|
rejected: "REJECTED (401): check AUTTER_RUNTIME_KEY",
|
|
126
126
|
client_key: "is a client/browser key; server SDKs need a server key",
|
|
127
127
|
storage_unavailable: "accepted, but the ingester's ClickHouse is unavailable (503)",
|
|
128
|
+
unverified: "could not be checked: the ingester's key validator is unavailable (503); exporters retry",
|
|
128
129
|
unknown: "could not be verified"
|
|
129
130
|
}[report.key];
|
|
130
131
|
lines.push(` key ${text}`);
|
|
@@ -153,7 +154,7 @@ Checks that your Autter SDKs, ingester and ClickHouse schema versions match.
|
|
|
153
154
|
Options:
|
|
154
155
|
--endpoint <url> Ingester base URL (default: $AUTTER_ENDPOINT, $OTEL_EXPORTER_OTLP_ENDPOINT, or ${DEFAULT_ENDPOINT})
|
|
155
156
|
--key <key> Also verify an ingest key (default: $AUTTER_RUNTIME_KEY)
|
|
156
|
-
--features <a,b> Only check these features (${
|
|
157
|
+
--features <a,b> Only check these features (${_chunk3P573RHAcjs.COMPAT_MANIFEST.features.map((f) => f.id).join(", ")})
|
|
157
158
|
--json Machine-readable output
|
|
158
159
|
--timeout <ms> Per-request timeout (default 5000)
|
|
159
160
|
|
|
@@ -170,6 +170,43 @@ var compat_manifest_default = {
|
|
|
170
170
|
ingester: "1.9.0",
|
|
171
171
|
migrations: ["0021-occurrence-collapsed-count"],
|
|
172
172
|
sdks: {}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "edge_request_counts",
|
|
176
|
+
title: "Edge requests counted from their request summaries",
|
|
177
|
+
ingester: "1.10.0",
|
|
178
|
+
migrations: [],
|
|
179
|
+
route: "/v1/logs",
|
|
180
|
+
sdks: { "@autter/runtime-edge": "1.3.0" }
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "caught_errors",
|
|
184
|
+
title: "Caught errors and deliberate fallbacks recorded as handled occurrences",
|
|
185
|
+
ingester: "1.11.0",
|
|
186
|
+
migrations: [],
|
|
187
|
+
sdks: { "@autter/runtime-node": "1.9.0", "@autter/runtime-edge": "1.4.0", "@autter/runtime-next": "1.9.0", "@autter/runtime-browser": "1.8.0" }
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: "route_percentiles",
|
|
191
|
+
title: "Per-route p95 and p99 latency in the 1-minute rollups",
|
|
192
|
+
ingester: "1.11.0",
|
|
193
|
+
migrations: ["0022-route-latency-1m"],
|
|
194
|
+
sdks: {}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "server_source_maps",
|
|
198
|
+
title: "Server bundles symbolicated, with source context lines",
|
|
199
|
+
ingester: "1.11.0",
|
|
200
|
+
migrations: [],
|
|
201
|
+
route: "/v1/sourcemaps",
|
|
202
|
+
sdks: { "@autter/runtime-cli": "1.3.0", "@autter/runtime-node": "1.9.0", "@autter/runtime-edge": "1.4.0", "@autter/runtime-next": "1.9.0" }
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "cause_fingerprint",
|
|
206
|
+
title: "Wrapped errors grouped with their root cause (cause-v1)",
|
|
207
|
+
ingester: "1.11.0",
|
|
208
|
+
migrations: [],
|
|
209
|
+
sdks: { "@autter/runtime-node": "1.9.0", "@autter/runtime-edge": "1.4.0", "@autter/runtime-next": "1.9.0" }
|
|
173
210
|
}
|
|
174
211
|
]
|
|
175
212
|
};
|
|
@@ -515,7 +552,7 @@ import { request as httpsRequest } from "https";
|
|
|
515
552
|
// package.json
|
|
516
553
|
var package_default = {
|
|
517
554
|
name: "@autter/runtime-node",
|
|
518
|
-
version: "1.
|
|
555
|
+
version: "1.9.1",
|
|
519
556
|
description: "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker",
|
|
520
557
|
license: "MIT",
|
|
521
558
|
type: "module",
|
|
@@ -560,16 +597,20 @@ var package_default = {
|
|
|
560
597
|
"@opentelemetry/sdk-metrics": "^1.30.1",
|
|
561
598
|
"@opentelemetry/sdk-node": "^0.57.1",
|
|
562
599
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
563
|
-
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
600
|
+
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
601
|
+
"require-in-the-middle": "^7.5.2"
|
|
564
602
|
},
|
|
565
603
|
devDependencies: {
|
|
566
604
|
"@autter/runtime-core": "0.0.0",
|
|
567
605
|
"@types/node": "^22.10.0",
|
|
606
|
+
bunyan: "^1.8.15",
|
|
568
607
|
express: "^4.21.2",
|
|
569
608
|
fastify: "^5.12.5",
|
|
570
609
|
koa: "^3.2.1",
|
|
610
|
+
pino: "^10.4.0",
|
|
571
611
|
tsup: "^8.3.5",
|
|
572
|
-
typescript: "^5.7.0"
|
|
612
|
+
typescript: "^5.7.0",
|
|
613
|
+
winston: "^3.19.0"
|
|
573
614
|
},
|
|
574
615
|
engines: {
|
|
575
616
|
node: ">=20"
|
package/dist/cli.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkLYXQC4FIcjs = require('./chunk-LYXQC4FI.cjs');
|
|
8
|
+
require('./chunk-3P573RHA.cjs');
|
|
9
9
|
|
|
10
10
|
// src/cli.ts
|
|
11
11
|
var _child_process = require('child_process');
|
|
@@ -31,22 +31,22 @@ async function main(argv) {
|
|
|
31
31
|
return 64;
|
|
32
32
|
}
|
|
33
33
|
if (command !== "doctor") {
|
|
34
|
-
console.log(
|
|
34
|
+
console.log(_chunkLYXQC4FIcjs.DOCTOR_USAGE);
|
|
35
35
|
return command === void 0 || command === "--help" || command === "-h" ? 0 : 64;
|
|
36
36
|
}
|
|
37
|
-
const parsed =
|
|
37
|
+
const parsed = _chunkLYXQC4FIcjs.parseDoctorArgs.call(void 0, rest);
|
|
38
38
|
if ("help" in parsed) {
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(_chunkLYXQC4FIcjs.DOCTOR_USAGE);
|
|
40
40
|
return 0;
|
|
41
41
|
}
|
|
42
42
|
if ("error" in parsed) {
|
|
43
43
|
console.error(`${parsed.error}
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${_chunkLYXQC4FIcjs.DOCTOR_USAGE}`);
|
|
46
46
|
return 64;
|
|
47
47
|
}
|
|
48
|
-
const report = await
|
|
49
|
-
console.log(parsed.json ? JSON.stringify(report, null, 2) :
|
|
48
|
+
const report = await _chunkLYXQC4FIcjs.runDoctor.call(void 0, parsed);
|
|
49
|
+
console.log(parsed.json ? JSON.stringify(report, null, 2) : _chunkLYXQC4FIcjs.formatDoctorReport.call(void 0, report));
|
|
50
50
|
return report.exitCode;
|
|
51
51
|
}
|
|
52
52
|
main(process.argv.slice(2)).then(
|
package/dist/cli.js
CHANGED