Move metrics init into a method rather than a task