KIP-1019 — Expose method to determine Metric Measurability
Accepted Kafka 3.8 Metrics
Adds a public `isMeasurable()` method to the `KafkaMetric` interface so callers can check measurability without relying on exception handling or Java reflection. Existing code either caught `ClassCastException` from `metric.measurableValue()` or used reflection to inspect the internal value provider, both of which are fragile and expensive.
Details
| Author | Apoorv Mittal |
| Status | Accepted |
| Kafka Version | 3.8 |
| JIRA | KAFKA-16280 |
| Wiki | View on Apache Wiki |
| Created | 2024-02-14 |
| Last Modified | 2024-04-19 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.