Use new metric infrastructure for metric publishing

The plan is to use the metric infrastructure added in #753 to replace the current way of metric publishing in Go.