mehdy / keepalived-exporter

Prometheus Keepalived exporter
GNU General Public License v3.0
121 stars 40 forks source link

exporter exited after curl #35

Closed hedeesaa closed 4 years ago

hedeesaa commented 4 years ago

base on the README I started the keepalived-exporter with this command: sudo keepalived-exporter and it began to listen on port 9165. then I curled curl localhost:9165/metrics but the keepalived-exporter exited with these errors:

INFO[0000] Listening on address: :9165                  
panic: runtime error: index out of range [2] with length 1

goroutine 22 [running]:
github.com/cafebazaar/keepalived-exporter/internal/collector.(*KeepalivedCollector).Collect(0xc000066910, 0xc00005d5c0)
    /home/seena/storage/keepalived-exporter/internal/collector/collector.go:151 +0x29ef
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
    /home/seena/go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:444 +0x19d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
    /home/seena/go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:536 +0xe36
mehdy commented 4 years ago

@clwluvw Could you investigate why this is happening? I think we should avoid panicking as long as possible.

clwluvw commented 4 years ago

@hedeesaa Thanks for reporting this issue. This has been causes in last refactoring c1adcb9d7967bd63bfba88f7e8e968173d5f1775