@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.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,
|
|
@@ -1644,6 +1647,14 @@ function thresholdForEdgeType(edgeType, overrides) {
|
|
|
1644
1647
|
function nowIso(ctx) {
|
|
1645
1648
|
return new Date(ctx.now ? ctx.now() : Date.now()).toISOString();
|
|
1646
1649
|
}
|
|
1650
|
+
var unidentifiedWarnedProjects = /* @__PURE__ */ new Set();
|
|
1651
|
+
function warnUnidentifiedSpan(project) {
|
|
1652
|
+
if (unidentifiedWarnedProjects.has(project)) return;
|
|
1653
|
+
unidentifiedWarnedProjects.add(project);
|
|
1654
|
+
console.warn(
|
|
1655
|
+
`[neatd] span lacked service.name; routed to 'unidentified' in project ${project}; check your OTel SDK config.`
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1647
1658
|
function pickAttr(span, ...keys) {
|
|
1648
1659
|
for (const k of keys) {
|
|
1649
1660
|
const v = span.attributes[k];
|
|
@@ -1898,6 +1909,9 @@ async function handleSpan(ctx, span) {
|
|
|
1898
1909
|
const ts = span.startTimeIso ?? nowIso(ctx);
|
|
1899
1910
|
const nowMs = ctx.now ? ctx.now() : Date.now();
|
|
1900
1911
|
const env = span.env ?? "unknown";
|
|
1912
|
+
if (span.resourceServiceNamePresent === false) {
|
|
1913
|
+
warnUnidentifiedSpan(ctx.project ?? DEFAULT_PROJECT);
|
|
1914
|
+
}
|
|
1901
1915
|
const sourceId = ensureServiceNode(ctx.graph, span.service, env);
|
|
1902
1916
|
const isError = span.statusCode === 2;
|
|
1903
1917
|
cacheSpanService(span, nowMs);
|