Table of Contents |
---|
Status
Current state: Under DiscussionAccepted
Discussion thread: here
JIRA:here KAFKA-6184
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
"records-lead-min"
Also, add per-partition lead metrics metric to KafkaConsumer. The metric names name would be:
"TOPIC-PARTITION_ID.record-records-lead"
"TOPIC-PARTITION_ID.record-records-lead-avgmin"
"TOPIC-PARTITION_ID.recordrecords-lead-minavg"
The way to get the metrics is the same as getting other per-partition metrics. For example:
Code Block | ||
---|---|---|
| ||
TopicPartition tp = new TopicPartition("topic", 0); HashMap<String, String> tags = new HashMap<>(); tags.put("client-id", "metricTestConsumer0"); tags.put("topic", tp.topic()); tags.put("partition", String.valueOf(tp.partition()); double currentLeadcurrentPartitionLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead", "consumer-fetch-manager-metrics", "", tags)).value(); double averageLeadcurrentPartitionMinLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead-avgmin", "consumer-fetch-manager-metrics", "", tags)).value(); double minLeadcurrentPartitionAvgLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead-minavg", "consumer-fetch-manager-metrics", "", tags)).value(); |
When the consumer does not own a partition anymore, the lead metric all lead metrics including client-level and partition-level ones will be removed.
Compatibility, Deprecation, and Migration Plan
...