@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/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
routeSpanToProject,
|
|
3
3
|
startDaemon
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6GXBAR3M.js";
|
|
5
5
|
import {
|
|
6
6
|
ProjectNameCollisionError,
|
|
7
7
|
addProject,
|
|
@@ -37,15 +37,15 @@ import {
|
|
|
37
37
|
thresholdForEdgeType,
|
|
38
38
|
touchLastSeen,
|
|
39
39
|
writeAtomically
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-RBWL4HRB.js";
|
|
41
41
|
import {
|
|
42
42
|
startOtelGrpcReceiver
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-3QCRUEQD.js";
|
|
44
44
|
import {
|
|
45
45
|
buildOtelReceiver,
|
|
46
46
|
logSpanHandler,
|
|
47
47
|
parseOtlpRequest
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-HVF4S7J3.js";
|
|
49
49
|
export {
|
|
50
50
|
ProjectNameCollisionError,
|
|
51
51
|
addProject,
|
package/dist/neatd.cjs
CHANGED
|
@@ -337,12 +337,15 @@ function parseOtlpRequest(body) {
|
|
|
337
337
|
const out = [];
|
|
338
338
|
for (const rs of body.resourceSpans ?? []) {
|
|
339
339
|
const resourceAttrs = attrsToRecord(rs.resource?.attributes);
|
|
340
|
-
const
|
|
340
|
+
const rawServiceName = resourceAttrs["service.name"];
|
|
341
|
+
const resourceServiceNamePresent = typeof rawServiceName === "string" && rawServiceName.length > 0;
|
|
342
|
+
const service = resourceServiceNamePresent ? rawServiceName : "unidentified";
|
|
341
343
|
for (const ss of rs.scopeSpans ?? []) {
|
|
342
344
|
for (const span of ss.spans ?? []) {
|
|
343
345
|
const attrs = attrsToRecord(span.attributes);
|
|
344
346
|
const parsed = {
|
|
345
347
|
service,
|
|
348
|
+
resourceServiceNamePresent,
|
|
346
349
|
traceId: span.traceId ?? "",
|
|
347
350
|
spanId: span.spanId ?? "",
|
|
348
351
|
parentSpanId: span.parentSpanId || void 0,
|
|
@@ -1578,6 +1581,14 @@ var DEFAULT_STALE_THRESHOLDS = {
|
|
|
1578
1581
|
function nowIso(ctx) {
|
|
1579
1582
|
return new Date(ctx.now ? ctx.now() : Date.now()).toISOString();
|
|
1580
1583
|
}
|
|
1584
|
+
var unidentifiedWarnedProjects = /* @__PURE__ */ new Set();
|
|
1585
|
+
function warnUnidentifiedSpan(project) {
|
|
1586
|
+
if (unidentifiedWarnedProjects.has(project)) return;
|
|
1587
|
+
unidentifiedWarnedProjects.add(project);
|
|
1588
|
+
console.warn(
|
|
1589
|
+
`[neatd] span lacked service.name; routed to 'unidentified' in project ${project}; check your OTel SDK config.`
|
|
1590
|
+
);
|
|
1591
|
+
}
|
|
1581
1592
|
function pickAttr(span, ...keys) {
|
|
1582
1593
|
for (const k of keys) {
|
|
1583
1594
|
const v = span.attributes[k];
|
|
@@ -1832,6 +1843,9 @@ async function handleSpan(ctx, span) {
|
|
|
1832
1843
|
const ts = span.startTimeIso ?? nowIso(ctx);
|
|
1833
1844
|
const nowMs = ctx.now ? ctx.now() : Date.now();
|
|
1834
1845
|
const env = span.env ?? "unknown";
|
|
1846
|
+
if (span.resourceServiceNamePresent === false) {
|
|
1847
|
+
warnUnidentifiedSpan(ctx.project ?? DEFAULT_PROJECT);
|
|
1848
|
+
}
|
|
1835
1849
|
const sourceId = ensureServiceNode(ctx.graph, span.service, env);
|
|
1836
1850
|
const isError = span.statusCode === 2;
|
|
1837
1851
|
cacheSpanService(span, nowMs);
|