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

Expose select gauges and metrics programmatically (not just through JMX)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • 0.9.0.0
    • 0.9.0.0
    • core

    Description

      There are several gauges in core that are registered but cannot be accessed programmatically. For example, gauges "LeaderCount", "PartitionCount", "UnderReplicatedParittions" are all registered in ReplicaManager.scala but there is no way to access them programmatically if one has access to the kafka.server object. Other metrics, such as isrExpandRate (also in ReplicaManager.scala) can be accessed. The solution here is trivial, add a var <variable name> in front of newGauge, as shown below
      var partitionCount newGauge(
      "PartitionCount",
      new Gauge[Int]

      { def value = allPartitions.size }

      )

      Attachments

        Activity

          People

            enothereska Eno Thereska
            enothereska Eno Thereska
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: