I added a new tool to my amateurish DevOps toolbox. Developed in the open by Tom Williams, the Docker Event Monitor is a “tiny container that monitors the local Docker event system in real-time and sends notifications to various integrations for event types that match the configuration. For example, you can trigger an alert when a container is stopped, killed, runs out of memory or health status change.”

At its core sits a simple python script that monitors the docker.sock file for noticeable changes. The code is straightforward and looks safe to me. It only took a few minutes to set DEM up so that our alerts channel on Slack gets notified of any health status changes. Some handy options are included; my favorite is silence to set a time window during which alerts are not fired. It avoids unnecessary spam when routine maintenance goes off on your stack.

I find DEM a useful little tool for lightweight, simple deployments where you’re not employing heavy weaponry, like k8s.