Metricbeat Kafka Module "error in connect: EOF"

Using the Metricbeat Kafka module, I get the following errors:

2019-08-01T20:31:02.479+0200    INFO    kafka/log.go:53 Connected to broker at localhost:9093 (unregistered)
2019-08-01T20:31:02.731+0200    INFO    kafka/log.go:53 Closed connection to broker localhost:9093
2019-08-01T20:31:02.731+0200    INFO    module/wrapper.go:244   Error fetching data for metricset kafka.consumergroup: error in connect: EOF
2019-08-01T20:31:10.539+0200    INFO    kafka/log.go:53 Connected to broker at localhost:9093 (unregistered)
2019-08-01T20:31:10.791+0200    INFO    kafka/log.go:53 Closed connection to broker localhost:9093
2019-08-01T20:31:10.791+0200    INFO    module/wrapper.go:244   Error fetching data for metricset kafka.partition: error in connect: EOF
2019-08-01T20:31:11.971+0200    INFO    kafka/log.go:53 Connected to broker at localhost:9093 (unregistered)

This keeps on repeating forever, even though Kafka is up and running . I don't see any metrics being forwarded to Elasticsearch, only documents containing the exact same error messages.

I use Metricbeat version 7.2 with the following configuration :

  - module: kafka
    metricsets: ["consumergroup", "partition"]
    period: 10s
    hosts: ["localhost:9093"]
    enabled: true

Please let me know if you have any idea what might be the reason or how to fix it.

1 Like

Is your Kafka port 9092 or 9093? Maybe try

- module: kafka
  metricsets: ["consumergroup", "partition"]
  period: 10s
  hosts: ["localhost:9092"]
  enabled: true

Hi @Kaiyan_Sheng I am having the same problem. I do not think it is because of the kafka port, because the error will be

error in connect: No advertised broker with address kafka:9093 found

This is also telling us that the connection is set up, right?
2019-08-01T20:31:02.479+0200 INFO kafka/log.go:53 Connected to broker at localhost:9093 (unregistered)

Please correct me if I am wrong. Currently I am out of idea, how to fix this.
Thank you already for your help