You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Eno Thereska (JIRA)" <ji...@apache.org> on 2015/10/26 21:15:28 UTC
[jira] [Resolved] (KAFKA-2689) Expose select gauges and metrics
programmatically (not just through JMX)
[ https://issues.apache.org/jira/browse/KAFKA-2689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eno Thereska resolved KAFKA-2689.
---------------------------------
Resolution: Done
Will resolve incrementally through MINOR PR requests.
> Expose select gauges and metrics programmatically (not just through JMX)
> ------------------------------------------------------------------------
>
> Key: KAFKA-2689
> URL: https://issues.apache.org/jira/browse/KAFKA-2689
> Project: Kafka
> Issue Type: Improvement
> Components: core
> Affects Versions: 0.9.0.0
> Reporter: Eno Thereska
> Assignee: Eno Thereska
> Labels: newbie
> Fix For: 0.9.0.0
>
>
> 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
> }
> )
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)