apoorvmittal10 commented on code in PR #14699:
URL: https://github.com/apache/kafka/pull/14699#discussion_r1382107961


##########
core/src/main/java/kafka/metrics/ClientMetricsConfigs.java:
##########
@@ -0,0 +1,194 @@
+/*
+ * 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.AbstractConfig;
+import org.apache.kafka.common.config.ConfigDef;
+import org.apache.kafka.common.config.ConfigDef.Importance;
+import org.apache.kafka.common.config.ConfigDef.Type;
+import org.apache.kafka.common.errors.InvalidConfigurationException;
+import org.apache.kafka.common.errors.InvalidRequestException;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+/**
+ * Client metric configuration related parameters and the supporting methods 
like validation, etc. are
+ * defined in this class.
+ * <p>
+ * {
+ * <ul>
+ *   <li> name: Name supplied by CLI during the creation of the client metric 
subscription.
+ *   <li> metrics: List of metric prefixes
+ *   <li> intervalMs: A positive integer value >=0  tells the client that how 
often a client can push the metrics
+ *   <li> match: 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> "name" is a unique name for the subscription. This is used to 
identify the subscription in
+ *          the broker. Ex: "METRICS-SUB"
+ *    <li> "metrics" value should be comma separated metrics list. A prefix 
match on the requested metrics
+ *          is performed in clients to determine subscribed metrics. 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.*"
+ *          which means all Java clients with any sub versions of 11.1 will be 
matched i.e. 11.1.1, 11.1.2 etc.
+ * </ul>
+ * For more information please look at kip-714:
+ * 
https://cwiki.apache.org/confluence/display/KAFKA/KIP-714%3A+Client+metrics+and+observability#KIP714:Clientmetricsandobservability-Clientmetricsconfiguration
+ */
+public class ClientMetricsConfigs extends AbstractConfig {

Review Comment:
   This class is major overlap from PR where it was introduced: 
https://github.com/apache/kafka/pull/14621



-- 
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

Reply via email to