Skip to content

Commit

Permalink
Change port to 9308 and accept multiple addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
danielqsj committed Oct 20, 2017
1 parent 7576d6a commit 67070af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ type Exporter struct {
}

type kafkaOpts struct {
uri string
uri []string
}

// NewExporter returns an initialized Exporter.
func NewExporter(opts kafkaOpts) (*Exporter, error) {
config := sarama.NewConfig()
client, err := sarama.NewClient([]string{opts.uri}, config)
client, err := sarama.NewClient(opts.uri, config)

if err != nil {
fmt.Println("Error Init Kafka Client")
Expand Down Expand Up @@ -299,12 +299,12 @@ func init() {

func main() {
var (
listenAddress = kingpin.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9206").String()
listenAddress = kingpin.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9308").String()
metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()

opts = kafkaOpts{}
)
kingpin.Flag("kafka.server", "Address (host:port) of Kafka server.").Default("kafka:9092").StringVar(&opts.uri)
kingpin.Flag("kafka.server", "Address (host:port) of Kafka server.").Default("kafka:9092").StringsVar(&opts.uri)

log.AddFlags(kingpin.CommandLine)
kingpin.Version(version.Print("kafka_exporter"))
Expand Down

0 comments on commit 67070af

Please sign in to comment.