Search code examples
javaapache-kafkalog4japache-kafka-streams

Where are Kafka heartbeat related logs in Confluent Platform?


I could find the below error in the location /var/log/kafka.log

[2021-07-28 05:15:16,801] INFO [GroupCoordinator 2]: Preparing to rebalance group kafka-stream-confluent-grp1-20-entities-distributed in state PreparingRebalance with old generation 18 (__consumer_offsets-48) (reason: removing member kafka-stream-confluent-grp1-20-entities-distributed-68dabbd3-28b6-433b-bd5b-9b1438946024-StreamThread-4-consumer-1600bf78-e4ca-4ddf-86e9-cd2d4a06dd57 on heartbeat expiration) (kafka.coordinator.group.GroupCoordinator)

Where do we find consumer level heartbeat logs? Or do we need to enable them? I assume so that I can make sure heartbeats are received for these consumer threads for this much duration.


Solution

  • Here is some good reference to read about heartbeat...

    https://chrzaszcz.dev/2019/06/kafka-heartbeat-thread/

    If an heartbeat error will happen you'll see ERROR in the log,

    for heartbeat sent to be shown you need to enable DEBUG logging ,

     log.debug("Sending Heartbeat request with generation {} and member id {} to coordinator {}",
    

    For heartbeat received information you would need to enable TRACE logging

      log.trace("{}: got heartbeat status {}", node.name(), agentStatus);