Loyal-Young opened a new issue, #6444: URL: https://github.com/apache/rocketmq-dashboard/issues/6444
### What happened AlertService.formatThreshold casts every mathematically integral double to long. Finite thresholds outside the signed long range are silently saturated when exporting Prometheus YAML. For example a rule with threshold 1e20 exports 9223372036854775807; -1e20 exports -9223372036854775808. The exported condition differs from the configured rule. ### Reproduction Save an enabled external metric rule such as `rocketmq_consumer_lag_messages > 1e20`, then export Prometheus rules. The threshold is replaced by Long.MAX_VALUE. Values at the positive double/long boundary are affected too because (double) Long.MAX_VALUE rounds to 2^63. ### Expected correction Only use integral long formatting when the double is within the actual cast-safe range; otherwise preserve the finite double literal. Cover both bounds, very large values, and ordinary integer/fraction formatting through the YAML export API. -- 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]
