diff --git a/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConfig.java b/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConfig.java index 974db4057b8..525700bf8e6 100644 --- a/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConfig.java +++ b/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceConfig.java @@ -91,11 +91,6 @@ public class MirrorSourceConfig extends MirrorConnectorConfig { private static final String OFFSET_LAG_MAX_DOC = "How out-of-sync a remote partition can be before it is resynced."; public static final long OFFSET_LAG_MAX_DEFAULT = 100L; - public static final String ADD_SOURCE_ALIAS_TO_METRICS = "add.source.alias.to.metrics"; - private static final String ADD_SOURCE_ALIAS_TO_METRICS_DOC = "Deprecated. Whether to tag metrics with the source cluster alias. " - + "Metrics have the target, topic and partition tags. When this setting is enabled, it adds the source tag. " - + "This configuration will be removed in Kafka 4.0 and the default behavior will be to always have the source tag."; - public static final boolean ADD_SOURCE_ALIAS_TO_METRICS_DEFAULT = false; public static final String OFFSET_SYNCS_SOURCE_PRODUCER_ROLE = OFFSET_SYNCS_CLIENT_ROLE_PREFIX + "source-producer"; public static final String OFFSET_SYNCS_TARGET_PRODUCER_ROLE = OFFSET_SYNCS_CLIENT_ROLE_PREFIX + "target-producer"; public static final String OFFSET_SYNCS_SOURCE_ADMIN_ROLE = OFFSET_SYNCS_CLIENT_ROLE_PREFIX + "source-admin"; @@ -199,10 +194,6 @@ public class MirrorSourceConfig extends MirrorConnectorConfig { return Duration.ofMillis(getLong(CONSUMER_POLL_TIMEOUT_MILLIS)); } - boolean addSourceAliasToMetrics() { - return getBoolean(ADD_SOURCE_ALIAS_TO_METRICS); - } - boolean emitOffsetSyncsEnabled() { return getBoolean(EMIT_OFFSET_SYNCS_ENABLED); } @@ -318,12 +309,6 @@ public class MirrorSourceConfig extends MirrorConnectorConfig { in(SOURCE_CLUSTER_ALIAS_DEFAULT, TARGET_CLUSTER_ALIAS_DEFAULT), ConfigDef.Importance.LOW, OFFSET_SYNCS_TOPIC_LOCATION_DOC) - .define( - ADD_SOURCE_ALIAS_TO_METRICS, - ConfigDef.Type.BOOLEAN, - ADD_SOURCE_ALIAS_TO_METRICS_DEFAULT, - ConfigDef.Importance.LOW, - ADD_SOURCE_ALIAS_TO_METRICS_DOC) .define( EMIT_OFFSET_SYNCS_ENABLED, ConfigDef.Type.BOOLEAN, diff --git a/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceMetrics.java b/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceMetrics.java index 68303b57dc7..7e33967c9f1 100644 --- a/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceMetrics.java +++ b/connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorSourceMetrics.java @@ -56,17 +56,13 @@ class MirrorSourceMetrics implements AutoCloseable { private final Map partitionMetrics; private final String source; private final String target; - private final boolean addSourceAlias; MirrorSourceMetrics(MirrorSourceTaskConfig taskConfig) { this.target = taskConfig.targetClusterAlias(); this.source = taskConfig.sourceClusterAlias(); - this.addSourceAlias = taskConfig.addSourceAliasToMetrics(); this.metrics = new Metrics(); - Set partitionTags = new HashSet<>(addSourceAlias - ? Arrays.asList("source", "target", "topic", "partition") - : Arrays.asList("target", "topic", "partition")); + Set partitionTags = new HashSet<>(Arrays.asList("source", "target", "topic", "partition")); recordCount = new MetricNameTemplate( "record-count", SOURCE_CONNECTOR_GROUP, @@ -153,7 +149,7 @@ class MirrorSourceMetrics implements AutoCloseable { String prefix = topicPartition.topic() + "-" + topicPartition.partition() + "-"; Map tags = new LinkedHashMap<>(); - if (addSourceAlias) tags.put("source", source); + tags.put("source", source); tags.put("target", target); tags.put("topic", topicPartition.topic()); tags.put("partition", Integer.toString(topicPartition.partition())); diff --git a/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorSourceMetricsTest.java b/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorSourceMetricsTest.java index fb31e49f28d..57eae629baa 100644 --- a/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorSourceMetricsTest.java +++ b/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorSourceMetricsTest.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; public class MirrorSourceMetricsTest { @@ -59,22 +58,6 @@ public class MirrorSourceMetricsTest { MirrorSourceMetrics metrics = new MirrorSourceMetrics(taskConfig); metrics.addReporter(reporter); - metrics.countRecord(SOURCE_TP); - assertEquals(13, reporter.metrics.size()); - Map tags = reporter.metrics.get(0).metricName().tags(); - assertEquals(TARGET, tags.get("target")); - assertEquals(SOURCE_TP.topic(), tags.get("topic")); - assertEquals(String.valueOf(SOURCE_TP.partition()), tags.get("partition")); - assertNull(tags.get("source")); - } - - @Test - public void testTagsWithSourceAlias() { - configs.put(MirrorSourceConfig.ADD_SOURCE_ALIAS_TO_METRICS, "true"); - MirrorSourceTaskConfig taskConfig = new MirrorSourceTaskConfig(configs); - MirrorSourceMetrics metrics = new MirrorSourceMetrics(taskConfig); - metrics.addReporter(reporter); - metrics.countRecord(SOURCE_TP); assertEquals(13, reporter.metrics.size()); Map tags = reporter.metrics.get(0).metricName().tags(); diff --git a/docs/upgrade.html b/docs/upgrade.html index f005e419a69..b9d599cb516 100644 --- a/docs/upgrade.html +++ b/docs/upgrade.html @@ -22,51 +22,67 @@

Upgrading to 4.0.0 from any version 0.8.x through 3.9.x

Notable changes in 4.0.0
    -
  • A number of deprecated classes, methods,configurations and tools have been removed from the clients, connect, core and tools modules:
  • -
      -
    • The original MirrorMaker (MM1) and related classes have been removed. Please use the Connect-based - MirrorMaker (MM2), as described in the - Geo-Replication section. -
    • -
    • - The kafka.common.MessageReader class has been removed. Please use the - org.apache.kafka.tools.api.RecordReader - interface to build custom readers for the kafka-console-producer tool. -
    • -
    • Remove use.incremental.alter.configs. The modified behavior is identical to the previous required configuration, - therefore users should ensure that target broker is at least 2.3.0 -
    • -
    • Remove delegation.token.master.key. please use delegation.token.secret.key instead of it. -
    • -
    • - The kafka.tools.DefaultMessageFormatter class has been removed. Please use the org.apache.kafka.tools.consumer.DefaultMessageFormatter class instead. -
    • -
    • - The kafka.tools.LoggingMessageFormatter class has been removed. Please use the org.apache.kafka.tools.consumer.LoggingMessageFormatter class instead. -
    • -
    • - The kafka.tools.NoOpMessageFormatter class has been removed. Please use the org.apache.kafka.tools.consumer.NoOpMessageFormatter class instead. -
    • -
    • - The --whitelist option was removed from the kafka-console-consumer command line tool. - Please use --include instead. -
    • -
    • - The --whitelist and --blacklist options were removed from the org.apache.kafka.connect.transforms.ReplaceField. - Please use --include and --exclude instead. -
    • -
    • - The --delete-config option in the kafka-topics command line tool has been deprecated. -
    • -
    • - The metrics.jmx.blacklist was removed from the org.apache.kafka.common.metrics.JmxReporter - Please use metrics.jmx.exclude instead. -
    • -
    • - The metrics.jmx.whitelist was removed from the org.apache.kafka.common.metrics.JmxReporter - Please use metrics.jmx.include instead. -
    • -
    +
  • A number of deprecated classes, methods, configurations and tools have been removed. +
      +
    • Common +
        +
      • The metrics.jmx.blacklist and metrics.jmx.whitelist configurations were removed from the org.apache.kafka.common.metrics.JmxReporter + Please use metrics.jmx.exclude and metrics.jmx.include respectively instead. +
      • +
      +
    • +
    • Broker +
        +
      • The delegation.token.master.key configuration was removed. + Please use delegation.token.secret.key instead. +
      • +
      +
    • +
    • MirrorMaker +
        +
      • 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 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. + The source cluster alias is now always added to the metrics. +
      • +
      +
    • +
    • Tools +
        +
      • The kafka.common.MessageReader class was removed. Please use the + org.apache.kafka.tools.api.RecordReader + interface to build custom readers for the kafka-console-producer tool. +
      • +
      • The kafka.tools.DefaultMessageFormatter class was removed. Please use the org.apache.kafka.tools.consumer.DefaultMessageFormatter class instead. +
      • +
      • The kafka.tools.LoggingMessageFormatter class was removed. Please use the org.apache.kafka.tools.consumer.LoggingMessageFormatter class instead. +
      • +
      • The kafka.tools.NoOpMessageFormatter class has been removed. Please use the org.apache.kafka.tools.consumer.NoOpMessageFormatter class instead. +
      • +
      • The --whitelist option was removed from the kafka-console-consumer command line tool. + Please use --include instead. +
      • +
      +
    • +
    • Connect +
        +
      • The whitelist and blacklist configurations were removed from the org.apache.kafka.connect.transforms.ReplaceField transformation. + Please use include and exclude respectively instead. +
      • +
      +
    • +
    +
  • +
  • Other changes: +
      +
    • The --delete-config option in the kafka-topics command line tool has been deprecated. +
    • +
    +

Upgrading to 3.9.0 from any version 0.8.x through 3.8.x