...
JIRA: KAFKA-5890 - records.lag should use tags for topic and partition rather than using metric name.
Released: 1.1.0
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
Sensors will still be removed/added on assignment change to avoid reporting metrics for partitions we are not handling anymore.
This will enable people to do:
Code Block | ||||
---|---|---|---|---|
| ||||
Map<String, String> tags = new HashMap<>();
tags.put("client-id", "<client-id>")
tags.put("topic", "<topic>")
tags.put("partition", "<partition>")
consumer.metrics().get(Metrics.metricName("records-lag", "consumer-fetch-manager-metrics", tags)); |
rather than:
Code Block | ||||
---|---|---|---|---|
| ||||
Map<String, String> tags = Collections.singletonMap("client-id", "<client-id>"); consumer.metrics().get(Metrics.metricName(String.format("%s.records-lag", new TopicPartition("<topic>", <partition>)), "consumer-fetch-manager-metrics", tags)); |
The new options is more standard with the rest of the existing metrics.
Compatibility, Deprecation, and Migration Plan
...
- We will add these new metrics and deprecate the previous ones. The old metrics will be removed once we move to 2.0 (Tracked by KAFKA-6445)
Rejected Alternatives
N/A