On this page
Overview
sony/gobreaker implements the Circuit Breaker pattern in Go. It counts request successes and failures, opens the circuit when a threshold is crossed, rejects calls while open, then probes recovery in half-open state after a timeout. The v2 API supports generic result types.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Define when failures move the circuit from closed to open
Consecutive failures or a custom ReadyToTrip function can open the breaker, preventing the application from continuing to call a dependency that is already failing.
Sources: [2]
Tune rolling windows, half-open probes, and excluded errors
Interval and BucketPeriod configure counting windows, MaxRequests controls half-open probes, and Timeout controls the open period. IsExcluded can keep context cancellations and similar errors out of breaker metrics.
Sources: [2]
Best fit
Fits microservices that need to limit failure propagation from APIs, databases, or RPC dependencies
Combined with timeouts and retries, it helps Go services fail fast during downstream incidents rather than amplifying load through repeated attempts.
Sources: [2]
Before adoption
the v2.4.0 v2 module declares Go 1.22/toolchain 1.22.10 and panics are rethrown after accounting
The v2/go.mod at v2.4.0 declares Go 1.22.0 with toolchain go1.22.10. If the wrapped request panics, Execute accounts for it as a failure and then re-panics. The breaker also does not enforce request timeouts itself, so context deadlines and retry budgets remain application responsibilities.
Official sources
- [1]sony/gobreaker — GitHub repository(2026-10-06)
- [2]gobreaker v2.4.0 — README(2026-10-06)
- [3]gobreaker v2.4.0 — v2/go.mod(2026-10-06)
- [4]gobreaker v2.4.0 tag(2026-10-06)
- [5]gobreaker MIT license(2026-10-06)
Supplemental curator note
gobreaker is a small resilience primitive for preventing repeated failures against HTTP services, databases, or other dependencies from being amplified by retries. Tune failure classification, open duration, and half-open probe counts to the dependency's SLO and retry policy.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/sony/gobreaker.git - 2
Enter the repository
cd gobreaker - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
3,702 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 18
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- golang
- circuit-breaker
- microservice
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Docker Compose38,290 Stars
1 shared tag(s) · 2 shared category(s) · Same language
Define services, networks, volumes, and builds in compose.yaml and run them as one multi-container Docker application
Go - minikube32,180 Stars
1 shared tag(s) · 2 shared category(s) · Same language
create a workstation Kubernetes cluster for pre-deployment testing
Go - Helm30,309 Stars
1 shared tag(s) · 2 shared category(s) · Same language
package Kubernetes applications as Charts and manage install, upgrade, and rollback as releases
Go - NATS Go Client6,770 Stars
3 shared tag(s) · 2 shared category(s) · Same language
use Core NATS Pub/Sub and persistent JetStream messaging through one Go client
Go - Istio38,429 Stars
3 shared tag(s) · 1 shared category(s) · Same language
add mTLS, traffic policy, and telemetry transparently between services
Go - gRPC-Go23,092 Stars
3 shared tag(s) · Same language
implement typed Go service RPCs over HTTP/2 with the gRPC runtime
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.