Search code examples
pythonkubernetesapache-kafkaconfluent-kafka-python

How can I prevent the "Telemetry client instance id changed from AAAAAAAAAAAAAAAAAAAAAA to" log in a confluent-kafka-python consumer?


When the consumer (which is a very simple confluent-kafka-python consumer), we see this log message after the assignment

%6|1739802885.947|GETSUBSCRIPTIONS|<consumer id>#consumer-1| [thrd:main]: Telemetry client instance id changed from AAAAAAAAAAAAAAAAAAAAAA to <some random string>

  • I tried running the consumer locally (in contrast to the Kubernetes cluster) and see no such logs.

  • I tried googling for this log message but found no bugs or help avoiding this (though I am not the only person with such logs)


Solution

  • As per my previous comment,

    from confluent_kafka import Consumer
    
    conf = {
        'bootstrap.servers': 'your broker',
        'group.id': 'your group',
        'enable.metrics.push': False
    }
    
    consumer = Consumer(conf)