Task · TSO-0148

Decouple ingress WAL completion from metric collection to preserve configured DPM

Description

Ingress WAL completion currently calls the shared telemetry Provider.ForceFlush for each accepted streaming or webhook body. This initiates a fresh metric collection outside otlp.metric_interval, exports unrelated metrics sharing the provider, and resets the pinned SDK periodic-reader timer. Incoming traffic can therefore override operator-selected sample cadence and increase datapoints per minute. TSO-0147 mitigated premature flush timeouts but did not correct this contract violation. Revisit the durability and export-scheduling boundary; cadence correctness is primary and throughput is secondary. Cumulative remains the default and the required mode for this work. Delta temporality and loss of metric detail are not acceptable fixes.

Acceptance Criteria

Definition of Done

Implementation Plan

loop17: design the scheduled-collection acknowledgement boundary, obtain adversarial design review, implement and prove criteria 1-6, then extend the identical-entry harness for criterion 7. Root owns reviews and publication.

loop17 accepted reviewed design: bounded original-generation preparation window, provider-scoped receipt programs, original-slot cumulative collection and immutable split delivery; required metric/log receipts pin until confirmed, best-effort saturation loss is explicit. Build owns existing accounting fixture normal-slot compatibility before its full gate; sustained harness follows land. Design review cleared all blockers; runtime proof remains required.

Implementation Notes

TSO-0149 supplies the local comparison harness. Its coalesced-body experiment reduces both flush barriers and disk commits and changes the rollup top-N window; it is directional evidence, not proof of a multi-entry group-commit implementation. Compare identical admitted entries when implementing this task.

Local harness delivered in TSO-0149. Two workload sizes each ran all six cases twice with exact exported byte accounting and zero pending WAL state. On the larger local case, fewer-barrier coalescing drained in about 2s versus about 15s baseline; delta about 2.45s; external collapsing about 1.6s; rollup-only about 8s; smaller OTLP batches 40-47s. These are synthetic finite-drain results with documented confounders, not production sizing or implemented multi-entry batching. See docs/wal-load-testing.md.

2026-09-11 scope correction requested by the operator: this is a high-priority metric-cadence correctness bug, not a batching enhancement. The revised description and acceptance criteria supersede the earlier throughput-first direction. Historical TSO-0149 measurements remain useful experimental evidence, but its delta case is not an actionable option for this work, and coalescing changes both disk commits and rollup windows. A design must decouple ingress durability completion from scheduled cumulative collection before any throughput claim can close this task. Source pointers: internal/app/ingresswal.go applyEnvelope; internal/app/collectors.go WAL route flush wiring; internal/telemetry/provider.go ForceFlush; internal/telemetry/processors.go newMetricReader. Task remains To Do: this update authorizes no implementation or deployment.

loop18 resumes the preserved partial build without resetting prior attempts; criteria 1-6 precede the identical-entry harness for criterion 7.

loop18: resumed the interrupted loop17 implementation cycle without resetting prior attempts; no completed mandatory-gate change-and-verify cycle in this run. Two same-protocol infrastructure retries exhausted with loop-pi recovery required; automatic continuation declined. Exact unfinished candidate retained; full app fixture compilation remains red, lifecycle/fixtures and all six cadence suffixes unfinished. The build is unaccepted and unlanded; criterion 7 harness is held until build land. Resume after the harness recovery defect is resolved, preserve accepted design and existing attempt history.

loop19: build (criteria 1-6) landed 54915a36 after 1 implementation attempt (complex-worker) + 2 review-repair rounds (security review: readiness flap, annotation tee, export-failure accounting; CodeRabbit: construction error, window quota order, direct-path observers). Composed just check green, ci-success green. Criterion 7 harness in progress.

loop19: criterion 7 harness landed ae021320 (1 attempt + 2 review-repair rounds: outage case now asserts rejections; default-suite caps bind; CI-margin widening). Composed just check && just load-wal green; CI green on containing main f759c418. Build attempts: 1 complex-worker attempt + 2 review-repair rounds. Follow-up TSO-0159 (nondeterministic cadence test seen once on CI) in progress.

Final Summary

WAL completion no longer forces metric collections: ingress work stages into a bounded window and commits only after the scheduled collection and required logs are acknowledged (54915a36). Criterion 7: sustained-load harness compares identical admitted entries (ae021320). Only out-of-schedule flush: shutdown and loss of leadership (D1).

View the source file on GitHub