jolshan commented on code in PR #13798: URL: https://github.com/apache/kafka/pull/13798#discussion_r1228732870
########## core/src/main/scala/kafka/network/RequestChannel.scala: ########## @@ -240,16 +240,17 @@ object RequestChannel extends Logging { val responseSendTimeMs = nanosToMs(endTimeNanos - responseDequeueTimeNanos) val messageConversionsTimeMs = nanosToMs(messageConversionsTimeNanos) val totalTimeMs = nanosToMs(endTimeNanos - startTimeNanos) - val fetchMetricNames = + val metricNames = if (header.apiKey == ApiKeys.FETCH) { - val isFromFollower = body[FetchRequest].isFromFollower - Seq( - if (isFromFollower) RequestMetrics.followFetchMetricName + val specifiedMetricName = + if (body[FetchRequest].isFromFollower) RequestMetrics.followFetchMetricName else RequestMetrics.consumerFetchMetricName - ) + Seq(specifiedMetricName, header.apiKey.name) + } else if (header.apiKey == ApiKeys.ADD_PARTITIONS_TO_TXN && body[AddPartitionsToTxnRequest].verifyOnlyRequest()) { + Seq(RequestMetrics.verifyPartitionsInTxnMetricName) + } else { + Seq(header.apiKey.name) } - else Seq.empty - val metricNames = fetchMetricNames :+ header.apiKey.name Review Comment: Note: Like fetch metrics, both verification and nonverification addPartitionToTxn requests will count towards the rate for the request type. This is because the metric is keyed on the apiKey, and I can't distinguish the two. See below: ``` m.requestRate(header.apiVersion).mark() ``` -- 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