Export overlay broadcast fan-out drops and throttle the backpressure WARN - #3927
Conversation
Adds tests that assert the overlay broadcast fan-out drops are exported: - henyey-app: broadcast fan-out drop + blackout series pre-registered at 0 on /metrics (fails: series absent from the catalog on main). - henyey-overlay: per-msg_type fan-out drop counter, blackout-on-zero-sent counter, and the pure should_emit_now WARN gate (fails to compile on main: new fields/helper do not yet exist). Refs #3792 Co-authored-by: Claude Code <claude-code@anthropic.com>
…WARN OverlayManager::broadcast drops an outbound message per-peer when that peer's channel is Full. The drop bumped only the aggregate `messages_dropped`, which is the sole `messages_*` field never bridged to Prometheus — hiding 1.73M dropped SCP votes over 29 days on the deployed node, 15% of which reached zero peers. The per-call WARN also amplified to ~24k lines/second during an event-loop park. Add two dedicated, henyey-prefixed series (per ask #1/#2): - henyey_overlay_broadcast_fanout_drop_total{type} — per-msg_type fan-out drops (mirrors the send_by_type pattern), so the SCP-dominated broadcast loss is not conflated with the 5 other sites feeding messages_dropped. - henyey_overlay_broadcast_blackout_total — calls that reached ZERO peers (dropped>0 && sent==0), the case worth alerting on. Both are pre-registered at zero via the existing catalog machinery and bridged in update_overlay_metrics. The aggregate messages_dropped is still incremented alongside for cross-site continuity (#3623). The drop/send control flow is unchanged — purely additive instrumentation, no observable-surface change. The per-call warn! is now gated by a single AtomicU64 + a pure should_emit_now CAS helper to at most one line per second; the counters remain the source of truth so no drop volume is lost. Refs #3792 Co-authored-by: Claude Code <claude-code@anthropic.com>
🔍 Reviewer: CorrectnessVerdict: APPROVE Summary: Cycle 1 complete review. The fix bridges the previously-unexported broadcast fan-out drops to Full reviewChange under review (metrics + logging only):
Correctness — verified:
Test-verification gate (kind: bug-fix): satisfied. Concern class check: cycle 1, no prior verdicts. Complete change-list produced. No blocking concerns. |
🔍 Reviewer: ParityVerdict: APPROVE Summary: Parity-critical crate ( Full reviewObservable/interop surface (per docs/PARITY.md) — unchanged:
Allowed-deviation surface (metrics, logging) — the entirety of this change:
PARITY_STATUS.md: no update required — this adds observability, it does not implement/remove parity-affecting functionality. (The issue's §4 open question about outbound-SCP recoverability is a separate herder-emit question, explicitly out of scope for this metrics PR.) Concern class check: cycle 1, no prior verdicts. No parity concerns. |
✅ MergedCommit: 9f534c2 Follow-up issues filed for unaddressed inline review comments: none (no inline comments; both reviewers APPROVE, CI 41/41 green) |
Closes #3792
Summary
OverlayManager::broadcastdrops an outbound message per-peer when that peer's channel isFull, but the drop only bumped the aggregatemessages_dropped— the onemessages_*field never bridged to Prometheus. This hid 1.73M dropped SCP votes over 29 days on the deployed node (15% of broadcasts reaching zero peers), and the per-call WARN amplified to ~24k lines/second during an event-loop park.This PR adds two dedicated, henyey-prefixed series and throttles the WARN — all purely additive instrumentation; the drop/send control flow is unchanged, so no observable-surface behavior changes.
henyey_overlay_broadcast_fanout_drop_total{type}— per-msg_typefan-out drops (mirrors thesend_by_typepattern), so the SCP-dominated broadcast loss is not conflated with the 5 other sites feedingmessages_dropped.henyey_overlay_broadcast_blackout_total— calls that reached ZERO peers (dropped>0 && sent==0), the case worth alerting on.Both are pre-registered at zero via the existing catalog machinery and bridged in
update_overlay_metrics. The aggregatemessages_droppedis still incremented alongside for cross-site continuity (#3623). The per-callwarn!is gated by a singleAtomicU64+ a pureshould_emit_nowCAS helper to at most one line/second; the counters remain the source of truth so no drop volume is lost.Plan reference
Converged Plan comment
Test plan
Regression test (kind: bug-fix)
crates/app/src/metrics.rs::test_overlay_broadcast_drop_metrics_bridged— direct regression for "invisible to /metrics"; asserts both series render HELP and are pre-registered at 0 ({type="scp_message"} 0).crates/overlay/src/manager/mod.rs::test_broadcast_fanout_drop_by_type_counter— per-type drop counter increments; aggregatemessages_droppedcontinuity asserted.crates/overlay/src/manager/mod.rs::test_broadcast_blackout_on_zero_sent— blackout increments on zero-sent; negative case (≥1 peer accepts) leaves it 0.crates/overlay/src/manager/mod.rs::test_should_emit_now_rate_limit— pure WARN-gate helper.0dad5be— app test FAILED (series absent from catalog); overlay tests failed to compile (fields/helper absent).90835d8.Deviations from plan
None.
🤖 Generated with Claude Code