Kafka clients JMX collector is Custom collector, for prometheus/client_java.
Kafka clients JMX collector
does proxy JMX metrics from kafka clients.
todo: 0.6.0-2.1.1 -> {prometheus.kafka-clients}
Import dependency.
<dependency>
<groupId>no.sysco.middleware.prometheus</groupId>
<artifactId>kafka-client-collector</artifactId>
<version>${version}</version>
</dependency>
Use KafkaClientsJmxExports
to initialize collectors for kafka-clients JMX metrics to conveniently register them.
KafkaClientsJmxExports.initialize(kafkaProducer);
Provide availability to expose:
- kafka clients jmx related metrics (KafkaClientsJmxExports.initialize(kafkaClient);)
- custom metrics (developer's responsibility)
- resource utilization metrics (DefaultExports.initialize();)
Metrics with Attributes. Reference
Name of metrics group
(prometheus context) or metric type
(jmx context)
app-info
@deprecated = common clients metricsproducer-metrics
= common clients metrics + only producer related metricsproducer-topic-metrics
= only producer related metricsproducer-node-metrics
= common clients metrics
app-info
@deprecated = common clients metricsconsumer-metrics
= common clients metricsconsumer-coordinator-metrics
- consumer group metricsconsumer-fetch-manager-metrics
= fetch-manager metrics + per topic + per partitionconsumer-node-metrics
= common clients metrics
Stream contains metrics from domains kafka.producer
, kafka.consumer
, kafka.admin.client
and own set of metrics
such as :
app-info
@deprecated = common clients metricsstream-metrics
= only stream related metrics [INFO lvl]stream-task-metrics
= stream task related metrics [DEBUG lvl]stream-processor-node-metrics
= stream processor related metrics [DEBUG lvl]stream-[store-scope]-metrics
= stream store related metrics [DEBUG lvl]stream-record-cache-metrics
= stream record cache related metrics [DEBUG lvl]stream-buffer-metrics
= stream buffer related metrics [DEBUG lvl]
- Issue 305: Add kafka client example config
- Issue 400: does the client automatically publish jmx mertices (heap size memory, thread number)?
- Blog post: JMX monitoring + Java custom metrics.
- Kafka metrics reporter
- IMO - Good example how to make custom collector
- Approaches (POCs) with
org.apache.kafka.common.metrics.MetricReporter
- Micrometer [PR WIP]