xiaodongdu commented on a change in pull request #8691: URL: https://github.com/apache/kafka/pull/8691#discussion_r429495940
########## File path: clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java ########## @@ -71,8 +72,13 @@ public JmxReporter() { /** * Create a JMX reporter that prefixes all metrics with the given string. + * @deprecated Since 2.6.0. Use {@link JmxReporter#JmxReporter()} + * Initialize JmxReporter with {@link JmxReporter#contextChange(MetricsContext)} + * Populate prefix by adding _namespace/prefix key value pair to {@link MetricsContext} */ + @Deprecated public JmxReporter(String prefix) { + Objects.requireNonNull(prefix); Review comment: Change the logic here: if null, set it to space. ########## File path: clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java ########## @@ -71,8 +72,13 @@ public JmxReporter() { /** * Create a JMX reporter that prefixes all metrics with the given string. + * @deprecated Since 2.6.0. Use {@link JmxReporter#JmxReporter()} + * Initialize JmxReporter with {@link JmxReporter#contextChange(MetricsContext)} + * Populate prefix by adding _namespace/prefix key value pair to {@link MetricsContext} */ + @Deprecated public JmxReporter(String prefix) { + Objects.requireNonNull(prefix); Review comment: Change the logic here: if null, set it to empty string. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org