KafkaConsumer.poll
To instrument Kafka consumer entry points using KafkaConsumer.poll()
, identify the method in which the consumer reads messages in a loop with a custom interceptor definition. We instrument the iterator's next method to start and end the Business Transaction for each message. There could be many iterators used for iterating messages but we only support iterators of the following types:
-
kafka.consumer.ConsumerIterator
-
org.apache.kafka.clients.consumer.ConsumerRecords$ConcatenatedIterable$1