Add middleware to make sure the monitoring doesn't affect autofac services counts