This really doesn't make sense to me, but then again, it is Ubiquiti.
I was trying to use your unfi_exporter for pulling stats into Prometheus, but was getting a weird type conversion error. When I traced it down, I found that on my controller (v5.5.7), the API endpoint for device stats is returning the stats.bytes field as a float64 rather than an int64. I don't know how partial bytes work, but ok.
At the top level, I see "bytes": 4710984
, but then down within stats
, I see "bytes": 4710984.8
.
I also found it doing it with packets. It is kind of odd. I got around it by changing the raw object returned to use float64 for everything, then had it convert them to int64 when populating the public object.
I did see controller 5.5.9 is out, so may try it. I might also then fall back down to the stable 5.4.11 release. I was trying out the RCs, but don't know if they did some API breakage.