[ 
https://issues.apache.org/jira/browse/KAFKA-8194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Odyldzhon Toshbekov updated KAFKA-8194:
---------------------------------------
    Description: 
Looks like metric
{code:java}
kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec{code}
has incorrect value when messages come via Kafka Stream API.

I noticed that offset for every message from Kafka Stream can be increased by 
1,2,... However if messages come to Broker from Kafka producer it's always 
incremented by 1.

Unfortunately the metric mentioned above calculated based on offset changes and 
as result we cannot use streams because metric will be always incorrect.

For Kafka 2.2.0

!Screen Shot 2019-04-05 at 17.51.03.png|width=100%!
 
[https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/server/ReplicaManager.scala]

And this is the method used to get "numAppendedMessages"
 !Screen Shot 2019-04-05 at 17.52.22.png|width=100%!
https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/log/Log.scala

  was:
Looks like metric
{code:java}kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec{code}
has incorrect value when messages come via Kafka Stream API.

I noticed that offset for every message from Kafka Stream can be increased by 
1,2,... However if messages come to Broker from Kafka producer it's always 
incremented by 1.

Unfortunately the metric mentioned above calculated based on offset changes and 
as result we cannot use streams because metric will be always incorrect.

For Kafka 2.2.0

!Screen Shot 2019-04-05 at 17.51.03.png | width=10%!
https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/server/ReplicaManager.scala

And this is the method used to get "numAppendedMessages"
 !Screen Shot 2019-04-05 at 17.52.22.png! 




> MessagesInPerSec incorrect value when Stream produce messages
> -------------------------------------------------------------
>
>                 Key: KAFKA-8194
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8194
>             Project: Kafka
>          Issue Type: Bug
>          Components: metrics
>    Affects Versions: 1.1.0, 2.2.0
>            Reporter: Odyldzhon Toshbekov
>            Priority: Trivial
>         Attachments: Screen Shot 2019-04-05 at 17.51.03.png, Screen Shot 
> 2019-04-05 at 17.52.22.png
>
>
> Looks like metric
> {code:java}
> kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec{code}
> has incorrect value when messages come via Kafka Stream API.
> I noticed that offset for every message from Kafka Stream can be increased by 
> 1,2,... However if messages come to Broker from Kafka producer it's always 
> incremented by 1.
> Unfortunately the metric mentioned above calculated based on offset changes 
> and as result we cannot use streams because metric will be always incorrect.
> For Kafka 2.2.0
> !Screen Shot 2019-04-05 at 17.51.03.png|width=100%!
>  
> [https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/server/ReplicaManager.scala]
> And this is the method used to get "numAppendedMessages"
>  !Screen Shot 2019-04-05 at 17.52.22.png|width=100%!
> https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/log/Log.scala



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to