Versions Compared

Key

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

...

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here 

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

...

"TOPIC-PARTITION_ID.record-lead"
"TOPIC-PARTITION_ID.record-lead-avg"
"TOPIC-PARTITION_ID.record-lead-min"

 

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Rejected Alternatives

The way to get the metrics is the same as getting other metrics. For example:

Code Block
languagejava
TopicPartition tp = new TopicPartition("topic", 0);
HashMap<String, String> tags = new HashMap<>();
tags.put("client-id", "metricTestConsumer0");

double currentLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead", "consumer-fetch-manager-metrics", "", tags)).value()
double averageLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead-avg", "consumer-fetch-manager-metrics", "", tags)).value()
double minLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead-min", "consumer-fetch-manager-metrics", "", tags)).value()

When the consumer does not own a partition anymore, the lead metric will be removed.

Compatibility, Deprecation, and Migration Plan

The change is fully backwards compatible.

Rejected Alternatives

NoneIf there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.