kpetremann / salt-exporter

Salt Prometheus exporter working out of the box without any configuration on Salt side. Comes with an event watcher TUI.
https://kpetremann.github.io/salt-exporter/
MIT License
30 stars 8 forks source link

type assertion failure right after startup #68

Closed grimmy closed 3 months ago

grimmy commented 3 months ago

Trying to run this against salt 2017.7.7 but I'm getting a type assertion failure right after startup. Not sure if this is due to old salt or what, hoping you can provide some insight? I can provide a fix assuming you're open to it but if this is a version thing then I'm sure there's probably more things like this to find too.

panic: interface conversion: interface {} is string, not []uint8

goroutine 9 [running]:
github.com/kpetremann/salt-exporter/pkg/parser.Event.Parse({_}, _)
    /home/runner/work/salt-exporter/salt-exporter/pkg/parser/parser.go:98 +0xa6c
github.com/kpetremann/salt-exporter/pkg/listener.(*EventListener).ListenEvents(0xc0000760f0)
    /home/runner/work/salt-exporter/salt-exporter/pkg/listener/listener.go:127 +0x16f
created by main.start in goroutine 1
    /home/runner/work/salt-exporter/salt-exporter/cmd/salt-exporter/main.go:72 +0x467
kpetremann commented 3 months ago

hello @grimmy,

Indeed this version of Salt is quite old, and not supported/tested.

I did a quick test using the docker-compose from e2e_test directory (using 2017.7.8). I can't reproduce it. It does not trigger the panic and I see metrics.

Could you please provide more info regarding:

kpetremann commented 3 months ago

PR merged, fix available in v0.11.1. Thanks again for reporting the issue and bringing the fix :)