Production Troubleshooting Best Practices
Prevention habits that shrink incident duration for Go platforms: SLOs, dashboards, runbooks, and rehearsed response.
Search across all documentation pages
Prevention habits that shrink incident duration for Go platforms: SLOs, dashboards, runbooks, and rehearsed response.
Apply as design-review rubric and quarterly platform hygiene, not only after outages.
sql.DB.Stats() as Prometheus gauges. WaitCount alerts catch pool exhaustion before total stall.request_id and trace_id. Correlation cuts log search time during SEV-1./healthz. Deploy correlation without digging in CI./debug/pprof.MaxOpenConns from DB limit / replica count formula. Document arithmetic in the service README.GOMEMLIMIT to ~90% of container memory limit. Reduce OOMKilled before blind limit raises.GOMAXPROCS to match CPU quota (or use automaxprocs). Runnable queue latency shows mismatch in traces.QueryContext with deadlines on every DB call. Pool waits must not outlive client timeouts.context.Context to all background goroutines. Cuts leak class that survives restarts.Server.Shutdown timeout below K8s grace period. Avoid false 5xx during rollouts.Tiers A and B should be true before any production launch.
Tiers C through E mature over quarters; prioritize items that burned error budget in the last two incidents.
If all tiers pass review and game day succeeds, defer new tooling until the next measured gap.
RED metrics, bounded connection pool, context on DB calls, non-public pprof, health metadata, and rollback path.
Best practices prevent classes of failure.
Runbooks execute steps during active incidents.
Both are required.
Run a tabletop at minimum once a year.
Thirty minutes of walkthrough beats first real OOM alone.
SLO burn triggers incident severity and deploy freeze policy.
Alerts should map to SLO windows, not only static thresholds.
RED per service, goroutines, heap, GC pause, pool wait, CPU/memory vs limits, deploy markers.
Yes.
Workers need pool limits, ctx cancel, metrics, and profile access too.
After every SEV-1 and when Go minor version upgrades change GC behavior.
CI can ban sql.Query without context in new code, require ReadHeaderTimeout, and block public pprof routes in config review.
Handoff and dashboards note per-region SLO burn.
Profiles may be region-specific during partial outages.
When SLOs are green, game days pass, and last two incidents had alerts fire before customer-wide impact.
Optimize features until the next measured regression.
Stack versions: This page was written for Go 1.26.x (Green Tea GC default, go fix modernizers - verify patch at build), chi (latest - verify at build), gin (latest - verify at build), echo (latest - verify at build), google.golang.org/grpc (latest - verify at build), sigs.k8s.io/controller-runtime (latest - verify at build), kubebuilder (latest - verify at build), tinygo (latest - verify board targets at build), wazero (latest - verify at build), and golangci-lint (latest - verify linter set at build).
Reviewed by Chris St. John·Last updated Jul 18, 2026