Escape the metric update query and use the correct library id.