kamailio_exporter
kamailio_exporter copied to clipboard
Issues with datatypes and missing errorhandling
Hi there, first let me say, awesome project!! :)
While playing with the Dockerimage i found that the metrics from core.shmmem are not exported correclty.. They were '0' all the time.
While diving into the code i found, that potential errors from the typecasting calls in the switch statement in https://github.com/florentchauveau/kamailio_exporter/blob/master/collector.go#L419 are not considered..
After adding logmessages for that i was able to workaround the issue with core.shmmem (moved position in switch statement to use ..Double() instead of Int()).
I can make a PR with my changes, but i am not sure if it contains the best solution..
I think it would be best, to have a generic wrapper inside of https://github.com/florentchauveau/go-kamailio-binrpc/blob/master/binrpc.go instead of calling the correct function.. but that overruns my knowledge ;)