edge(asapedgeprocessor): wake-on-demand sub-window flush (generic plumbing) - #521
Merged
Merged
Conversation
…mbing) Adds a wakeCh to asapEdgeProcessor and a non-blocking wakeSubWindow() trigger, wired into flushLoop's select alongside the existing subC ticker and window-boundary ticker. This is the mechanism §11 of docs/design-gos-unified-edge-telemetry.md (#520) describes: per-family GOS insert-time threshold crossings will call wakeSubWindow() to get their delta flushed immediately instead of waiting for the next SubWindowInterval tick — no family wires into it yet (that starts with the CountSketch conversion, next in the stack). flushSubWindow's own subWindowEnabled() guard is dropped (it was already redundant given subC only fires when that's true; it would otherwise silently eat a wake when SubWindowInterval is unset). The deeper per-series gate (sa.subWindowEnabled(), which still requires SubWindowInterval>0) is untouched here and is next in line to decouple as GOS families land. Existing subC/ticker-driven flush behavior is unchanged — this is purely additive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR in the split stack (cleanup #516 → NitroSketch #518/#519 aside → GOS docs #520 → this → per-family GOS PRs). Base: #520.
Adds the generic wake-on-demand mechanism §11 of
docs/design-gos-unified-edge-telemetry.md(#520) describes: awakeChonasapEdgeProcessorand a non-blockingwakeSubWindow()trigger, wired intoflushLoop'sselectalongside the existingsubC(SubWindowInterval) ticker and the window-boundary ticker.No sketch family calls
wakeSubWindow()yet — that starts with the CountSketch GOS conversion (next PR in the stack). This PR only lands the plumbing so each per-family PR can wire into it without also touchingflush.go.Scope note (also flagged in-code):
flushSubWindow's ownsubWindowEnabled()guard is dropped — it was already redundant (thesubCchannel only fires when that's true), and it would otherwise silently swallow a wake whenSubWindowIntervalis unset. The deeper per-series gate (sa.subWindowEnabled()inwarm_sketch.go, which still requiresSubWindowInterval>0) is intentionally left alone here — a GOS-only family with no legacy sub-window interval configured won't see any effect from a wake until that gate is decoupled, which is the first per-family PR's job, not this one's.Existing
subC/ticker-driven flush behavior is unchanged — this is purely additive.Test plan
go build/go vet/go test ./...clean onopentelemetry-collector-contrib-patch/processor/asapedgeprocessor.TestWakeSubWindowFlushesBeforeTicker: configuresSubWindowInterval=30m(far longer than the test runs), feeds one Sum data point, callswakeSubWindow()twice back-to-back (proving the non-blocking send doesn't block on a pending wake), and asserts a flush is observed within 2s — output that could only have come from the wake, not the ticker.🤖 Generated with Claude Code