Finding a goroutine leak with pprof
The service was restarted often enough by deploys that nobody noticed the trend. Then we had a quiet fortnight with no releases, and the graph turned into a ramp.
The goroutine profile made it embarrassingly clear. Thousands of goroutines parked on a channel receive, all from the same line: a helper that started a background worker per request and relied on the caller to cancel a context that, in one branch, was never cancelled.
What made it hard to see in review is that the leaking branch was the error path. It ran rarely, it ran correctly from the user's point of view, and it quietly left something behind every single time.