Skip to content

Commit

Permalink
Fix issue with broker collection results being combined
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed May 29, 2020
1 parent 4a13eec commit 7e07b6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.13.4 (2019-05-29)
### Fixed
- Bug in which bootstrap broker collection would combine multi-broker collection results

## 2.13.3 (2019-05-29)
### Fixed
- Broker ID mismatch
Expand Down
10 changes: 8 additions & 2 deletions src/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"hash/fnv"
"os"
"strings"
"sync"

"github.com/Shopify/sarama"
Expand All @@ -22,7 +23,7 @@ import (

const (
integrationName = "com.newrelic.kafka"
integrationVersion = "2.13.3"
integrationVersion = "2.13.4"
)

func main() {
Expand Down Expand Up @@ -94,9 +95,14 @@ func getBrokerList(arguments *args.ParsedArguments) ([]*connection.Broker, error
return nil, errors.New("broker is not connected")
}

hostPort := strings.Split(broker.Addr(), ":")
if len(hostPort) != 2 {
return nil, fmt.Errorf("failed to get host from broker address: %s", broker.Addr())
}

newBroker := &connection.Broker{
SaramaBroker: broker,
Host: arguments.BootstrapBroker.Host,
Host: hostPort[0],
JMXPort: arguments.BootstrapBroker.JMXPort,
JMXUser: arguments.BootstrapBroker.JMXUser,
JMXPassword: arguments.BootstrapBroker.JMXPassword,
Expand Down

0 comments on commit 7e07b6e

Please sign in to comment.