Add metrics sample codes