Skip to content

feat(ingestion): show stash dwell and retry timing in batch flow graph - #71071

Merged
jose-sequeira merged 2 commits into
masterfrom
jose-sequeira/control-plane-stash-timing
Jul 15, 2026
Merged

feat(ingestion): show stash dwell and retry timing in batch flow graph#71071
jose-sequeira merged 2 commits into
masterfrom
jose-sequeira/control-plane-stash-timing

Conversation

@jose-sequeira

@jose-sequeira jose-sequeira commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #71033. In the consumer debug batch detail view, a deferred batch only shows that work was stashed ("flushed & re-routed" or "awaiting flush"). The events carry timestamps, but the flow graph drops them when aggregating, so you can't see when the work was deferred, how long it sat stashed, or when and where it was retried without diffing lifecycle timestamps by hand.

Changes

  • The consumer never emitted the DeferredFlushed debug event: flush_deferred built the re-routed sub-batches but never recorded the event, so the UI showed every stashed batch as "awaiting flush" forever. The flush path now records it (with a dispatcher regression test).
  • The batch model now keeps ts_ms on deferred, flushed, retry, and exhausted entries instead of discarding it.
  • The stash node in the flow graph shows when the work was deferred and, once flushed, the dwell time ("flushed after 340ms"); until then it still shows "awaiting flush".
  • Stash-to-worker flush edges are labeled with the flushed message count plus dwell relative to the first deferral ("flushed 120 · +340ms").
  • Assign-to-worker edges show send retry counts ("sent 120 · ↻2") and turn amber when retries happened.
  • The lifecycle timeline annotates each flush event with how long the stashed work waited.
  • Adds a small fmtDur helper (ms / s / m formatting).

How did you test this code?

Browser-only vanilla JS with no test harness. I extracted the inline script and ran node --check for syntax, plus a node unit test of buildFlow with a synthetic batch (deferred at t, flushed at t+340ms to one worker, one retry on another) asserting the stash node dwell text, the flush edge label, the retry edge label and color, the fmtDur formats, and the "awaiting flush" state for a still-stashed batch. I was not able to exercise it against a live consumer in this session.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

Internal debug tooling, no user-facing docs affected.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored with Claude Code, directed by José: the deferred/stash graphics didn't show how and when stashed work was retried. I (Claude) threaded the existing event timestamps through the client-side batch model rather than adding new backend events, since the SSE stream already carries ts_ms on every event. Dwell on flush edges is measured against the first deferral of the batch, which is an approximation when a batch defers multiple times — the lifecycle timeline has the exact per-event gaps.

Deferred work previously showed only that it was stashed; the flow graph
now shows when it was deferred, how long it waited before each flush,
per-worker flushed message counts with dwell on the edges, retry counts
on the assign edges, and waited durations on the lifecycle timeline.
@jose-sequeira jose-sequeira self-assigned this Jul 15, 2026
@trunk-io

trunk-io Bot commented Jul 15, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@jose-sequeira
jose-sequeira marked this pull request as ready for review July 15, 2026 14:21
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(ingestion): show stash dwell and re..." | Re-trigger Greptile

Comment thread rust/ingestion-control-plane/src/ui/consumer_debug.html
Comment thread rust/ingestion-control-plane/src/ui/consumer_debug.html
Comment thread rust/ingestion-control-plane/src/ui/consumer_debug.html Outdated
The consumer's flush_deferred never recorded a DeferredFlushed debug
event, so the debug UI showed deferred batches as awaiting flush
forever. Also measure timeline dwell from the first deferral of a stash
cycle instead of the latest, and round durations before picking the
unit so minute boundaries don't render as 60.0s or 1m 60s.
@jose-sequeira
jose-sequeira enabled auto-merge (squash) July 15, 2026 15:09
@jose-sequeira
jose-sequeira merged commit 820eef7 into master Jul 15, 2026
203 checks passed
@jose-sequeira
jose-sequeira deleted the jose-sequeira/control-plane-stash-timing branch July 15, 2026 15:20
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-15 16:00 UTC Run
prod-us ✅ Deployed 2026-07-15 16:19 UTC Run
prod-eu ✅ Deployed 2026-07-15 16:21 UTC Run

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