[ 
https://issues.apache.org/jira/browse/KAFKA-20585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081317#comment-18081317
 ] 

Muralidhar Basani edited comment on KAFKA-20585 at 5/15/26 8:54 PM:
--------------------------------------------------------------------

And regarding reporting metrics for fetch-latency, adding right after 
[https://github.com/apache/kafka/blob/99611aa06f13f8ef36619e3f02d30aca3dcc2894/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java#L818]
 seems better.

Same can be applied to move this 
[https://github.com/apache/kafka/blob/99611aa06f13f8ef36619e3f02d30aca3dcc2894/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java#L253]
 to after handler obj is created.


was (Author: muralibasani):
And regarding reporting metrics for fetch-latency, adding right after 
[https://github.com/apache/kafka/blob/99611aa06f13f8ef36619e3f02d30aca3dcc2894/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java#L818]
 seems better.

> Share Fetch latency metric incorrectly updated during ShareAcknowledgeResponse
> ------------------------------------------------------------------------------
>
>                 Key: KAFKA-20585
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20585
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Shivsundar R
>            Assignee: Muralidhar Basani
>            Priority: Major
>
> The ShareFetchMetricsManager records latency metrics (share-fetch-latency, 
> share-fetch-request-rate and share-fetch-request-total) at the response 
> handlers in ShareConsumeRequestManager after the response is processed.
> There are a couple of issues here - 
> 1. This one is a straightforward bug - we are currently recording these 
> metrics both in the ShareFetch and ShareAcknowledge response handlers. We 
> should ideally only record this for the ShareFetch responses.
> 2. The metrics are being recorded at the end of the response handler, so we 
> would be missing to update the share-fetch-rate and share-fetch-total metrics 
> for responses with top level errors. This is the same pattern in FetchManager 
> as well where we are missing these responses with top level errors. Not sure 
> if this was intended or we should account for these as well. [~lianetm] could 
> you help take a look at the regular consumer/share-consumer and see what we 
> should do here?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to