Versions Compared

Key

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

...

This reporter is useful when developing and in some environments but in other environments where it's not used, it would be nice to be able to just disable it and only have explicitly configured metrics reporters running.

Public Interfaces

This KIP proposes introducing a plan to remove the current special behavior of the JMX Reporter and treat it like all other reporters. In order to do so, we will introduce a new configuration to all components (broker, producer, consumer, admin, connect and streams) to disable JMXReporter. This new configuration is expected to serve as a temporary measure until the next major release when JMXReporter will only be enabled if it's included in metric.reporters.

Proposed Changes

A new configuration setting:

Name: auto.include.jmx.reporter.enable

Description: Enables the JMX Reporter which registers metrics in JMX as dynamic mbeansDeprecated. Whether to automatically include JMX Reporter even if it's not listed in metric.reporters. This configuration will be removed in Kafka 4.0, users should instead include org.apache.kafka.common.metrics.JMXReporter in metric.reporters in order to enable the JMX Reporter.

Type: Boolean

Default: true

...

When set to false, components will not instantiate a JMXReporter and only reporters set via metric.reporters will be used.
When set to true, a warning will be printed to indicate this setting is deprecated and recommend using metric.reporters instead.

Compatibility, Deprecation, and Migration Plan

By default the new setting will be set to true so it does not change the current behavior. Users can disable the JMXReporter if they are not using it.. This setting will be marked as deprecated immediately.

In the next major version:

  • auto.include.jmx.reporter will be removed
  • metric.reporters will have its default value set to org.apache.kafka.common.metrics.JMXReporter
  • only reporters listed in metric.reporters will be enabled

Rejected Alternatives

  • Change Immediately change the default value of metric.reporters to include JMXReporter. This would avoid creating a new configuration but this would cause a change of behavior for users that already set metric.reporters.
  • Add a new configuration to disable the JMX Reporter. The drawback of this approach was the permanent addition of a new configuration. The current proposal only adds a new configuration that will be removed in next major release.