Frun1na opened a new pull request, #6527:
URL: https://github.com/apache/rocketmq-dashboard/pull/6527

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6524
   
   ### Brief Description
   
   #6184 made `CloudRocketMqBusinessMetricsCollector` publish 
`consumer.lag.max_queue` as
   `MetricAvailability.UNSUPPORTED` (`CLOUD_QUEUE_LAG_UNSUPPORTED`), because 
the Aliyun and Tencent progress rows
   are per-topic aggregates without queue offsets — and its message tracks the 
remaining half as a maintainer
   follow-up: `NativeAlertMetricCatalogService.BUSINESS_CLOUD`
   
(`server/src/main/java/org/apache/rocketmq/studio/ops/alert/NativeAlertMetricCatalogService.java:41-44`)
 still
   listed the metric, so `list(instanceId, BUSINESS)` offered it in the rule 
editor and `validate` (`:78-85`)
   accepted a cloud rule for it. `AlertRuleEvaluator` (`:34-38`) reports an 
`UNSUPPORTED` sample as matched with the
   condition unmet, so such a rule could never fire — 
`docs/studio-native-alerting-design.md:147` requires the
   catalog to be capability-aware and hide metrics that can never run.
   
   The metric is dropped from `BUSINESS_CLOUD`, with a comment naming the 
collector behaviour that makes it
   unsupported, and the design doc's source column for the metric (`:142`) now 
says Apache-only. `NATIVE_METRICS`
   keeps the key (Apache still measures it), so an Apache instance keeps 
offering and accepting the metric and the
   other cloud metrics (`consumer.lag.total`, `topic.backlog.total`) are 
untouched. Stored cloud rules are
   deliberately not migrated: #6184's note leaves the fate of a frozen firing 
rule open, and this change only
   affects capability listing and rule validation.
   
   User-visible change: the rule editor no longer offers 
`consumer.lag.max_queue` for Aliyun/Tencent instances, and
   saving a cloud rule that names it now answers `400 Native metric 
consumer.lag.max_queue is not supported by the
   selected Studio instance` instead of being accepted.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -DforkCount=1 
-Dsurefire.failIfNoSpecifiedTests=false
       
-Dtest=NativeAlertMetricCatalogServiceTest,AlertRuleControllerTest,ClusterAlertRuleControllerTest,AlertRuleTransferServiceTest
   [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 -- in 
NativeAlertMetricCatalogServiceTest
   [INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0 -- in 
AlertRuleControllerTest
   [INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0 -- in 
ClusterAlertRuleControllerTest
   [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 -- in 
AlertRuleTransferServiceTest
   [INFO] BUILD SUCCESS
   ```
   
   `doesNotOfferTheCloudQueueMaximumNoCloudCollectorMeasuresTest` asserts the 
Aliyun and Tencent BUSINESS lists are
   exactly `[consumer.lag.total, topic.backlog.total]`, that `validate` answers 
400 for a cloud rule naming the
   metric, and — as the control against over-correcting — that an Apache 
instance still lists and accepts it. The
   pre-existing `returnsOnlyMetricsBackedByTheSelectedProviderTest` had its 
cloud expectation updated.
   
   The new test fails without the fix — only the catalog entry restored, the 
tests kept:
   
   ```
   [ERROR] Tests run: 3, Failures: 2, Errors: 0, Skipped: 0
   doesNotOfferTheCloudQueueMaximumNoCloudCollectorMeasuresTest -- <<< FAILURE!
   Expecting actual:
     ["consumer.lag.total", "consumer.lag.max_queue", "topic.backlog.total"]
   to contain exactly (and in same order):
     ["consumer.lag.total", "topic.backlog.total"]
   but some elements were not expected:
     ["consumer.lag.max_queue"]
   
   returnsOnlyMetricsBackedByTheSelectedProviderTest -- <<< FAILURE!
   ```
   
   (The second failure is the updated cloud expectation in the pre-existing 
test flipping back to the old list,
   which is the same behaviour change.)
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [ ] New source files carry the ASF license header
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   


-- 
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]

Reply via email to