Skip to content

How to configure one well

Tune the thresholds, provide a fallback, and choose the cooldown based on the dependency's recovery profile.

A circuit breaker that helps, not hurts

  1. Threshold based on error rate, not absolute count

    50% errors over 20 calls is a better signal than "5 errors in a row".

  2. Cooldown long enough to matter

    30-60 seconds. Too short and the breaker flips repeatedly; too long and it delays recovery.

  3. Always have a fallback

    A cached value, a default response, a queued retry. Failing fast is fine; failing without a message is not.

  4. Log every state change

    Closed→Open is an incident signal. HalfOpen→Closed is a recovery signal. Both belong in your dashboards.

  5. Per-dependency breakers, not global

    A breaker around the payment gateway and a breaker around the recommendation service are independent.