junrao commented on code in PR #18444: URL: https://github.com/apache/kafka/pull/18444#discussion_r1919302895
########## core/src/main/java/kafka/server/share/SharePartitionManager.java: ########## @@ -598,6 +632,12 @@ void processShareFetch(ShareFetch shareFetch) { sharePartitions.put(topicIdPartition, sharePartition); } + // Update the metrics for the topics for which we have received a share fetch request. + topics.forEach(topic -> { + brokerTopicStats.allTopicsStats().totalShareFetchRequestRate().mark(); Review Comment: We already have a generic metric that tracks the rate for each type of request. So, we probably don't need this one. ########## core/src/main/java/kafka/server/share/SharePartitionManager.java: ########## @@ -302,7 +320,13 @@ public CompletableFuture<Map<TopicIdPartition, ShareAcknowledgeResponseData.Part } }); - return mapAcknowledgementFutures(futures); + // Update the metrics for the topics for which we have received an acknowledgement. + topics.forEach(topic -> { + brokerTopicStats.allTopicsStats().totalShareAcknowledgementRequestRate().mark(); Review Comment: Does this track just the ShareAcknowledgementRequest or the acks in ShareFetchRequest too? If yes, we probably want to name the metric more accurately. If not, this method is called by both ShareFetchRequest and ShareAcknowledgeRequest and we need to separate them out. -- 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