unbridled-41 opened a new pull request, #5926: URL: https://github.com/apache/rocketmq-dashboard/pull/5926
### Which Issue(s) This PR Fixes Fixes #5925 ### Problem / Evidence The backend reports whether the consume-stats read succeeded and keeps the placeholder zeros when it did not (`RocketMQMetadataProvider.enrichGroupLiveStats`: "No consume stats (e.g. POP-only group without an offset table): keep zeros" -> `GroupLiveSnapshot(..., false, 0L, 0, false)`), and it refuses to conclude anything from that state itself (`GroupDetailToolHandler` returns health `UNKNOWN`; `ApacheRocketMqBusinessMetricsCollector` emits `CONSUMER_STATS_UNAVAILABLE` instead of a zero). The console never read the flag (`grep -rn consumeStatsAvailable web/src` -> no hits), so it presented the placeholder as a measurement: ``` ConsumerPage: reports a group whose consume stats could not be read as an unknown backlog TestingLibraryElementError: Unable to find an element with the text: 不可用 consumerGroupDiagnostics: ... expected null, received 0 / status healthy ``` The lag column showed a green 0 and sorted on it, the detail card showed a green 0, and the health panel reported no issue at all. ### Root cause / Fix "Stats unavailable" is a second unknown encoding next to the `-1` sentinel, and only the sentinel was handled. Read the flag: the backlog renders as 不可用 (through the sentinel the colour and formatter already understand), the sort key keeps such rows after measured ones in either direction, `reportedLag` becomes null, and a `CONSUME_STATS_UNAVAILABLE` warning is added so the group is no longer graded healthy. ### Priority and scoring **PRIORITY 68** — impact 28/40 (a group that may be lagging is reported as caught up and healthy, which is the page's main verdict), blast radius 14/20 (every group whose stats read failed), reproducibility 18/20 (deterministic, pinned by two new tests), maintenance value 8/20. **FIX_CONFIDENCE 80** — the flag exists for exactly this decision and the sibling columns already establish the rendering. ### Tests `cd web && npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx src/utils/consumerGroupDiagnostics.test.ts` -> `Test Files 2 passed (2), Tests 53 passed (53)`. | Test | Before | After | |---|---|---| | `ConsumerPage: reports a group whose consume stats could not be read as an unknown backlog` | FAIL (measured 0, no 不可用) | PASS | | `consumerGroupDiagnostics: reports a group whose consume stats could not be read as unknown instead of healthy` | FAIL (`reportedLag` 0, status healthy) | PASS | The page case also asserts the drawer's card, the health panel and the descending sort order. `npx eslint` reports no errors; `npx tsc -b` passes. ### Risk Only groups whose stats read is explicitly flagged as failed change; providers that do not send the flag keep today's rendering because the check is `=== false`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
