Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8194

MessagesInPerSec incorrect value when when transactional messaging are enabled

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0, 2.2.0
    • Fix Version/s: None
    • Component/s: metrics
    • Labels:
      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

        Attachments

        1. Screen Shot 2019-04-05 at 17.52.22.png
          278 kB
          Odyldzhon Toshbekov
        2. Screen Shot 2019-04-05 at 17.51.03.png
          371 kB
          Odyldzhon Toshbekov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              odyldzhon@gmail.com Odyldzhon Toshbekov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: