Files
zeekay 36487dda4f metrics: fold samples into series and flush OTLP data points
Replaces the first cut, which captured one event per measurement. That was
the wrong plane and the wrong shape: it attached a distinct_id to a system
measurement and put one event on the wire per sample, which is the per-series
cardinality explosion this design exists to avoid.

Samples now fold into per-series aggregates in memory — counts sum, gauges
keep the last value, histograms accumulate buckets — and flush as one OTLP
data point per series per window to /i/v1/metrics, the plane the product
already ingests through (insights/otel_metrics.py). Delta temporality, so a
data point stands alone and a restart needs no cross-window state. Same wire
shape as the JS SDK.

Client.metrics is lazy and no-throw: a bad metrics config degrades to defaults
rather than raising from the first chained count(). shutdown() flushes what is
pending.
2026-08-08 13:53:23 -07:00
..