THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Table of Contents |
---|
Status
Current state: Under DiscussionAccepted
Discussion thread: here
JIRA: KAFKA-6184
...
Also, add per-partition lead metric to KafkaConsumer. The metric name would be:
"records-lead"
"records-lead-min"
"TOPIC-PARTITION_ID.records-lead-avg"
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(tp0tp.partition()); double currentLead currentPartitionLead = kafkaConsumer.metrics().get(new MetricName("records-lead", "consumer-fetch-manager-metrics", "", tags)).value(); double currentPartitionMinLead = kafkaConsumer.metrics().get(new MetricName(tp + ".records-lead"records-lead-min", "consumer-fetch-manager-metrics", "", tags)).value(); double currentPartitionAvgLead = kafkaConsumer.metrics().get(new MetricName("records-lead-avg", "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
...