@neat.is/core 0.5.4-dev.20260721 → 0.6.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/dist/{chunk-VR73QNJD.js → chunk-5PVQJLPR.js} +12 -6
- package/dist/{chunk-VR73QNJD.js.map → chunk-5PVQJLPR.js.map} +1 -1
- package/dist/{chunk-I4NZ7PSN.js → chunk-BZ3AJVAC.js} +8 -3
- package/dist/chunk-BZ3AJVAC.js.map +1 -0
- package/dist/{chunk-PEFX3DBR.js → chunk-CS4GHQO3.js} +38 -2
- package/dist/{chunk-PEFX3DBR.js.map → chunk-CS4GHQO3.js.map} +1 -1
- package/dist/{chunk-4RU3AAOI.js → chunk-MVINCLQM.js} +2 -2
- package/dist/cli.cjs +96 -10
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +49 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +51 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/neatd.cjs +51 -4
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +3 -3
- package/dist/{otel-grpc-TEGOXE6T.js → otel-grpc-XS45HBET.js} +3 -3
- package/dist/server.cjs +42 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-I4NZ7PSN.js.map +0 -1
- /package/dist/{chunk-4RU3AAOI.js.map → chunk-MVINCLQM.js.map} +0 -0
- /package/dist/{otel-grpc-TEGOXE6T.js.map → otel-grpc-XS45HBET.js.map} +0 -0
package/dist/neatd.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
reconcileDaemonRecordSync,
|
|
4
4
|
startDaemon
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5PVQJLPR.js";
|
|
6
6
|
import {
|
|
7
7
|
listProjects,
|
|
8
8
|
registryPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CS4GHQO3.js";
|
|
10
10
|
import {
|
|
11
11
|
BindAuthorityError,
|
|
12
12
|
__require
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BZ3AJVAC.js";
|
|
14
14
|
|
|
15
15
|
// src/neatd.ts
|
|
16
16
|
import { promises as fs } from "fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reshapeGrpcRequest,
|
|
3
3
|
startOtelGrpcReceiver
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MVINCLQM.js";
|
|
5
|
+
import "./chunk-BZ3AJVAC.js";
|
|
6
6
|
export {
|
|
7
7
|
reshapeGrpcRequest,
|
|
8
8
|
startOtelGrpcReceiver
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=otel-grpc-
|
|
10
|
+
//# sourceMappingURL=otel-grpc-XS45HBET.js.map
|
package/dist/server.cjs
CHANGED
|
@@ -340,6 +340,11 @@ function pickEnv(spanAttrs, resourceAttrs) {
|
|
|
340
340
|
}
|
|
341
341
|
return ENV_FALLBACK;
|
|
342
342
|
}
|
|
343
|
+
function normalizeDbSystem(attrs) {
|
|
344
|
+
const raw = attrs["db.system"];
|
|
345
|
+
if (typeof raw !== "string") return void 0;
|
|
346
|
+
return raw === "mongoose" ? "mongodb" : raw;
|
|
347
|
+
}
|
|
343
348
|
function messagingDestinationOf(attrs) {
|
|
344
349
|
for (const key of ["messaging.destination.name", "messaging.destination"]) {
|
|
345
350
|
const v = attrs[key];
|
|
@@ -394,7 +399,7 @@ function parseOtlpRequest(body) {
|
|
|
394
399
|
durationNanos: durationNanos(span.startTimeUnixNano, span.endTimeUnixNano),
|
|
395
400
|
env: pickEnv(attrs, resourceAttrs),
|
|
396
401
|
attributes: attrs,
|
|
397
|
-
dbSystem:
|
|
402
|
+
dbSystem: normalizeDbSystem(attrs),
|
|
398
403
|
dbName: typeof attrs["db.name"] === "string" ? attrs["db.name"] : void 0,
|
|
399
404
|
dbCollection: typeof attrs["db.collection.name"] === "string" ? attrs["db.collection.name"] : typeof attrs["db.mongodb.collection"] === "string" ? attrs["db.mongodb.collection"] : void 0,
|
|
400
405
|
messagingSystem: typeof attrs["messaging.system"] === "string" ? attrs["messaging.system"] : void 0,
|
|
@@ -9426,6 +9431,42 @@ function registerRoutes(scope, ctx) {
|
|
|
9426
9431
|
return reply.code(500).send({ error: err.message });
|
|
9427
9432
|
}
|
|
9428
9433
|
});
|
|
9434
|
+
scope.get("/instrumentation", async (req, reply) => {
|
|
9435
|
+
const proj = resolveProject(registry, req, reply, ctx.bootstrap, ctx.singleProject);
|
|
9436
|
+
if (!proj) return;
|
|
9437
|
+
if (!proj.scanPath) {
|
|
9438
|
+
return { engaged: null };
|
|
9439
|
+
}
|
|
9440
|
+
try {
|
|
9441
|
+
const state = await describeProjectInstrumentation({ project: proj.name, scanPath: proj.scanPath });
|
|
9442
|
+
const uninstrumented = await listUninstrumented({ project: proj.name, scanPath: proj.scanPath });
|
|
9443
|
+
if (state.hookFiles.length === 0) {
|
|
9444
|
+
return {
|
|
9445
|
+
engaged: false,
|
|
9446
|
+
diagnosis: {
|
|
9447
|
+
reason: "No instrumented entry point found \u2014 NEAT hasn't written an OTel init hook for this project.",
|
|
9448
|
+
fixCommand: "neat init",
|
|
9449
|
+
detail: "Run `neat init` so NEAT writes the instrumentation hook next to your entry point, then run your app."
|
|
9450
|
+
}
|
|
9451
|
+
};
|
|
9452
|
+
}
|
|
9453
|
+
if (uninstrumented.length > 0) {
|
|
9454
|
+
const names = uninstrumented.map((u) => u.library);
|
|
9455
|
+
const more = names.length > 1 ? ` (and ${names.length - 1} more)` : "";
|
|
9456
|
+
return {
|
|
9457
|
+
engaged: false,
|
|
9458
|
+
diagnosis: {
|
|
9459
|
+
reason: `\`${names[0]}\`${more} isn't in the auto-instrumentation set, so spans from it won't reach the graph.`,
|
|
9460
|
+
fixCommand: "neat extend",
|
|
9461
|
+
detail: `Uninstrumented on your hot path: ${names.join(", ")}. Run \`neat extend\` to wire the missing instrumentation.`
|
|
9462
|
+
}
|
|
9463
|
+
};
|
|
9464
|
+
}
|
|
9465
|
+
return { engaged: true };
|
|
9466
|
+
} catch {
|
|
9467
|
+
return { engaged: null };
|
|
9468
|
+
}
|
|
9469
|
+
});
|
|
9429
9470
|
scope.post("/extend/apply", async (req, reply) => {
|
|
9430
9471
|
const proj = resolveProject(registry, req, reply, ctx.bootstrap, ctx.singleProject);
|
|
9431
9472
|
if (!proj) return;
|