Specialize encodeMetric