@neat.is/core 0.4.20-dev.20260620 → 0.4.20-dev.20260621
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-ZV7GHZ2D.js → chunk-IWGDXLXA.js} +2 -2
- package/dist/{chunk-Q5EDVWKZ.js → chunk-RVOCG6UZ.js} +18 -6
- package/dist/chunk-RVOCG6UZ.js.map +1 -0
- package/dist/cli.cjs +20 -6
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +7 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +16 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/neatd.cjs +16 -5
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +2 -2
- package/dist/server.cjs +16 -5
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-Q5EDVWKZ.js.map +0 -1
- /package/dist/{chunk-ZV7GHZ2D.js.map → chunk-IWGDXLXA.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1953,13 +1953,14 @@ var parentSpanCache = /* @__PURE__ */ new Map();
|
|
|
1953
1953
|
function parentSpanKey(traceId, spanId) {
|
|
1954
1954
|
return `${traceId}:${spanId}`;
|
|
1955
1955
|
}
|
|
1956
|
-
function cacheSpanService(span, now) {
|
|
1956
|
+
function cacheSpanService(span, now, callSite) {
|
|
1957
1957
|
if (!span.traceId || !span.spanId) return;
|
|
1958
1958
|
const key = parentSpanKey(span.traceId, span.spanId);
|
|
1959
1959
|
parentSpanCache.delete(key);
|
|
1960
1960
|
parentSpanCache.set(key, {
|
|
1961
1961
|
service: span.service,
|
|
1962
1962
|
env: span.env ?? "unknown",
|
|
1963
|
+
...callSite ? { callSite } : {},
|
|
1963
1964
|
expiresAt: now + PARENT_SPAN_CACHE_TTL_MS
|
|
1964
1965
|
});
|
|
1965
1966
|
while (parentSpanCache.size > PARENT_SPAN_CACHE_SIZE) {
|
|
@@ -1975,7 +1976,11 @@ function lookupParentSpan(traceId, parentSpanId, now) {
|
|
|
1975
1976
|
parentSpanCache.delete(parentSpanKey(traceId, parentSpanId));
|
|
1976
1977
|
return null;
|
|
1977
1978
|
}
|
|
1978
|
-
return {
|
|
1979
|
+
return {
|
|
1980
|
+
service: entry.service,
|
|
1981
|
+
env: entry.env,
|
|
1982
|
+
...entry.callSite ? { callSite: entry.callSite } : {}
|
|
1983
|
+
};
|
|
1979
1984
|
}
|
|
1980
1985
|
function resolveServiceId(graph, host, env) {
|
|
1981
1986
|
const envTagged = (0, import_types3.serviceId)(host, env);
|
|
@@ -2248,9 +2253,9 @@ async function handleSpan(ctx, span) {
|
|
|
2248
2253
|
}
|
|
2249
2254
|
const sourceId = ensureServiceNode(ctx.graph, span.service, env);
|
|
2250
2255
|
const isError = span.statusCode === 2;
|
|
2251
|
-
cacheSpanService(span, nowMs);
|
|
2252
2256
|
const sourceServiceNode = ctx.graph.getNodeAttributes(sourceId);
|
|
2253
2257
|
const callSite = callSiteFromSpan(span, sourceServiceNode, ctx.scanPath);
|
|
2258
|
+
cacheSpanService(span, nowMs, callSite);
|
|
2254
2259
|
const observedSource = () => callSite ? ensureObservedFileNode(ctx.graph, span.service, sourceId, callSite) : sourceId;
|
|
2255
2260
|
const callSiteEvidence = callSite ? { file: callSite.relPath, ...callSite.line !== void 0 ? { line: callSite.line } : {} } : void 0;
|
|
2256
2261
|
let affectedNode = sourceId;
|
|
@@ -2307,13 +2312,19 @@ async function handleSpan(ctx, span) {
|
|
|
2307
2312
|
const parent = lookupParentSpan(span.traceId, span.parentSpanId, nowMs);
|
|
2308
2313
|
if (parent && parent.service !== span.service) {
|
|
2309
2314
|
const parentId = ensureServiceNode(ctx.graph, parent.service, parent.env);
|
|
2315
|
+
const fallbackSource = parent.callSite ? ensureObservedFileNode(ctx.graph, parent.service, parentId, parent.callSite) : parentId;
|
|
2316
|
+
const fallbackEvidence = parent.callSite ? {
|
|
2317
|
+
file: parent.callSite.relPath,
|
|
2318
|
+
...parent.callSite.line !== void 0 ? { line: parent.callSite.line } : {}
|
|
2319
|
+
} : void 0;
|
|
2310
2320
|
upsertObservedEdge(
|
|
2311
2321
|
ctx.graph,
|
|
2312
2322
|
import_types3.EdgeType.CALLS,
|
|
2313
|
-
|
|
2323
|
+
fallbackSource,
|
|
2314
2324
|
sourceId,
|
|
2315
2325
|
ts,
|
|
2316
|
-
isError
|
|
2326
|
+
isError,
|
|
2327
|
+
fallbackEvidence
|
|
2317
2328
|
);
|
|
2318
2329
|
}
|
|
2319
2330
|
}
|