tju-yxq opened a new pull request, #1440:
URL: https://github.com/apache/rocketmq-dashboard/pull/1440

   ## What is the purpose of the change
   
   Fixes #1439
   
   `alertName()` stripped non-alphanumeric characters but did not validate that 
the first character is valid for Prometheus alert names (must start with 
`[a-zA-Z_]`, not a digit).
   
   ## Brief changelog
   
   - **`AlertService.java`**: Added check for 
`Character.isDigit(alertName.charAt(0))`, prefixing with `"A_"` if true.
   
   ## Verifying this change
   
   1. Create a rule named `"5xx Error Rate"`.
   2. Export Prometheus YAML.
   3. Before fix: alert name is `5xxErrorRate` (invalid).
   4. After fix: alert name is `A_5xxErrorRate` (valid).
   
   - [x] Make sure there is a Github issue filed for the change.
   - [x] Format the pull request title like `[ISSUE #1439] ...`.
   - [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]

Reply via email to