Tune the thresholds, provide a fallback, and choose the cooldown based on the dependency's recovery profile.
A circuit breaker that helps, not hurts
Threshold based on error rate, not absolute count
50% errors over 20 calls is a better signal than "5 errors in a row".
Cooldown long enough to matter
30-60 seconds. Too short and the breaker flips repeatedly; too long and it delays recovery.
Always have a fallback
A cached value, a default response, a queued retry. Failing fast is fine; failing without a message is not.
Log every state change
Closed→Open is an incident signal. HalfOpen→Closed is a recovery signal. Both belong in your dashboards.
Per-dependency breakers, not global
A breaker around the payment gateway and a breaker around the recommendation service are independent.