I have this as well. The gloom and doom kicks in about a day or two before the symptoms do. I take a strict regimen of fiber and probiotics to keep it at bay.
What fiber do you use, I should try adding it to my menu, probiotics help me a lot.
PHGG, GOS and lactulose (if you don't have SIBO) are relatively good prebiotics in my experience. However, the type of prebiotics you use should be tied to what's going on in your microbiome. Some common ones, such as Inulin, can feed both good and bad bacteria (and good bacteria become bad if they overgrow).
Psyllium husk (Metamucil is the most common brand name) is the most impactful for me.