FABRIC/docs
jedarden a6fb5c9289 feat(bd-zci): map OTLP metrics → analytics DB instruments
Add OTLP metric ingestion pipeline that persists Sum/Histogram/Gauge
data points to fabric.db with canonical instrument names:

- MetricAccumulator in workerAnalytics.ts accumulates per-worker
  running totals for tokens, cost, durations, bead counts
- Schema v2 in historicalStore.ts adds metric_samples and
  session_worker_summaries tables with source preference tracking
- flushMetricSamples() in store.ts drains accumulator → SQLite on
  every event, upserting session summaries and live session rows
- docs/schema.md documents instrument names and resolution order

Fix source preference ordering (otlp-metric > otlp-span > log-derived)
using CASE-based SQL sort instead of alphabetical ASC which was
inverted. Fix metricsSource detection to not require costUsd > 0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 17:18:32 -04:00
..
FileHeatmap-Integration.md feat(bd-3jl): FileHeatmap integration complete + build fixes 2026-03-04 04:18:13 +00:00
gap-analysis.md feat(bd-muv): Gap analysis: Compare implementation against plan.md and create beads for missing features 2026-03-07 03:47:50 +00:00
plan.md docs: add SQLite storage for Worker Analytics and Recovery Playbook 2026-03-02 03:05:46 +00:00
schema.md feat(bd-zci): map OTLP metrics → analytics DB instruments 2026-04-21 17:18:32 -04:00