I recently realized that in some instances my service may be generating 502 gateway timeouts due to database contention, but I only get emailed about errors that happen inside my app, not outside (like in nginx).
I think I'd like to know when more than a few 502 errors are happening but not get spammed if a ton are happening. How do you personally handle these types of errors?