Should I disclose to my employer that I have Bipolar?

I’ve been battling with myself if it’s the right thing to do. I’m a Software Engineer and as of late things haven’t been as rosy for me as I would like. My mentals aren’t the best and I’ve been feeling extremely drained and exhausted. I do not want sympathy from my boss, neither do I want to feel discriminated or worse if I drop the ball then it’s used against me and I some how lose my job(Heavens forbid). I do however feel that I at least owe him that much to be upfront with him about my condition.