This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current stateDiscarded as this is a bug fix so a KIP is not needed

Discussion thread: here

JIRA: KAFKA-6123

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

Motivation

The client’s MetricsReporter currently receives the client.id configuration via the configure method only if the user has specified the client.id configuration.

The client.id configuration is not a required configuration as KafkaConsumer and KafkaProducer will automatically generate client ids if not user configured (producer-1…, consumer-1…). These auto generated client ids are not passed to the MetricsReporter, which makes it difficult to track and map clients that have not specified the client id configuration.

KAFKA-4756 gave the broker’s KafkaMetricsReporter the auto generated broker id, but this change was not applied to the client’s MetricsReporter.

Public Interfaces

The client id when configured by the user already appears in the MetricsReporter configure method, so this is not adding anything completely new.

Proposed Changes

In KafkaConsumer and KafkaProducer constructors, we will pass the auto generated client id in a singleton map into the configOverrides parameter of AbstractConfig’s getConfiguredInstances method (same way KAFKA-4756 handles it).

Compatibility, Deprecation, and Migration Plan

The client id is already given to the MetricsReporter if the user has specified it so there will not be any migration or compatibility issues.

Rejected Alternatives

None.

  • No labels