- Why there are two different properties for the purpose of metric reporting? What makes them different?
- If they are different then when to use which one?
1 Answer
Kafka uses 2 libraries for its metrics:
"Yammer" metrics: These are used mostly on the broker side
Kafka metrics: Kafka created its own metrics library and these are used in the clients.
As you may know, there's a bunch of common code (network, requests) that is used by both the broker and client side. As this code lives in the client side project this results in the broker having both types of metrics hence the 2 reporter types!
kafka.metrics.reporteris for the "Yammer metrics"metric.reportersis for the "Kafka metrics"
Which one to use depends on what you want to see. You can have a custom reporter implement both interfaces if you want all the metrics. Also as all the metrics can also be made available via JMX, you may want to scrape that instead of relying on metrics reporters. Both solutions work in practice.
2