Fix bug where metric_name would be prefixed and suffixed multiple times when using multiple outputs

Change-Id: I8ba2141753724244854080b2bebcfa8105439480