Added service to metric SQL insertions and fixed update_metrics