Add error-rate tracking and per-client incident surfacing#7
Merged
Conversation
Layer live error-rate and incident detection onto the endpoint dashboard. - probes/httptop.js: tally respTotal/errs/err4/err5 per endpoint with an errors/sec ring buffer; export errRate(); parse a configurable client header (--client-header, default x-api-key) for a per-endpoint "by client" breakdown; add a sortMode signal (count|errors) and topAlert() to find the worst over-threshold endpoint and the client driving it. - lib/format.js: fmtErrPct(), errColor() heat scale, W_ERR/W_PATH widths, and a cell() helper that fits a string to an exact column width — a Text's width is only a max, so a fixed column must carry its own padding. - list.jsx: new ERR% column; pad HOST/PATH/rank to fixed widths so every column lines up under its header and row-to-row. - detail.jsx: Errors field (4xx/5xx split), errors/sec sparkline, and a "By client (worst first)" table. - statusbar.jsx: red incident banner when topAlert() fires. - main.jsx / legend.jsx: wire the `e` sort toggle and its legend hint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jacobpradels
approved these changes
Jul 2, 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
Layers live error-rate tracking and incident surfacing onto the existing endpoint dashboard — it goes from "ranked endpoint traffic" to "ranked endpoint traffic + live error/incident detection with per-client attribution."
What's new
probes/httptop.js): each endpoint talliesrespTotal,errs,err4(4xx),err5(5xx) with an errors/sec ring buffer; new exportederrRate().Hostplus a configurable client header —--client-header(defaultx-api-key), falling back toHost→anon. Each endpoint keeps aclientsmap so you can see who drives traffic and errors.sortModesignal —count(default) orerrors— toggled withe.topAlert()finds the worst endpoint over threshold (≥20 responses, ≥15% error rate) and names the client causing most of its errors.UI
ERR%column (red+bold once it clears the noise band).topAlert()fires.HOST/PATH/rank are now padded to fixed widths via a newcell()helper. AText'swidthis only a max in this tui — it won't pad short content — so columns previously drifted row-to-row; they now line up under their headers and across every row.Testing
Verified locally against the bundled demo (
demo/traffic.shoverlo):ERR%shows ~8% on/api/ordersand ~100% on/static/app.js;ere-sorts worst-first; the incident banner fires after the threshold accumulates; the detail by-client table and sparkline populate; columns stay aligned regardless of host/path length. JS re-bundles cleanly (make bundle).🤖 Generated with Claude Code