Fixed instrument function, which now takes an argument of the metrics registry