@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/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  resolveHost,
7
7
  resolveNeatVersion,
8
8
  writeDaemonRecord
9
- } from "./chunk-XRE4OQWJ.js";
9
+ } from "./chunk-IABNGQT2.js";
10
10
  import {
11
11
  buildSearchIndex
12
12
  } from "./chunk-XOOCA5T7.js";
@@ -59,7 +59,7 @@ import {
59
59
  signalDaemonStop,
60
60
  startPersistLoop,
61
61
  startStalenessLoop
62
- } from "./chunk-OQ7CHOY2.js";
62
+ } from "./chunk-O25KZNZK.js";
63
63
  import {
64
64
  startOtelGrpcReceiver
65
65
  } from "./chunk-GAFTW2OX.js";
package/dist/index.cjs CHANGED
@@ -2637,6 +2637,22 @@ async function recordFailingResponseIncident(ctx, span, affectedNode, timestamp,
2637
2637
  };
2638
2638
  await appendErrorEvent(ctx, ev);
2639
2639
  }
2640
+ async function recordExceptionIncident(ctx, span, ts) {
2641
+ const attrs = sanitizeAttributes(span.attributes);
2642
+ const ev = {
2643
+ id: `${span.traceId}:${span.spanId}`,
2644
+ timestamp: ts,
2645
+ service: span.service,
2646
+ traceId: span.traceId,
2647
+ spanId: span.spanId,
2648
+ errorMessage: incidentMessage(span),
2649
+ ...span.exception?.type ? { exceptionType: span.exception.type } : {},
2650
+ ...span.exception?.stacktrace ? { exceptionStacktrace: span.exception.stacktrace } : {},
2651
+ ...Object.keys(attrs).length > 0 ? { attributes: attrs } : {},
2652
+ affectedNode: incidentAffectedNode(span, ctx.graph, ctx.scanPath)
2653
+ };
2654
+ await appendErrorEvent(ctx, ev);
2655
+ }
2640
2656
  async function advance4xxBurst(ctx, span, affectedNode, ts, nowMs, status2) {
2641
2657
  const { threshold, windowMs } = loadIncidentThresholdsFromEnv();
2642
2658
  if (!ctx.burstState) ctx.burstState = /* @__PURE__ */ new Map();
@@ -2793,7 +2809,9 @@ async function handleSpan(ctx, span) {
2793
2809
  }
2794
2810
  if (span.statusCode !== 2) {
2795
2811
  const status2 = httpResponseStatus(span);
2796
- if (status2 !== void 0 && status2 >= 500) {
2812
+ if (span.exception) {
2813
+ await recordExceptionIncident(ctx, span, ts);
2814
+ } else if (status2 !== void 0 && status2 >= 500) {
2797
2815
  await recordFailingResponseIncident(ctx, span, sourceId, ts, status2, 1);
2798
2816
  } else if (status2 !== void 0 && status2 >= 400 && spanMintsObservedEdge(span.kind)) {
2799
2817
  await advance4xxBurst(ctx, span, sourceId, ts, nowMs, status2);