only replace the first mention of 'metrics' in the pathname, fixes #15