π€ This comment was generated by Claude on behalf of @keddie.
Part of #1201.
Gauge β last-value metric via LWWRegister
A gauge reports a current value (temperature, queue depth, in-use memory) β the thing a Sum can't express. The mergeable form is last-value-wins, which is exactly LWWRegister, already in the CRDT zoo. This is the cheapest primitive in the epic: merge by timestamp, done.
Shape
LWWRegister<Double> (or a numeric payload) per attribute set.
- Merge = higher-timestamp wins (existing
LWWRegister semantics).
- Covers OTel
Gauge / ObservableGauge (async observed current value).
- Serializes to OTLP
NumberDataPoint under a Gauge.
Notes / design surface
- Tie-break must be deterministic β reuse whatever total order
LWWRegister already uses (timestamp + replica-id tiebreak); don't introduce a second convention.
- Async/observable gauges are pull-at-collection β the register just holds the latest observed value; no accumulation.
- Confirm the injected
Clock/timestamp source is the same one the rest of the exporter uses (time is a dependency β no wall-clock reads).
Acceptance
Placement (zoo vs. exporter-local) is resolved once for the epic β see #1201.
Part of #1201.
Gauge β last-value metric via
LWWRegisterA gauge reports a current value (temperature, queue depth, in-use memory) β the thing a
Sumcan't express. The mergeable form is last-value-wins, which is exactlyLWWRegister, already in the CRDT zoo. This is the cheapest primitive in the epic: merge by timestamp, done.Shape
LWWRegister<Double>(or a numeric payload) per attribute set.LWWRegistersemantics).Gauge/ObservableGauge(async observed current value).NumberDataPointunder aGauge.Notes / design surface
LWWRegisteralready uses (timestamp + replica-id tiebreak); don't introduce a second convention.Clock/timestamp source is the same one the rest of the exporter uses (time is a dependency β no wall-clock reads).Acceptance
LWWRegister, merge-by-timestamp.Gauge/NumberDataPointserialization.Placement (zoo vs. exporter-local) is resolved once for the epic β see #1201.