@autter/runtime-node 1.6.1 → 1.7.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.
- package/README.md +15 -5
- package/dist/{chunk-4MVWIRBI.cjs → chunk-GYTQLITW.cjs} +38 -1
- package/dist/{chunk-7OTD2YPT.cjs → chunk-HKVFURYT.cjs} +11 -11
- package/dist/{chunk-5KISVAVB.js → chunk-KA4AOZX2.js} +1 -1
- package/dist/{chunk-HRDELHZP.js → chunk-LG52CW3V.js} +38 -1
- package/dist/{chunk-L5ENELB2.js → chunk-QUC6OUE7.js} +1 -1
- package/dist/{chunk-UXTIMS3G.cjs → chunk-RV4MJNM2.cjs} +7 -7
- package/dist/cli.cjs +8 -8
- package/dist/cli.js +2 -2
- package/dist/index.cjs +236 -175
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +72 -11
- package/dist/testing.cjs +8 -8
- package/dist/testing.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -317,11 +317,21 @@ silent loss. While wiring things up, set `debug: true` (or `AUTTER_DEBUG=1`)
|
|
|
317
317
|
to see `[autter] exported N span(s)` lines on stderr as batches leave.
|
|
318
318
|
|
|
319
319
|
Note on usage rollups: requests are counted from the `http.server.duration`
|
|
320
|
-
metric (100% accurate)
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
`autter.
|
|
320
|
+
metric (100% accurate), under their route template: Express routes and,
|
|
321
|
+
from 1.7.0, Next.js routes (`/blog/[slug]`, from the `next.route` Next puts
|
|
322
|
+
on its own spans). The SDK marks its resource `autter.metrics_wired` and
|
|
323
|
+
`autter.metrics_routes`, and each request span whose metric got a route
|
|
324
|
+
`autter.metric_has_route`; an up-to-date ingester then counts that request
|
|
325
|
+
from the metric alone, whatever `traceSampleRate` is. A request whose
|
|
326
|
+
metric has no route (Koa, Fastify or plain `http` without a router
|
|
327
|
+
instrumentation) is also counted from its sampled spans, which keep its
|
|
328
|
+
path. Ingesters up to 1.7.0 count every sampled server span on top of the
|
|
329
|
+
metric (at `traceSampleRate: 1`, about twice the requests), except
|
|
330
|
+
tail-retained error traces (`autter.tail_retained`). Since 1.7.0 the SDK
|
|
331
|
+
also applies the HTTP instrumentation to servers created before
|
|
332
|
+
`initAutterServer` (Next.js creates its server before `instrumentation.ts`
|
|
333
|
+
runs): until then a Next.js app got request spans and metrics only from
|
|
334
|
+
the first request that happened to load `http` again, if ever.
|
|
325
335
|
|
|
326
336
|
### Privacy: secrets and PII are scrubbed before they leave the process
|
|
327
337
|
|
|
@@ -119,6 +119,43 @@ var compat_manifest_default = {
|
|
|
119
119
|
ingester: "1.6.0",
|
|
120
120
|
migrations: [],
|
|
121
121
|
sdks: { "@autter/runtime-browser": "1.6.0", "@autter/runtime-next": "1.6.0", "@autter/runtime-node": "1.6.0" }
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "sourcemap_upload_keys",
|
|
125
|
+
title: "Upload-only keys for source maps (autter_rtu_)",
|
|
126
|
+
ingester: "1.7.0",
|
|
127
|
+
migrations: [],
|
|
128
|
+
route: "/v1/sourcemaps",
|
|
129
|
+
sdks: {}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "source_map_verify",
|
|
133
|
+
title: "Source map check by debug id (autter-runtime sourcemaps verify)",
|
|
134
|
+
ingester: "1.7.0",
|
|
135
|
+
migrations: ["0017-source-maps-debug-id"],
|
|
136
|
+
route: "/v1/sourcemaps/check",
|
|
137
|
+
sdks: {}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: "ingest_drop_counts",
|
|
141
|
+
title: "Rejected and dropped records per repository",
|
|
142
|
+
ingester: "1.8.0",
|
|
143
|
+
migrations: ["0018-runtime-ingest-drops"],
|
|
144
|
+
sdks: {}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "telemetry_sender_via",
|
|
148
|
+
title: "How each service's telemetry arrives (SDK, OpenTelemetry Collector or browser relay)",
|
|
149
|
+
ingester: "1.8.0",
|
|
150
|
+
migrations: ["0019-sdk-versions-via"],
|
|
151
|
+
sdks: {}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "frame_resolution_counts",
|
|
155
|
+
title: "Resolved and unresolved browser frames per occurrence",
|
|
156
|
+
ingester: "1.8.0",
|
|
157
|
+
migrations: ["0020-occurrence-frame-resolution"],
|
|
158
|
+
sdks: {}
|
|
122
159
|
}
|
|
123
160
|
]
|
|
124
161
|
};
|
|
@@ -464,7 +501,7 @@ var _https = require('https');
|
|
|
464
501
|
// package.json
|
|
465
502
|
var package_default = {
|
|
466
503
|
name: "@autter/runtime-node",
|
|
467
|
-
version: "1.
|
|
504
|
+
version: "1.7.0",
|
|
468
505
|
description: "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker",
|
|
469
506
|
license: "MIT",
|
|
470
507
|
type: "module",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkGYTQLITWcjs = require('./chunk-GYTQLITW.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(_chunkGYTQLITWcjs.SDK_IDENTITY.name)) found.set(_chunkGYTQLITWcjs.SDK_IDENTITY.name, _chunkGYTQLITWcjs.SDK_IDENTITY.version);
|
|
34
34
|
return [...found].map(([name, version]) => ({ name, version }));
|
|
35
35
|
}
|
|
36
36
|
function featuresInUse(sdks) {
|
|
37
|
-
return
|
|
37
|
+
return _chunkGYTQLITWcjs.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 && _chunkGYTQLITWcjs.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 _chunkGYTQLITWcjs.compatRequest.call(void 0, "POST", `${endpoint}/v1/traces`, {
|
|
46
46
|
body: JSON.stringify({ resourceSpans: [] }),
|
|
47
47
|
headers: { authorization: `Bearer ${key}` },
|
|
48
48
|
unref: false,
|
|
@@ -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([_chunkGYTQLITWcjs.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 _chunkGYTQLITWcjs.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,15 +75,15 @@ async function runDoctor(options = {}) {
|
|
|
75
75
|
issues.push(issue);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
_chunkGYTQLITWcjs.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
|
+
_chunkGYTQLITWcjs.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 = _chunkGYTQLITWcjs.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;
|
|
@@ -153,7 +153,7 @@ Checks that your Autter SDKs, ingester and ClickHouse schema versions match.
|
|
|
153
153
|
Options:
|
|
154
154
|
--endpoint <url> Ingester base URL (default: $AUTTER_ENDPOINT, $OTEL_EXPORTER_OTLP_ENDPOINT, or ${DEFAULT_ENDPOINT})
|
|
155
155
|
--key <key> Also verify an ingest key (default: $AUTTER_RUNTIME_KEY)
|
|
156
|
-
--features <a,b> Only check these features (${
|
|
156
|
+
--features <a,b> Only check these features (${_chunkGYTQLITWcjs.COMPAT_MANIFEST.features.map((f) => f.id).join(", ")})
|
|
157
157
|
--json Machine-readable output
|
|
158
158
|
--timeout <ms> Per-request timeout (default 5000)
|
|
159
159
|
|
|
@@ -119,6 +119,43 @@ var compat_manifest_default = {
|
|
|
119
119
|
ingester: "1.6.0",
|
|
120
120
|
migrations: [],
|
|
121
121
|
sdks: { "@autter/runtime-browser": "1.6.0", "@autter/runtime-next": "1.6.0", "@autter/runtime-node": "1.6.0" }
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "sourcemap_upload_keys",
|
|
125
|
+
title: "Upload-only keys for source maps (autter_rtu_)",
|
|
126
|
+
ingester: "1.7.0",
|
|
127
|
+
migrations: [],
|
|
128
|
+
route: "/v1/sourcemaps",
|
|
129
|
+
sdks: {}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "source_map_verify",
|
|
133
|
+
title: "Source map check by debug id (autter-runtime sourcemaps verify)",
|
|
134
|
+
ingester: "1.7.0",
|
|
135
|
+
migrations: ["0017-source-maps-debug-id"],
|
|
136
|
+
route: "/v1/sourcemaps/check",
|
|
137
|
+
sdks: {}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: "ingest_drop_counts",
|
|
141
|
+
title: "Rejected and dropped records per repository",
|
|
142
|
+
ingester: "1.8.0",
|
|
143
|
+
migrations: ["0018-runtime-ingest-drops"],
|
|
144
|
+
sdks: {}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "telemetry_sender_via",
|
|
148
|
+
title: "How each service's telemetry arrives (SDK, OpenTelemetry Collector or browser relay)",
|
|
149
|
+
ingester: "1.8.0",
|
|
150
|
+
migrations: ["0019-sdk-versions-via"],
|
|
151
|
+
sdks: {}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "frame_resolution_counts",
|
|
155
|
+
title: "Resolved and unresolved browser frames per occurrence",
|
|
156
|
+
ingester: "1.8.0",
|
|
157
|
+
migrations: ["0020-occurrence-frame-resolution"],
|
|
158
|
+
sdks: {}
|
|
122
159
|
}
|
|
123
160
|
]
|
|
124
161
|
};
|
|
@@ -464,7 +501,7 @@ import { request as httpsRequest } from "https";
|
|
|
464
501
|
// package.json
|
|
465
502
|
var package_default = {
|
|
466
503
|
name: "@autter/runtime-node",
|
|
467
|
-
version: "1.
|
|
504
|
+
version: "1.7.0",
|
|
468
505
|
description: "Autter Runtime for Node.js: request wide events, coded errors, operation logging, same-origin browser relay and a curated OpenTelemetry server tracker",
|
|
469
506
|
license: "MIT",
|
|
470
507
|
type: "module",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkGYTQLITWcjs = require('./chunk-GYTQLITW.cjs');
|
|
6
6
|
|
|
7
7
|
// ../runtime-core/dist/index.js
|
|
8
8
|
var SENSITIVE_KEY_PATTERNS = [
|
|
@@ -994,7 +994,7 @@ var _crypto = require('crypto');
|
|
|
994
994
|
|
|
995
995
|
var _fs = require('fs');
|
|
996
996
|
var _path = require('path');
|
|
997
|
-
var sinkStats =
|
|
997
|
+
var sinkStats = _chunkGYTQLITWcjs.sharedSlot.call(void 0, "sinks", () => ({ dropped: 0 }));
|
|
998
998
|
function otlpSink(options = {}) {
|
|
999
999
|
let context = null;
|
|
1000
1000
|
let queue = [];
|
|
@@ -1070,7 +1070,7 @@ function otlpSink(options = {}) {
|
|
|
1070
1070
|
Math.max(1, Math.min(3e3, deadline - Date.now()))
|
|
1071
1071
|
)
|
|
1072
1072
|
});
|
|
1073
|
-
|
|
1073
|
+
_chunkGYTQLITWcjs.observeIngesterResponse.call(void 0, { status: response.status, headers: response.headers, route: "/v1/logs" });
|
|
1074
1074
|
if (!response.ok)
|
|
1075
1075
|
throw new Error(`Runtime log export failed (${response.status})`);
|
|
1076
1076
|
failure = void 0;
|
|
@@ -1120,7 +1120,7 @@ function otlpSink(options = {}) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
queue.push({ record, bytes });
|
|
1122
1122
|
queueBytes += bytes;
|
|
1123
|
-
|
|
1123
|
+
_chunkGYTQLITWcjs.noteCompatFeature.call(void 0, "operation_logging");
|
|
1124
1124
|
scheduleFlush();
|
|
1125
1125
|
},
|
|
1126
1126
|
flush,
|
|
@@ -1363,7 +1363,7 @@ function memorySink() {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
|
|
1365
1365
|
// src/logger.ts
|
|
1366
|
-
var shared =
|
|
1366
|
+
var shared = _chunkGYTQLITWcjs.sharedSlot.call(void 0, "logger", () => ({
|
|
1367
1367
|
local: new (0, _async_hooks.AsyncLocalStorage)(),
|
|
1368
1368
|
config: null,
|
|
1369
1369
|
sinks: [],
|
|
@@ -1820,7 +1820,7 @@ var runtimeContext = {
|
|
|
1820
1820
|
// src/breadcrumbs.ts
|
|
1821
1821
|
var INVALID_TRACE_ID = "00000000000000000000000000000000";
|
|
1822
1822
|
var MAX_TRACE_TRAILS = 200;
|
|
1823
|
-
var trails =
|
|
1823
|
+
var trails = _chunkGYTQLITWcjs.sharedSlot.call(void 0, "breadcrumbs", () => ({
|
|
1824
1824
|
byTrace: /* @__PURE__ */ new Map(),
|
|
1825
1825
|
process: new BreadcrumbTrail(),
|
|
1826
1826
|
thrown: /* @__PURE__ */ new WeakMap()
|
|
@@ -1856,7 +1856,7 @@ function addBreadcrumb(input) {
|
|
|
1856
1856
|
const crumb = normalizeBreadcrumb(input, redact2);
|
|
1857
1857
|
if (!crumb) return;
|
|
1858
1858
|
_optionalChain([trailFor, 'call', _96 => _96(true), 'optionalAccess', _97 => _97.add, 'call', _98 => _98(crumb)]);
|
|
1859
|
-
|
|
1859
|
+
_chunkGYTQLITWcjs.noteCompatFeature.call(void 0, "breadcrumbs");
|
|
1860
1860
|
} catch (e21) {
|
|
1861
1861
|
}
|
|
1862
1862
|
}
|
package/dist/cli.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkHKVFURYTcjs = require('./chunk-HKVFURYT.cjs');
|
|
8
|
+
require('./chunk-GYTQLITW.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(_chunkHKVFURYTcjs.DOCTOR_USAGE);
|
|
35
35
|
return command === void 0 || command === "--help" || command === "-h" ? 0 : 64;
|
|
36
36
|
}
|
|
37
|
-
const parsed =
|
|
37
|
+
const parsed = _chunkHKVFURYTcjs.parseDoctorArgs.call(void 0, rest);
|
|
38
38
|
if ("help" in parsed) {
|
|
39
|
-
console.log(
|
|
39
|
+
console.log(_chunkHKVFURYTcjs.DOCTOR_USAGE);
|
|
40
40
|
return 0;
|
|
41
41
|
}
|
|
42
42
|
if ("error" in parsed) {
|
|
43
43
|
console.error(`${parsed.error}
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${_chunkHKVFURYTcjs.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 _chunkHKVFURYTcjs.runDoctor.call(void 0, parsed);
|
|
49
|
+
console.log(parsed.json ? JSON.stringify(report, null, 2) : _chunkHKVFURYTcjs.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