Class KafkaClientMetrics

java.lang.Object
io.micrometer.core.instrument.binder.kafka.KafkaClientMetrics
All Implemented Interfaces:
MeterBinder, AutoCloseable

@Incubating(since="1.4.0") @NonNullApi @NonNullFields public class KafkaClientMetrics extends Object
Kafka Client metrics binder. This should be closed on application shutdown to clean up resources.

It is based on the Kafka client's metrics() method returning a Metric map.

Meter names have the following convention: kafka.(metric_group).(metric_name)

Since:
1.4.0
See Also:
  • Constructor Details

    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.producer.Producer<?,?> kafkaProducer, Iterable<Tag> tags)
      Kafka Producer metrics binder
      Parameters:
      kafkaProducer - producer instance to be instrumented
      tags - additional tags
    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.producer.Producer<?,?> kafkaProducer)
      Kafka Producer metrics binder
      Parameters:
      kafkaProducer - producer instance to be instrumented
    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.consumer.Consumer<?,?> kafkaConsumer, Iterable<Tag> tags)
      Kafka Consumer metrics binder
      Parameters:
      kafkaConsumer - consumer instance to be instrumented
      tags - additional tags
    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.consumer.Consumer<?,?> kafkaConsumer)
      Kafka Consumer metrics binder
      Parameters:
      kafkaConsumer - consumer instance to be instrumented
    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.admin.AdminClient adminClient, Iterable<Tag> tags)
      Kafka AdminClient metrics binder
      Parameters:
      adminClient - instance to be instrumented
      tags - additional tags
    • KafkaClientMetrics

      public KafkaClientMetrics(org.apache.kafka.clients.admin.AdminClient adminClient)
      Kafka AdminClient metrics binder
      Parameters:
      adminClient - instance to be instrumented
  • Method Details