A circuit breaker is a state machine wrapped around a dependency call. This diagram shows the three states and the transitions between them: closed, where calls flow and failures are counted in a sliding window; open, where calls fail fast without reaching the dependency; and half-open, where a small probe decides whether to recover. The state machine exists because failing fast is a load-shedding decision: when a service is unhealthy, every caller retrying it just makes the problem worse.
The ordering of the transitions is the design. The failure window must accumulate before the trip, so transient blips don't break normal traffic. The cooldown must run before the probe, so recovery has time to happen. And the half-open probe is the only source of new information — the breaker stays open until the probe succeeds. Every trip and every recovery in a distributed system is this diagram running again.