@aaac/observability 0.1.7 → 0.1.9

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.d.ts CHANGED
@@ -1074,6 +1074,12 @@ interface Pipeline {
1074
1074
  otelEmitter: OtelEmitter;
1075
1075
  /** Phase 5 Enricher (Correlator → Enricher → OtelEmitter + SqliteSink). */
1076
1076
  enricher: Enricher;
1077
+ /**
1078
+ * Flush all buffered OTEL spans that never received a 'close' event.
1079
+ * Emits each orphaned span group as-is via mapEventsToSpan → OtelEmitter.
1080
+ * Call before shutdown to avoid losing in-flight spans.
1081
+ */
1082
+ flushPendingSpans: () => void;
1077
1083
  }
1078
1084
  /**
1079
1085
  * Create a complete write pipeline wired together:
@@ -1082,6 +1088,11 @@ interface Pipeline {
1082
1088
  * → Enricher → SqliteSink
1083
1089
  * → OtelEmitter (if configured, fail-open)
1084
1090
  *
1091
+ * OTEL emission is buffered by spanId: events are accumulated until a 'close'
1092
+ * event arrives, at which point mapEventsToSpan() merges all events into a
1093
+ * single MappedSpan with proper duration before emitting to OtelEmitter.
1094
+ * 'instant' events are emitted immediately (zero-duration span).
1095
+ *
1085
1096
  * Derived events from Enricher.emitRecord() are written to both sinks after
1086
1097
  * the primary event (depth-1; derived events are NOT re-enriched).
1087
1098
  */
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  resolveTemplate,
41
41
  taskFilesKey,
42
42
  validateRawEvent
43
- } from "./chunk-M3KM2QTL.js";
43
+ } from "./chunk-GRL7RHMS.js";
44
44
  export {
45
45
  Correlator,
46
46
  DEFAULT_DB_PATH,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaac/observability",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "In-process observability for @aaac — EventCollector / Normalizer / Correlator / SqliteSink",
5
5
  "license": "MIT",
6
6
  "repository": {