Details
-
Bug
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
1.1.0, 2.2.0
-
None
-
None
Description
Looks like metric
kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec
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
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"
https://github.com/apache/kafka/blob/2.2.0/core/src/main/scala/kafka/log/Log.scala