Fix possible KeyError when collecting metrics  (#10471)
Fix possible KeyError when collecting metrics  (#10471)

* Fix possible KeyError

* Move float() logic to avoid error

* Fix small bug
DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core