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 Summary
ConstructorDescriptionKafkaClientMetrics
(org.apache.kafka.clients.admin.AdminClient adminClient) KafkaAdminClient
metrics binderKafkaClientMetrics
(org.apache.kafka.clients.admin.AdminClient adminClient, Iterable<Tag> tags) KafkaAdminClient
metrics binderKafkaClientMetrics
(org.apache.kafka.clients.consumer.Consumer<?, ?> kafkaConsumer) KafkaConsumer
metrics binderKafkaClientMetrics
(org.apache.kafka.clients.consumer.Consumer<?, ?> kafkaConsumer, Iterable<Tag> tags) KafkaConsumer
metrics binderKafkaClientMetrics
(org.apache.kafka.clients.producer.Producer<?, ?> kafkaProducer) KafkaProducer
metrics binderKafkaClientMetrics
(org.apache.kafka.clients.producer.Producer<?, ?> kafkaProducer, Iterable<Tag> tags) KafkaProducer
metrics binder -
Method Summary
-
Constructor Details
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.producer.Producer<?, ?> kafkaProducer, Iterable<Tag> tags) KafkaProducer
metrics binder- Parameters:
kafkaProducer
- producer instance to be instrumentedtags
- additional tags
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.producer.Producer<?, ?> kafkaProducer) KafkaProducer
metrics binder- Parameters:
kafkaProducer
- producer instance to be instrumented
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.consumer.Consumer<?, ?> kafkaConsumer, Iterable<Tag> tags) KafkaConsumer
metrics binder- Parameters:
kafkaConsumer
- consumer instance to be instrumentedtags
- additional tags
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.consumer.Consumer<?, ?> kafkaConsumer) KafkaConsumer
metrics binder- Parameters:
kafkaConsumer
- consumer instance to be instrumented
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.admin.AdminClient adminClient, Iterable<Tag> tags) KafkaAdminClient
metrics binder- Parameters:
adminClient
- instance to be instrumentedtags
- additional tags
-
KafkaClientMetrics
public KafkaClientMetrics(org.apache.kafka.clients.admin.AdminClient adminClient) KafkaAdminClient
metrics binder- Parameters:
adminClient
- instance to be instrumented
-
-
Method Details
-
bindTo
- Specified by:
bindTo
in interfaceMeterBinder
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-