...
kafka.metrics.jmx.blacklist=<regular expression of mbeans to hide> (defaults to "", takes precedence over the whitelist)
These configurations will apply to both JMX metrics exposed via Yammer metrics as well as JMX metrics exposed via Kafka's own metrics library.
...
All metrics continue to be collected in the background regardless of those settings, so this only affects the visibility in JMX and not the actual metric values.
Example
To hide log-level metrics LogEndOffset
, LogStartOffset
, and NumLogSegments
, as well as any partition level metrics, except UnderMinIsr
, one could exclude those by specifying the following property in their server.properties
file:
kafka.metrics.jmx.blacklist=(kafka.log:type=Log,name=(LogEndOffset|LogStartOffset|NumLogSegments),.*\
|kafka.cluster:type=Partition,name=(?!UnderMinIsr),.*)
Proposed Changes
A new KafkaYammerMetrics class will be added to hold a Kafka-specific Yammer metrics registry, replacing the default global yammer metrics registry, which allows us to override the JMX behavior of Yammer metrics.
...