@neat.is/core 0.4.4 → 0.4.5
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-YJOA7BBF.js → chunk-3QCRUEQD.js} +2 -2
- package/dist/{chunk-J4YBTD24.js → chunk-6GXBAR3M.js} +3 -3
- package/dist/{chunk-ZVNP3ZDH.js → chunk-HVF4S7J3.js} +6 -3
- package/dist/chunk-HVF4S7J3.js.map +1 -0
- package/dist/{chunk-G3YGPWJL.js → chunk-RBWL4HRB.js} +13 -2
- package/dist/chunk-RBWL4HRB.js.map +1 -0
- package/dist/cli.cjs +161 -32
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +149 -34
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/neatd.cjs +15 -1
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +3 -3
- package/dist/{otel-grpc-FIERFRGD.js → otel-grpc-VSPMP3OS.js} +3 -3
- package/dist/server.cjs +15 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +3 -3
- package/package.json +2 -2
- package/dist/chunk-G3YGPWJL.js.map +0 -1
- package/dist/chunk-ZVNP3ZDH.js.map +0 -1
- /package/dist/{chunk-YJOA7BBF.js.map → chunk-3QCRUEQD.js.map} +0 -0
- /package/dist/{chunk-J4YBTD24.js.map → chunk-6GXBAR3M.js.map} +0 -0
- /package/dist/{otel-grpc-FIERFRGD.js.map → otel-grpc-VSPMP3OS.js.map} +0 -0
package/dist/neatd.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
startDaemon
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6GXBAR3M.js";
|
|
5
5
|
import {
|
|
6
6
|
listProjects,
|
|
7
7
|
registryPath
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RBWL4HRB.js";
|
|
9
9
|
import {
|
|
10
10
|
BindAuthorityError,
|
|
11
11
|
__require
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HVF4S7J3.js";
|
|
13
13
|
|
|
14
14
|
// src/neatd.ts
|
|
15
15
|
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-3QCRUEQD.js";
|
|
5
|
+
import "./chunk-HVF4S7J3.js";
|
|
6
6
|
export {
|
|
7
7
|
reshapeGrpcRequest,
|
|
8
8
|
startOtelGrpcReceiver
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=otel-grpc-
|
|
10
|
+
//# sourceMappingURL=otel-grpc-VSPMP3OS.js.map
|
package/dist/server.cjs
CHANGED
|
@@ -336,12 +336,15 @@ function parseOtlpRequest(body) {
|
|
|
336
336
|
const out = [];
|
|
337
337
|
for (const rs of body.resourceSpans ?? []) {
|
|
338
338
|
const resourceAttrs = attrsToRecord(rs.resource?.attributes);
|
|
339
|
-
const
|
|
339
|
+
const rawServiceName = resourceAttrs["service.name"];
|
|
340
|
+
const resourceServiceNamePresent = typeof rawServiceName === "string" && rawServiceName.length > 0;
|
|
341
|
+
const service = resourceServiceNamePresent ? rawServiceName : "unidentified";
|
|
340
342
|
for (const ss of rs.scopeSpans ?? []) {
|
|
341
343
|
for (const span of ss.spans ?? []) {
|
|
342
344
|
const attrs = attrsToRecord(span.attributes);
|
|
343
345
|
const parsed = {
|
|
344
346
|
service,
|
|
347
|
+
resourceServiceNamePresent,
|
|
345
348
|
traceId: span.traceId ?? "",
|
|
346
349
|
spanId: span.spanId ?? "",
|
|
347
350
|
parentSpanId: span.parentSpanId || void 0,
|
|
@@ -1828,6 +1831,14 @@ function thresholdForEdgeType(edgeType, overrides) {
|
|
|
1828
1831
|
function nowIso(ctx) {
|
|
1829
1832
|
return new Date(ctx.now ? ctx.now() : Date.now()).toISOString();
|
|
1830
1833
|
}
|
|
1834
|
+
var unidentifiedWarnedProjects = /* @__PURE__ */ new Set();
|
|
1835
|
+
function warnUnidentifiedSpan(project) {
|
|
1836
|
+
if (unidentifiedWarnedProjects.has(project)) return;
|
|
1837
|
+
unidentifiedWarnedProjects.add(project);
|
|
1838
|
+
console.warn(
|
|
1839
|
+
`[neatd] span lacked service.name; routed to 'unidentified' in project ${project}; check your OTel SDK config.`
|
|
1840
|
+
);
|
|
1841
|
+
}
|
|
1831
1842
|
function pickAttr(span, ...keys) {
|
|
1832
1843
|
for (const k of keys) {
|
|
1833
1844
|
const v = span.attributes[k];
|
|
@@ -2057,6 +2068,9 @@ async function handleSpan(ctx, span) {
|
|
|
2057
2068
|
const ts = span.startTimeIso ?? nowIso(ctx);
|
|
2058
2069
|
const nowMs = ctx.now ? ctx.now() : Date.now();
|
|
2059
2070
|
const env = span.env ?? "unknown";
|
|
2071
|
+
if (span.resourceServiceNamePresent === false) {
|
|
2072
|
+
warnUnidentifiedSpan(ctx.project ?? DEFAULT_PROJECT);
|
|
2073
|
+
}
|
|
2060
2074
|
const sourceId = ensureServiceNode(ctx.graph, span.service, env);
|
|
2061
2075
|
const isError = span.statusCode === 2;
|
|
2062
2076
|
cacheSpanService(span, nowMs);
|