I think it is a good idea to incorporate some shorter races into your marathon training. You get the race practice and some faster turnover for longer than you might get on your own during a workout plus you can add mileage to make the race work for your marathon training.
Working backwards from your marathon date, I like the 10K three weeks out as a tune-up race to test your fitness and get you mentally ready. It is long enough to test your endurance without being so long that it will fatigue you. The downside is that if you have a bad day or something, it can mess with your head for the marathon.
Two months out, working a half marathon into a long run can be a good workout with some race practice. You would want to run it faster than your marathon goal pace but not as fast as your half marathon race pace. The hard part is how to add the mileage to the race. If you run extra beforehand, you want to be pretty sure the race will start on time that you won't have to wait around a long time in between the early miles and the race. Also, if you run extra beforehand, you want a small enough race that you can get into the corral at a decent spot right before the start. If you run extra afterwards, you have to be ready to overcome the reluctance to keep going after you have crossed the finish line after a long distance when everyone else is celebrating and you would rather stop. This would be a good workout to do right before a down week so that you get a good recovery from it, just to be conservative.
Two months or more out, I like working a 5K into the middle of a 13 to 15 mile run. Do the first part as an easyish warm up but run the race hard and then do the rest at whatever pace is comfortable. You can still get a good 5K run out of that and you also get some good miles on tired legs afterwards, which is good training. This is a good workout to work in anywhere in your marathon training weeks. The before/after challenges from the half still apply, but it is easier to find a smaller 5K than half and the risk of a late start is generally less for a 5K than a half just because there is a shorter course for the organizers to have to manage.
If you are in a warm climate, any races you work in before your October marathon will be pretty warm and maybe not a great predictor of your race time, so make some adjustments to your expectations for those races versus your marathon.
Good luck!