Add mutex for write access to global metric map.