bbejeck commented on code in PR #17021: URL: https://github.com/apache/kafka/pull/17021#discussion_r1815597028
########## clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java: ########## @@ -469,6 +471,30 @@ public void testExplicitlyEnableJmxReporter() { admin.close(); } + @Test + public void testExplicitlyEnableTelemetryReporter() { + Properties props = new Properties(); + props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999"); + props.setProperty(AdminClientConfig.METRIC_REPORTER_CLASSES_CONFIG, "org.apache.kafka.common.metrics.JmxReporter"); Review Comment: Don't need to, shamefully probably a c/p error updated ########## clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java: ########## @@ -469,6 +471,30 @@ public void testExplicitlyEnableJmxReporter() { admin.close(); } + @Test + public void testExplicitlyEnableTelemetryReporter() { + Properties props = new Properties(); + props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999"); + props.setProperty(AdminClientConfig.METRIC_REPORTER_CLASSES_CONFIG, "org.apache.kafka.common.metrics.JmxReporter"); + props.setProperty(AdminClientConfig.ENABLE_METRICS_PUSH_CONFIG, "true"); + KafkaAdminClient admin = (KafkaAdminClient) AdminClient.create(props); + assertEquals(2, admin.metrics.reporters().size()); + //ClientTelemetryReporter always added after metrics reporters created with JmxReporter + assertInstanceOf(ClientTelemetryReporter.class, admin.metrics.reporters().get(1)); + admin.close(); + } + + @Test + public void testExplicitlyTelemetryReporterIsDisabled() { + Properties props = new Properties(); + props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999"); + props.setProperty(AdminClientConfig.METRIC_REPORTER_CLASSES_CONFIG, "org.apache.kafka.common.metrics.JmxReporter"); Review Comment: fixed -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org