Dodge Ram ticking sound only in gear with gas. Quiet otherwise

My 2004 Ram 2500 recently starting making this ticking sound. It only happens when it is in gear and gas pedal is being pressed. Sound like it’s coming from the gas pedal area on the other side of the firewall.

While driving, if step on the gas hard, the ticking sound would also trigger a metal vibrating sound. It sounds like a very stiff piece of metal is vibrating, not a loose heat shield sound.

Does anyone have any idea? I can’t step on the gas in gear and look in the engine or under the truck at the same time. And I also don’t think it would be wise to do that even if someone was to help me. The thought of being under my truck while it is in gear and gas is being applied is not a safe or smart thought.

Best.

I’m thinking you may have an exhaust leak at the manifold or elsewhere that’s only leaking when under more pressure than at idle–such as when you step on the gas.