“Discretion is the better part of valor,” is one of those aphorisms that means ... something.
It could mean that, if your valor is going to be worth anything, you need to keep your plans secret up front.
It could mean that, after your valor is successful, it should speak for itself, allowing you to stand back from self-promotion.
Or it could mean other things.
In my mind it means;
“What do you own”
“What do you know to be true”
Discretion and forgiveness run a fine line between walking away or beating the crap out of someone.