Skip to content

fix(kpi): show a dash, not zero, when the platform keeps no totals - #82

Merged
htcom-code merged 2 commits into
mainfrom
fix/kpi-totals-metrics-off
Oct 12, 2026
Merged

htcom-code merged 2 commits into
mainfrom
fix/kpi-totals-metrics-off

Conversation

@htcom-code

@htcom-code htcom-code commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Closes #81

Why

On a platform with per-module metrics off (protean.trace.metrics.enabled=false, the quickstart default), the KPI row showed Requests · total 0 and Error rate 0.00% while traffic was flowing. I saw this live on 2026-10-12 against quickstart during a 3,000-request burst. The platform reports the situation correctly: its ready ack says metricsEnabled: false, and its metrics frames are []. The two tiles summed that empty array and turned "not aggregated" into a confident zero. The module table already reads the ack (#63); the tiles didn't.

What

  • The two tiles now follow the module table's ack-driven reading, checked in the same order:

    Situation Tiles
    metrics has rows the numbers (rows are data, even if the live setting changed after the ack)
    tracesEnabled: false — and "recording off"
    metricsEnabled: false — and "metrics off"
    metricsEnabled: true the numbers, so 0 here is a true zero
    no ack and no rows — and "not reported"

    tracesEnabled is checked first. metricsEnabled is the effective value, so turning recording off also reports metrics as off, and "metrics off" would point the operator at the wrong switch.

  • The tiles do not fall back to summary.count. That count is capped by the ring capacity (measured: 340 requests reported as 200), so it would understate traffic more the busier the platform is. The summary trend lines (vs prev, err) stay as they are.

  • The reason sits where the unit would (— metrics off), so each tile stays one line tall and its sub-line is unchanged.

  • The helper is private to kpi-row.tsx, so the file adds no lint warning.

Verification

  • 7 new scenarios (245 tests in total). They replay the captured protean, Spring and Go connect sequences and check every row of the table.
  • Revert check: with main's kpi-row.tsx put back, 4 of the 7 fail. The other 3 cover behaviour that has to stay the same: a true zero, rows shown despite an "off" ack, and Go sending rows.
  • Gates: the full suite passes run serially (245/245). Lint is clean (the same 7 warnings as main), and the build passes.
  • Live, against quickstart on :8080 with metrics off (ready: tracesEnabled: true, metricsEnabled: false, metrics: []) and about 650 /items/add requests:
    • Both tiles read — metrics off, matching the module table's "Module metrics are off".
    • The summary sub-lines still show (↓ 67% vs prev, — 0.00pp · 0 err).
    • The latency tile and chart are unchanged.
  • A layout fix came out of the live check (second commit). The reason was first appended to the sub-line, which wrapped the requests tile onto two lines and made it taller than the rest of the row. It now sits where the unit would, after a non-breaking space.

On a platform with per-module metrics off, the request and error-rate
tiles read "0" and "0.00%" over live traffic. They sum the per-module
rows in `metrics`, and that frame is empty when nothing is aggregated,
so an unknown became a confident zero. Seen live on quickstart under a
3,000-request burst.

- The tiles read the `ready` ack the way the module table already does:
  recording off first, then metrics off, then not reported. In each case
  they show a dash and name the reason
- Metrics on with no rows still shows 0, because that is true. Rows that
  did arrive are always shown, since the setting can change after the ack
- Not replaced with `summary.count`: it is capped by the ring capacity
  and reads lower the busier the platform is. The summary trend lines
  stay
- 7 scenarios replay the protean, Spring and Go connect sequences. With
  the old tiles, 4 of them fail; the other 3 guard what must not change

Closes #81

Tags: #kpi #honesty
Co-Authored-By: htjulia <htjulia1@gmail.com>
Checked live on quickstart with metrics off. Appending the reason to the
sub-line wrapped the requests tile onto a second line, so it stood
taller than the rest of the row. The reason now sits where the unit
would, after a non-breaking space, and the sub-lines say what they
always said.

Tags: #kpi
Co-Authored-By: htjulia <htjulia1@gmail.com>
@htcom-code
htcom-code merged commit c9d441a into main Oct 12, 2026
4 checks passed
@htcom-code
htcom-code deleted the fix/kpi-totals-metrics-off branch October 12, 2026 07:19
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.

KPI tiles show 0 requests when the platform has per-module metrics off

1 participant