dajac commented on code in PR #14848: URL: https://github.com/apache/kafka/pull/14848#discussion_r1425827813
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java: ########## @@ -75,31 +74,23 @@ public class GroupCoordinatorMetrics extends CoordinatorMetrics implements AutoC public static final String GENERIC_GROUP_REBALANCES_SENSOR_NAME = "GenericGroupRebalances"; public static final String CONSUMER_GROUP_REBALANCES_SENSOR_NAME = "ConsumerGroupRebalances"; + private final MetricName genericGroupsCountMetricName; Review Comment: nit: Should it be called groupsCountMetricName? ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java: ########## @@ -108,6 +99,55 @@ public GroupCoordinatorMetrics(MetricsRegistry registry, Metrics metrics) { this.registry = Objects.requireNonNull(registry); this.metrics = Objects.requireNonNull(metrics); + genericGroupsCountMetricName = metrics.metricName( + GROUPS_COUNT_METRIC_NAME, + METRICS_GROUP, + "The total number of generic groups.", Review Comment: nit: The total number of groups using the generic rebalance protocol. ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java: ########## @@ -281,100 +297,93 @@ public void onUpdateLastCommittedOffset(TopicPartition tp, long offset) { } } - public static MetricName getMetricName(String type, String name) { + public static com.yammer.metrics.core.MetricName getMetricName(String type, String name) { return getMetricName("kafka.coordinator.group", type, name); } private void registerGauges() { - registry.newGauge(NUM_OFFSETS, new Gauge<Long>() { + registry.newGauge(NUM_OFFSETS, new com.yammer.metrics.core.Gauge<Long>() { @Override public Long value() { return numOffsets(); } Review Comment: nit: Could we also use a lambda for those in order to make the code consistent with the other metrics? ########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java: ########## @@ -108,6 +99,55 @@ public GroupCoordinatorMetrics(MetricsRegistry registry, Metrics metrics) { this.registry = Objects.requireNonNull(registry); this.metrics = Objects.requireNonNull(metrics); + genericGroupsCountMetricName = metrics.metricName( + GROUPS_COUNT_METRIC_NAME, + METRICS_GROUP, + "The total number of generic groups.", + Collections.singletonMap(GROUPS_COUNT_TYPE_TAG, Group.GroupType.GENERIC.toString()) + ); + + consumerGroupsCountMetricName = metrics.metricName( + GROUPS_COUNT_METRIC_NAME, + METRICS_GROUP, + "The total number of consumer groups.", Review Comment: nit: The total number of groups using the consumer rebalance protocol. -- 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