Add Middle ware for tracking metriks.