Added profiling middleware to try to improve alert processing