artemlivshits commented on code in PR #13798: URL: https://github.com/apache/kafka/pull/13798#discussion_r1245541275
########## core/src/main/scala/kafka/network/RequestChannel.scala: ########## @@ -240,17 +240,18 @@ object RequestChannel extends Logging { val responseSendTimeMs = nanosToMs(endTimeNanos - responseDequeueTimeNanos) val messageConversionsTimeMs = nanosToMs(messageConversionsTimeNanos) val totalTimeMs = nanosToMs(endTimeNanos - startTimeNanos) - val fetchMetricNames = + val overrideMetricNames = 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].allVerifyOnlyRequest) { + Seq(RequestMetrics.verifyPartitionsInTxnMetricName) Review Comment: It looks like we previously had a metric for ADD_PARTITIONS_TO_TXN and now we don't. The FETCH metric has a metric that is combined consumer and follower, but we also have the common metric. ########## 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: Looks like we're removing the ADD_PARTITIONS_TO_TXN metric, which would be a break if someone used it. -- 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