Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This KIP proposes to make the set of metrics visible in JMX dynamically configurable via a set of whitelist/blacklist regular expressions on the mbean names.

...

Two new configurations will be introduce to allow filtering the set of metrics exposed via JMX on brokers and clients.

The configurations would apply to brokers, as well as clients, streams, and connect.

On the broker, the configurations will also be marked as dynamic to allow updates at runtime.


On the broker, the configs will be defined as follows:

kafka.metrics.jmx.whitelist=<regular expression of mbeans to expose> (defaults to ".*")

kafka.metrics.jmx.blacklist=<regular expression of mbeans to hide> (defaults to "", takes precedence over the whitelist)


Similarly, for clients, streams, and connect, configuration will follow existing client metric config prefixes defined in CommonClientConfigs

metrics.jmx.whitelist=<regular expression of mbeans to expose> (defaults to ".*")

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 (only applies to brokers) as well as JMX metrics exposed via Kafka's own metrics library.

By default, this would not change the set of metrics exposed via JMX: all metrics would be exposed.


Updates On the broker, updates to the configurations at runtime would both add and remove JMX metrics as needed to reflect the new filters.

...