Current state: Accepted

Discussion thread: here

Voting thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).


Currently all Kafka components that support Metrics Reporters always inject JmxReporter. While it's possible to include/exclude metrics the JmxReporter exposes (via metrics.jmx.include/exclude settings) this reporter can't be disabled and as it is not controlled via the metric.reporters configuration like other reporters.

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 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

1) A new configuration setting:

Name: auto.include.jmx.reporter

Description: Deprecated. 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

Update Mode: Read only

When set to false, components will not instantiate a JmxReporter and only reporters set via metric.reporters will be used.
When explicitly set to true or when using the default and not including JmxReporter in metric.reporters, a warning will be printed to indicate this setting is deprecated and recommend using metric.reporters instead.

2) From Kafka 4.0, metric.reporters will have its default value set to org.apache.kafka.common.metrics.JmxReporter

Compatibility, Deprecation, and Migration Plan

By default the new setting will be set to true so it does not change the current behavior. 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

Users currently relying on JmxReporter and that are using additional reporters via metric.reporters will have to include org.apache.kafka.common.metrics.JmxReporter in metric.reporters.

Rejected Alternatives

  • 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.
  • No labels