KAFKA-17528 Remove whitelist/blacklist from JMXReporter (#17179)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Chia-Chuan Yu 2024-09-23 11:17:01 +08:00 committed by GitHub
parent bf450ebe5a
commit 8c2a0619e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View File

@ -55,16 +55,12 @@ public class JmxReporter implements MetricsReporter {
public static final String METRICS_CONFIG_PREFIX = "metrics.jmx.";
public static final String EXCLUDE_CONFIG = METRICS_CONFIG_PREFIX + "exclude";
public static final String EXCLUDE_CONFIG_ALIAS = METRICS_CONFIG_PREFIX + "blacklist";
public static final String INCLUDE_CONFIG = METRICS_CONFIG_PREFIX + "include";
public static final String INCLUDE_CONFIG_ALIAS = METRICS_CONFIG_PREFIX + "whitelist";
public static final Set<String> RECONFIGURABLE_CONFIGS = Utils.mkSet(INCLUDE_CONFIG,
INCLUDE_CONFIG_ALIAS,
EXCLUDE_CONFIG,
EXCLUDE_CONFIG_ALIAS);
EXCLUDE_CONFIG);
public static final String DEFAULT_INCLUDE = ".*";
public static final String DEFAULT_EXCLUDE = "";
@ -311,8 +307,8 @@ public class JmxReporter implements MetricsReporter {
public static Predicate<String> compilePredicate(Map<String, ?> originalConfig) {
Map<String, ?> configs = ConfigUtils.translateDeprecatedConfigs(
originalConfig, new String[][]{{INCLUDE_CONFIG, INCLUDE_CONFIG_ALIAS},
{EXCLUDE_CONFIG, EXCLUDE_CONFIG_ALIAS}});
originalConfig, new String[][]{{INCLUDE_CONFIG},
{EXCLUDE_CONFIG}});
String include = (String) configs.get(INCLUDE_CONFIG);
String exclude = (String) configs.get(EXCLUDE_CONFIG);

View File

@ -51,6 +51,15 @@
The <code>--whitelist</code> option was removed from the <code>kafka-console-consumer</code> command line tool.
Please use <code>--include</code> instead.
</li>
<li>
The <code>metrics.jmx.blacklist</code> was removed from the <code>org.apache.kafka.common.metrics.JmxReporter</code>
Please use <code>metrics.jmx.exclude</code> instead.
</li>
<li>
The <code>metrics.jmx.whitelist</code> was removed from the <code>org.apache.kafka.common.metrics.JmxReporter</code>
Please use <code>metrics.jmx.include</code> instead.
</li>
</ul>
</ul>