SGloria opened a new issue, #10492:
URL: https://github.com/apache/rocketmq/issues/10492

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement 
rather than a bug/feature.
   
   ### Summary
   
   In 
`tools/src/main/java/org/apache/rocketmq/tools/command/stats/StatsAllSubCommand.java`,
 there are multiple empty `catch (Exception e)` blocks (lines 58, 77, 91, 198) 
that silently swallow exceptions without any logging. This makes it difficult 
to diagnose issues when the `statsAll` command fails to retrieve statistics 
from certain brokers.
   
   ### Motivation
   
   When using the `mqadmin statsAll` command, if some brokers are temporarily 
unavailable or return errors, the exceptions are completely hidden. Users and 
operators cannot tell whether the statistics output is complete or partially 
missing due to errors. Adding at least debug-level logging would significantly 
improve observability and debugging experience.
   
   ### Describe the Solution You'd Like
   
   Add `log.debug()` or `log.warn()` calls in the empty catch blocks to record 
the exception information, so that operators can enable debug logging to 
troubleshoot missing statistics data.
   
   ### Describe Alternatives You've Considered
   
   One alternative is to accumulate errors and print a summary at the end of 
the command execution, but simple debug logging is less intrusive and more 
aligned with the existing code style.
   
   ### Additional Context
   
   Similar empty catch blocks exist in other command files under 
`tools/src/main/java/org/apache/rocketmq/tools/command/`, but this issue 
focuses specifically on `StatsAllSubCommand` as a starting point.


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