Skip to content

fix(top): read the H2 flood metric names the detector emits - #1812

Merged
FlorentinDUBOIS merged 3 commits into
mainfrom
fix/top-h2-flood-metric-names
Oct 3, 2026
Merged

FlorentinDUBOIS merged 3 commits into
mainfrom
fix/top-h2-flood-metric-names

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1810

What

The sozu top H2 pane (tab 6) read h2.flood.violation.{rapid_reset,made_you_reset,continuation,ping,settings,priority}, names the H2 flood detector never emits, so only glitch_window could ever leave zero while a mitigation fired. It now reads the thirteen h2.flood.violation.* keys H2FloodDetector emits, most severe first (a short terminal drops the bottom rows), plus h2.flood.stream_refused from #1798, each with its trend sparkline (H2_TRACKED_KEYS).

  • lib/src/metrics/names.rs: the six phantom constants are removed; one constant per emitted key and FLOOD_VIOLATION_KEYS are added. Library API: code importing the removed constants no longer compiles (they named metrics nothing emitted).
  • test_flood_violation_metric_keys_are_unique_and_namespaced now also drives the stream-0 WINDOW_UPDATE arm it missed and asserts the emitted keys equal FLOOD_VIOLATION_KEYS.
  • New ctl::top::panes::h2::tests::flood_rows_read_the_emitted_flood_metric_names: every h2.flood.* row is emitted, every emitted key (and stream_refused) has a row, every row has a trend.
  • snapshot_h2_120x40 regenerated: 17 flood-block rows still fit at 120x40.
  • Docs: doc/sozu-top.md H2 row names the real keys; CHANGELOG entry under Fixed.

No protocol or security behavior changes: the detector emits exactly what it emitted before; only the TUI and the shared name constants change.

Seen red before the fix

the H2 pane reads h2.flood.violation.rapid_reset, which the flood detector never emits
test result: FAILED. 0 passed; 1 failed   (cargo test -p sozu --features tui --bin sozu flood_rows)

assertion `left == right` failed: names::h2::FLOOD_VIOLATION_KEYS (read by `sozu top`) must list exactly the emitted keys
  (emitted list lacked window_update_stream0_window until the test drove that arm)

Commands run

  • cargo +nightly fmt --all -- --check -> exit 0
  • cargo +1.93.1 clippy --all-features --all-targets --locked -- -D warnings -> exit 0
  • cargo +1.93.1 test -p sozu --locked -> 248 passed, 0 failed
  • cargo +1.93.1 test -p sozu --features tui --locked --bin sozu -> 147 passed, 0 failed (the top module is behind the tui feature)
  • cargo +1.93.1 test -p sozu-lib --lib --all-features --locked -> 1586 passed, 0 failed
  • python3 .github/scripts/check_doc_citations.py --base origin/main -> exit 0

The `sozu top` H2 pane read `h2.flood.violation.{rapid_reset,
made_you_reset,continuation,ping,settings,priority}`, names the H2 flood
detector never emits, so only `glitch_window` could leave zero. Show the
thirteen `h2.flood.violation.*` keys `H2FloodDetector` emits, most severe
first, plus `h2.flood.stream_refused` (#1798), with their trends.

`names::h2` drops the six phantom constants and gains one constant per
emitted key plus `FLOOD_VIOLATION_KEYS`. The detector's metric-key test
now covers the stream-0 WINDOW_UPDATE arm and requires that list to
match the emitted keys exactly; a new `sozu top` test requires the pane
to read only and all of them. `doc/configure.md` lists the missing
`h2.flood.violation.window_update_stream0_window`.

Fixes #1810

Signed-off-by: Florentin Dubois <[email protected]>
…ic-names

#1809 added the `h2.flood.violation.window_update_stream0_window` row to
doc/configure.md; keep its copy, drop this branch's duplicate, and drop
the CHANGELOG sentence that claimed the row.

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS merged commit c5fd126 into main Oct 3, 2026
24 checks passed
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.

sozu top: H2 pane reads flood metric names the detector never emits

1 participant