nlamirault / pihole_exporter

Prometheus exporter for PiHole metrics
Apache License 2.0
76 stars 20 forks source link

Pihole error: json: cannot unmarshal number into Go value of type string #3

Closed krohrsb closed 6 years ago

krohrsb commented 7 years ago

pihole-exporter | time="2017-08-15T17:13:04Z" level=error msg="Pihole error: json: cannot unmarshal number into Go value of type string" source="pihole_exporter.go:143"

Essentially the JSON is returning pihole counts as Numbers, yet the go struct used for the json defines them as Strings.

One would have to either have the pihole API return them as strings, or alter pihole_exporter to support json.Number I believe.

brentahughes commented 6 years ago

This should be addressed in the lastest merge.