Allow metrics to be a float as well as an int

Without this, the collector fails if the metric is a float when it tries to
cast the value to an `int`.

We try first to cast to an `int`, and if that fails a `float` and if that
fails, bail out.