Skip to content

Fix DDSketch AggregationTemporality loss in window-mode flush - #33

Closed
zzylol with Copilot wants to merge 2 commits into
sketch-modesfrom
copilot/sub-pr-32
Closed

zzylol with Copilot wants to merge 2 commits into
sketch-modesfrom
copilot/sub-pr-32

Conversation

Copilot AI commented Mar 4, 2026 •

Copy link
Copy Markdown

Window-mode flush was silently dropping AggregationTemporality from DDSketch outputs. flushWindow built a bare pmetric.Metric (no type set), causing buildMergedSketchMetric to always emit AggregationTemporalityUnspecified instead of preserving the input temporality.

Changes

  • metricWindow struct — added temporality pmetric.AggregationTemporality field to carry the value through window accumulation
  • accumulateDDSketchMetric — stores metric.DDSketch().AggregationTemporality() onto mw.temporality on each accumulation
  • flushWindow — seeds the tmp metric via tmp.SetEmptyDDSketch().SetAggregationTemporality(mw.temporality) before passing to buildMergedSketchMetric, so the existing DDSketch type-check in that function correctly propagates the preserved temporality
  • processor_test.go — adds an explicit assertion in the window-mode merge test:
assert.Equal(t, pmetric.AggregationTemporalityDelta, sketchMetric.DDSketch().AggregationTemporality())

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…ndow mode

- Add `temporality` field to `metricWindow` to preserve DDSketch AggregationTemporality
- Store temporality in `accumulateDDSketchMetric`
- Use stored temporality when rebuilding metric in `flushWindow`
- Assert output temporality matches input (Delta) in the window-mode test

Co-authored-by: zzylol <50204836+zzylol@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on DDSketch modes and benchmarks Fix DDSketch AggregationTemporality loss in window-mode flush Mar 4, 2026
@zzylol zzylol closed this Mar 5, 2026
@zzylol
zzylol deleted the copilot/sub-pr-32 branch March 10, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants