apoorvmittal10 commented on code in PR #14621: URL: https://github.com/apache/kafka/pull/14621#discussion_r1372045362
########## core/src/main/scala/kafka/metrics/ClientMetricsConfig.scala: ########## @@ -0,0 +1,141 @@ +/* + * 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 kafka.metrics + +import org.apache.kafka.common.config.ConfigDef +import org.apache.kafka.common.config.ConfigDef.Importance.MEDIUM +import org.apache.kafka.common.config.ConfigDef.Type.{INT, LIST} +import org.apache.kafka.common.errors.InvalidRequestException + +import java.util +import java.util.Properties + +/** + * Client metric configuration related parameters and the supporting methods like validation and update methods + * are defined in this class. + * <p> + * SubscriptionInfo: Contains the client metric subscription information. Supported operations from the CLI are + * add/delete/update operations. Every subscription object contains the following parameters that are populated + * during the creation of the subscription. + * <p> + * { + * <ul> + * <li> subscriptionId: Name/ID supplied by CLI during the creation of the client metric subscription. + * <li> subscribedMetrics: List of metric prefixes + * <li> pushIntervalMs: A positive integer value >=0 tells the client that how often a client can push the metrics + * <li> matchingPatternsList: List of client matching patterns, that are used by broker to match the client instance + * with the subscription. + * </ul> + * } + * <p> + * At present, CLI can pass the following parameters in request to add/delete/update the client metrics + * subscription: + * <ul> + * <li> "metrics" value should be comma separated metrics list. An empty list means no metrics subscribed. + * A list containing just an empty string means all metrics subscribed. + * Ex: "org.apache.kafka.producer.partition.queue.,org.apache.kafka.producer.partition.latency" + * <li> "interval.ms" should be between 100 and 3600000 (1 hour). This is the interval at which the client + * should push the metrics to the broker. + * <li> "match" is a comma separated list of client match patterns, in case if there is no matching + * pattern specified then broker considers that as all match which means the associated metrics + * applies to all the clients. Ex: "client_software_name = Java, client_software_version = 11.1.*" Review Comment: I have added the example for match and added prefix match details for metrics. Done. -- 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