Skip to content

Commit

Permalink
fix: fix kafka.labels parsing(danielqsj#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
skiloop committed Oct 22, 2018
1 parent 74450bf commit 1b7fe56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ func main() {
labels := make(map[string]string)
for _, label := range strings.Split(opts.labels, ",") {
splitted := strings.Split(label, "=")
labels[splitted[0]] = splitted[1]
if len(splitted) >= 2 {
labels[splitted[0]] = splitted[1]
}
}

clusterBrokers = prometheus.NewDesc(
Expand Down

0 comments on commit 1b7fe56

Please sign in to comment.