diff --git a/clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java b/clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java index bdaa22b32f5b9..0612015d1a2fa 100644 --- a/clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java +++ b/clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java @@ -70,18 +70,7 @@ public class JmxReporter implements MetricsReporter { private Predicate mbeanPredicate = s -> true; public JmxReporter() { - this(""); - } - - /** - * 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) { - this.prefix = prefix != null ? prefix : ""; + this.prefix = ""; } @Override diff --git a/clients/src/test/java/org/apache/kafka/common/metrics/JmxReporterTest.java b/clients/src/test/java/org/apache/kafka/common/metrics/JmxReporterTest.java index f1d60d83bf216..f10670f8ab26c 100644 --- a/clients/src/test/java/org/apache/kafka/common/metrics/JmxReporterTest.java +++ b/clients/src/test/java/org/apache/kafka/common/metrics/JmxReporterTest.java @@ -177,23 +177,4 @@ public void testJmxPrefix() throws Exception { metrics.close(); } } - - @Test - public void testDeprecatedJmxPrefixWithDefaultMetrics() throws Exception { - @SuppressWarnings("deprecation") - JmxReporter reporter = new JmxReporter("my-prefix"); - - // for backwards compatibility, ensure prefix does not get overridden by the default empty namespace in metricscontext - MetricConfig metricConfig = new MetricConfig(); - Metrics metrics = new Metrics(metricConfig, new ArrayList<>(Collections.singletonList(reporter)), Time.SYSTEM); - - MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - try { - Sensor sensor = metrics.sensor("my-sensor"); - sensor.add(metrics.metricName("pack.bean1.avg", "grp1"), new Avg()); - assertEquals("my-prefix", server.getObjectInstance(new ObjectName("my-prefix:type=grp1")).getObjectName().getDomain()); - } finally { - metrics.close(); - } - } } diff --git a/docs/upgrade.html b/docs/upgrade.html index 451fef650197c..9cc3aca61c3a3 100644 --- a/docs/upgrade.html +++ b/docs/upgrade.html @@ -32,6 +32,9 @@
Notable changes in 4
  • The auto.include.jmx.reporter configuration was removed. The metric.reporters configuration is now set to org.apache.kafka.common.metrics.JmxReporter by default.
  • +
  • The constructor org.apache.kafka.common.metrics.JmxReporter with string argument was removed. + See KIP-606 for details. +
  • The bufferpool-wait-time-total, io-waittime-total, and iotime-total metrics were removed. Please use bufferpool-wait-time-ns-total, io-wait-time-ns-total, and io-time-ns-total metrics as replacements, respectively.
  • @@ -53,7 +56,7 @@
    Notable changes in 4
  • The original MirrorMaker (MM1) and related classes were removed. Please use the Connect-based MirrorMaker (MM2), as described in the Geo-Replication section..
  • -
  • The use.incremental.alter.configs configuration was removedfrom MirrorSourceConnector. +
  • The use.incremental.alter.configs configuration was removed from MirrorSourceConnector. The modified behavior is identical to the previous required configuration, therefore users should ensure that brokers in the target cluster are at least running 2.3.0.
  • The add.source.alias.to.metrics configuration was removed from MirrorSourceConnector.