Take time off! I know its much easier said than done, but each time I've been in pretty much exactly that position and tried to push through, I have really paid the price (and wound up having to take time off ultimately anyway - probably a lot more than if I'd had a bit more insight at the time). At the end of the day, work isn't worth your health. One thing which I think its worth trying to bear in mind is that if the company is critically understaffed, that is the company's problem and fault (if its a long term issue) not yours. You shouldn't take that on. The logical follow up to that is that if you being off affects your colleagues' workload, that is the company's fault and issue, not yours. They need to sort their staffing out.
In terms of keeping it discreet, management should not be telling the rest of your team why you're off. That's a serious confidentiality breach if they do (I'm an employment lawyer). Equally, they shouldn't be telling any other employers why you're off. The vast majority of employers will give a factual reference only, which just has positions held and dates of employment. I think the biggest practical risk, depending on the industry you work in and how likely future boss is to know current boss, is that current boss is rubbish and says something to future boss over the phone or similar about your absences. But they shouldn't be doing that, and would be likely to get into trouble from their employer if they did (as it could give you cause for a claim against them if you found about it).
Future employers may also ask you to declare if you have had over 10 days' absence in the last year as part of a health questionnaire (only once you've been offered a job). If you say yes, you'll most likely get referred to occupational health who will have a call with you and primarily just be interested in whether you are fit for work now.
I know also that some GPs are sympathetic to how mental health issues are perceived in the workplace, and if you ask, will write something pretty vague on the fit note. But that's a bit pot luck as to what your GP's like.
Also, whilst its for you to judge, can't help noticing you say you've told yourself you'll take time off if the smallest signs show, but you're also already at the point where you're saying you don't feel you can take it. That sounds to be like someone really in need of time off, before things do really escalate in terms of your health. I'm no doctor or anything, but just worried for you from what you've written! One thing i've heard that helps me is that if you don't take time when you need it, sooner or later your body won't give you a choice anymore and will take that time.
So in short, it shouldn't affect your job prospects elsewhere, though if you work in a small/gossipy sector, you can never rule it out 100%. But try prioritise your health either way. Really hope it works out for you!