Move metrics handling from backends to RPC server
Motivation: replaces code duplication in the backends with a single one, to be consistent with the objstorage (which has many more backends)
This also fixes the issue of metrics from 'extid_add' to be missing when using the postgresql storage.
Test Plan
Not tested
Migrated from D7276 (view on Phabricator)