@neat.is/core 0.4.22 → 0.4.23

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  routeSpanToProject,
3
3
  startDaemon
4
- } from "./chunk-XRE4OQWJ.js";
4
+ } from "./chunk-IABNGQT2.js";
5
5
  import {
6
6
  ProjectNameCollisionError,
7
7
  addProject,
@@ -37,7 +37,7 @@ import {
37
37
  thresholdForEdgeType,
38
38
  touchLastSeen,
39
39
  writeAtomically
40
- } from "./chunk-OQ7CHOY2.js";
40
+ } from "./chunk-O25KZNZK.js";
41
41
  import {
42
42
  startOtelGrpcReceiver
43
43
  } from "./chunk-GAFTW2OX.js";
package/dist/neatd.cjs CHANGED
@@ -2578,6 +2578,22 @@ async function recordFailingResponseIncident(ctx, span, affectedNode, timestamp,
2578
2578
  };
2579
2579
  await appendErrorEvent(ctx, ev);
2580
2580
  }
2581
+ async function recordExceptionIncident(ctx, span, ts) {
2582
+ const attrs = sanitizeAttributes(span.attributes);
2583
+ const ev = {
2584
+ id: `${span.traceId}:${span.spanId}`,
2585
+ timestamp: ts,
2586
+ service: span.service,
2587
+ traceId: span.traceId,
2588
+ spanId: span.spanId,
2589
+ errorMessage: incidentMessage(span),
2590
+ ...span.exception?.type ? { exceptionType: span.exception.type } : {},
2591
+ ...span.exception?.stacktrace ? { exceptionStacktrace: span.exception.stacktrace } : {},
2592
+ ...Object.keys(attrs).length > 0 ? { attributes: attrs } : {},
2593
+ affectedNode: incidentAffectedNode(span, ctx.graph, ctx.scanPath)
2594
+ };
2595
+ await appendErrorEvent(ctx, ev);
2596
+ }
2581
2597
  async function advance4xxBurst(ctx, span, affectedNode, ts, nowMs, status2) {
2582
2598
  const { threshold, windowMs } = loadIncidentThresholdsFromEnv();
2583
2599
  if (!ctx.burstState) ctx.burstState = /* @__PURE__ */ new Map();
@@ -2734,7 +2750,9 @@ async function handleSpan(ctx, span) {
2734
2750
  }
2735
2751
  if (span.statusCode !== 2) {
2736
2752
  const status2 = httpResponseStatus(span);
2737
- if (status2 !== void 0 && status2 >= 500) {
2753
+ if (span.exception) {
2754
+ await recordExceptionIncident(ctx, span, ts);
2755
+ } else if (status2 !== void 0 && status2 >= 500) {
2738
2756
  await recordFailingResponseIncident(ctx, span, sourceId, ts, status2, 1);
2739
2757
  } else if (status2 !== void 0 && status2 >= 400 && spanMintsObservedEdge(span.kind)) {
2740
2758
  await advance4xxBurst(ctx, span, sourceId, ts, nowMs, status2);