Added metrics middleware