Op, from my view, there can be some good that can come from telling your partner, if you want to work on your marriage. Only you can decide that.
About a year ago, DH and I were in a pretty bad place, and I was seriously thinking about leaving. He knew this and we were both trying to work on things, largely with no change.
Unsurprisingly, at the same time, I started developing feelings for someone else. Again unsurprisingly, this person offered the counter to all the things I was struggling over with DH. I really thought about leaving DH when I had these feelings, not "for the other man" (I can't say why as it would put me but I knew they were 100% not returned), but because the comparison between how I felt with OM was so strong against how I then felt towards DH.
I went a way for a few days to think. I thought about all the goodness in my marriage and in DH, and so I came home and I told him I was committed to making us work, and that I had feelings for someone else. I was clear (and honest) that nothing had ever happened with the OM, even of the emotional affair ilk. Just that I had feelings, and those feelings had scared me into turning my focus back to DH and to working on us with both hands in the pot, so to speak.
We're much better now! Very strong and in fact 23 weeks pregnant!
Perhaps this is your scare? Could telling your DH about it perhaps lead to looking at things more deeply, with the aim to repair?
What do you want with DH going forward- that is the real question.