Before Creating the Enhancement Request
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.
Before Creating the Enhancement Request
Summary
In
tools/src/main/java/org/apache/rocketmq/tools/command/stats/StatsAllSubCommand.java, there are multiple emptycatch (Exception e)blocks (lines 58, 77, 91, 198) that silently swallow exceptions without any logging. This makes it difficult to diagnose issues when thestatsAllcommand fails to retrieve statistics from certain brokers.Motivation
When using the
mqadmin statsAllcommand, 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()orlog.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 onStatsAllSubCommandas a starting point.