AndrewJSchofield commented on code in PR #20672: URL: https://github.com/apache/kafka/pull/20672#discussion_r2445477865
########## clients/src/main/java/org/apache/kafka/server/telemetry/ClientTelemetryExporterProvider.java: ########## @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.kafka.server.telemetry; + +import org.apache.kafka.common.metrics.MetricsReporter; + +/** + * A {@link MetricsReporter} may implement this interface to indicate support for collecting client + * telemetry on the server side using the new exporter API. This interface replaces the deprecated + * {@link ClientTelemetry} interface. + */ +public interface ClientTelemetryExporterProvider { + + /** + * Called by the broker to fetch instance of {@link ClientTelemetryExporter}. + * <p> + * This instance may be cached by the broker. + * + * @return broker side instance of {@link ClientTelemetryExporter} + */ + ClientTelemetryExporter clientExporter(); Review Comment: In the KIP, this method is called `clientTelemetryExporter`. ########## server/src/main/java/org/apache/kafka/server/metrics/ClientTelemetryPlugin.java: ########## @@ -18,40 +18,60 @@ import org.apache.kafka.common.requests.PushTelemetryRequest; import org.apache.kafka.common.requests.RequestContext; +import org.apache.kafka.server.telemetry.ClientTelemetryExporter; import org.apache.kafka.server.telemetry.ClientTelemetryReceiver; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** - * Plugin to register client telemetry receivers and export metrics. This class is used by the Kafka - * server to export client metrics to the registered receivers. + * Plugin to register client telemetry receivers/exporters and export metrics. This class is used by the Kafka + * server to export client metrics to the registered receivers and exporters, supporting both the deprecated + * {@link ClientTelemetryReceiver} and the new {@link ClientTelemetryExporter} interfaces. */ -public class ClientMetricsReceiverPlugin { +@SuppressWarnings({"deprecation", "overloads"}) +public class ClientTelemetryPlugin { Review Comment: How about `ClientTelemetryExporterPlugin`? I think that's what it is. ########## core/src/main/scala/kafka/server/BrokerServer.scala: ########## @@ -188,9 +188,9 @@ class BrokerServer( info("Starting broker") - val clientMetricsReceiverPlugin = new ClientMetricsReceiverPlugin() + val clientMetricsTelemetryPlugin = new ClientTelemetryPlugin() Review Comment: nit: Name mismatch between variable and the class. I'd just use the same name, like the code did previously. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
