chia7712 commented on code in PR #17011: URL: https://github.com/apache/kafka/pull/17011#discussion_r1960309578
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java: ########## @@ -150,6 +159,37 @@ public GroupCoordinatorMetrics(MetricsRegistry registry, Metrics metrics) { Collections.singletonMap(CONSUMER_GROUP_COUNT_STATE_TAG, ConsumerGroupState.DEAD.toString()) ); + shareGroupCountMetricName = metrics.metricName( + SHARE_GROUP_COUNT_METRIC_NAME, + METRICS_GROUP, + "The total number of share groups.", + Collections.singletonMap(SHARE_GROUP_PROTOCOL_TAG, Group.GroupType.SHARE.toString()) + ); + + shareGroupCountEmptyMetricName = metrics.metricName( + SHARE_GROUP_COUNT_METRIC_NAME, + METRICS_GROUP, + "The number of share groups in empty state.", + SHARE_GROUP_PROTOCOL_TAG, Group.GroupType.SHARE.toString(), Review Comment: I apologize for any noise on this merged PR, but I have a question regarding the new metrics. While testing the metrics for the new group types, I observed that `share groups` exhibit different behavior compared to `consumer/streams groups`. For example, the metric for "The number of xxx groups in empty state" behaves differently for shared groups. *consumer group* -> consumer-group-count `kafka.server:type=group-coordinator-metrics,state=Empty` *streams group* -> streams-group-count `kafka.server:type=group-coordinator-metrics,state=Empty` *share group* -> group-count `kafka.server:type=group-coordinator-metrics,protocol=share,state=Empty` All of these metrics seem to align with the KIP. However, I'm curious about the design decisions behind them. I mean why we don't unify the metrics for all group types? Please correct me if I'm misunderstanding anything. -- 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