Alert when a container hits OOM.
IntermediateScenarioLimits, logging, health checks and restarts
Answer
Situation read → Need signal before customers complain.
What I'd do → Subscribe: docker events --filter event=oom, scrape cAdvisor metric container_oom_events_total, and alert from Prometheus. Also watch container_memory_working_set_bytes / limit > 0.9.
Why → OOM kill leaves exit code 137 and OOMKilled=true only until the container is removed.
Interview tip → Alert on approach, not only on death.
More on Limits, logging, health checks and restarts
A Java container is OOM-killed at 512 MB. Why isn't the heap the whole story?IntermediateHow do you cap CPU and memory for a container and what happens on exceed?BeginnerLatency spikes though CPU usage looks low (50%).Advanced`docker logs` is empty but the app is running.BeginnerConfigure log rotation globally.BeginnerShip container logs to a central system.Intermediate