From cb74c225b17b8a0e778b020b764ea6b10387d730 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 5 Oct 2020 10:51:51 +0200 Subject: [PATCH] Include original error when metricbeat fails to connect with Kafka (#21484) --- metricbeat/module/kafka/broker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metricbeat/module/kafka/broker.go b/metricbeat/module/kafka/broker.go index b9e78c7dacc2..2e558d7944a6 100644 --- a/metricbeat/module/kafka/broker.go +++ b/metricbeat/module/kafka/broker.go @@ -119,7 +119,7 @@ func (b *Broker) Connect() error { c, err := getClusterWideClient(b.Addr(), b.cfg) if err != nil { closeBroker(b.broker) - return fmt.Errorf("Could not get cluster client for advertised broker with address %v", b.Addr()) + return fmt.Errorf("getting cluster client for advertised broker with address %v: %w", b.Addr(), err) } b.client = c