port the carbon metric feature to latest api