Skip to content

Commit

Permalink
Merge pull request #69 from skiloop/fix_kafka_labels_parsing
Browse files Browse the repository at this point in the history
fix: fix kafka.labels parsing(#67)
  • Loading branch information
danielqsj authored Nov 6, 2018
2 parents 74450bf + 1b7fe56 commit 127f0e3
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 127f0e3

Please sign in to comment.