zmuxuny opened a new pull request, #4512: URL: https://github.com/apache/rocketmq-dashboard/pull/4512
### Which Issue(s) This PR Fixes - Fixes #4510 ### Brief Description Tencent RocketMQ 5.x documents `SubscriptionData.ConsumerLag` as nullable when no valid value can be obtained. Studio previously converted that state to `0`, making an unavailable measurement look like healthy zero backlog. This change preserves the existing unknown-lag contract end to end: - `TencentInstanceProvider.getGroupProgress`: null lag becomes `-1` instead of `0`. - Tencent Topic-consumer mapping keeps `diffTotal=-1` and sets `metricsAvailable=false`, so the existing UI renders unavailable rather than `0`/`-1` as a quantity. - `CloudRocketMqBusinessMetricsCollector` no longer clamps negative unknown lag to zero. - If any progress row is unknown, group `consumer.lag.total` and `consumer.lag.max_queue` are UNAVAILABLE. - Topic backlog remains granular: known topics keep valid samples, while a topic containing an unknown row is UNAVAILABLE. Known positive/zero lag semantics are unchanged. ### Red / Green Verification Baseline: `master@987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`. Fail-before: - Tencent group progress with `ConsumerLag=null`: expected `-1`, got `0`. - Tencent Topic-consumer row with `ConsumerLag=null`: expected `-1`/unavailable, got `0`/available. - Cloud metrics with mixed known + unknown progress: expected aggregate UNAVAILABLE, got AVAILABLE. - Focused run: **49 tests, exactly 3 failures**; all existing cases passed. Green, Java 21: - `TencentInstanceProviderTest,CloudRocketMqBusinessMetricsCollectorTest`: **49/49 passed**. - Plus `ApacheRocketMqBusinessMetricsCollectorTest,NativeAlertProcessorTest`: **76/76 passed**. - Checkstyle: **0 violations**. - `mvn -B -ntp -DskipTests package`: **BUILD SUCCESS**. - `git diff --check`: clean. ### Provider contract Tencent's current `SubscriptionData` documentation states that `ConsumerLag` may be null when a valid value cannot be obtained: https://cloud.tencent.com/document/product/1493/96031 This PR therefore distinguishes provider-unavailable data from a genuine zero backlog; it does not change the Tencent API calls or add dependencies. AI-assisted source audit, implementation and regression authoring; all red/green commands above were executed locally against the stated baseline. -- 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]
