tju-yxq opened a new pull request, #1432: URL: https://github.com/apache/rocketmq-dashboard/pull/1432
## What is the purpose of the change Fixes #1431 `formatThreshold()` did not check for `NaN` or `Infinity`, producing invalid PromQL in the exported Prometheus rules YAML. ## Brief changelog - **`AlertService.java`**: Added `Double.isFinite()` check in `formatThreshold()`, returning `"0"` for non-finite values. ## Verifying this change 1. Create an alert rule with `threshold: NaN`. 2. Export Prometheus rules YAML. 3. Before fix: YAML contains `metric > NaN`, Prometheus rejects. 4. After fix: YAML contains `metric > 0`, Prometheus accepts. - [x] Make sure there is a Github issue filed for the change. - [x] Format the pull request title like `[ISSUE #1431] ...`. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit-test to verify your logic correction. - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement. -- 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]
