Skip to content

oslabs-beta/ContainerWatch

Repository files navigation

ContainerWatch

Simplified Docker container monitoring! 🐳

ContainerWatch is an extension that adds feature-rich monitoring tools to Docker Desktop.

Table of Contents

  1. Features
  2. Installation
  3. Development
  4. Contributions
  5. Our Team

Features

📊 Metrics monitoring

ContainerWatch records the resource usage of all your Docker containers in a database with a data retention period of 15 days. You can visualize this data in a time-series graph, which provides visibility into the health of your containerized applications or microservices.

🔎 Log aggregation, filtering, and search

ContainerWatch aggregates logs from all your containers and displays them chronologically. You can filter logs by container, time range, a search string, and log type (stderr and stdout) to speed up your troubleshooting.

⚠️ Alerts

ContainerWatch lets you create alerts that trigger when your Docker container’s resource usage exceeds a threshold (e.g. CPU utilization >25%).

Installation

Add ContainerWatch to Docker Desktop by selecting Add Extensions in the menu bar. The Extensions Marketplace will open on the Browse tab. Search for ContainerWatch and select Install!

Or, you can install this extension through the command line. Clone this repository and run the following in the terminal:

cd ContainerWatch
make install-extension

When installed, the left-hand menu will display a new tab for ContainerWatch. You can also use docker extension ls to see that the extension has been installed successfully.

How it works

Docker TypeScript React MUI Vite NodeJS Express.js Prometheus Grafana

ContainerWatch is composed of a frontend application and a group of 3 containerized services running in the Docker Desktop VM:

  • A Node.js backend service which exposes metrics from the Docker Engine on a TCP port and provides an API for the frontend application
  • 📊 Prometheus scrapes the exposed metrics from the backend service and stores them in a space-efficient time-series database (TSDB)
  • 📈 Grafana queries the Prometheus TSDB and creates visualizations of the data, which are embedded in the frontend

(Note that the Grafana service is exposed on localhost:2999 - this port must be available for the extension to use)

Development

After changes are made, update the extension with this script:

make update-extension

Close and reopen the Docker Desktop dashboard and go to the extension. All the changes to the frontend code will be immediately visible.

To show the extension containers:

  1. In Docker Desktop, navigate to Settings.
  2. Under the Extensions tab, select the Show Docker Desktop Extensions system containers option.
  3. Select Apply and restart

To view logs from the extension's backend service

  1. Show the extension containers by following the steps above.
  2. Expand the containerwatch_containerwatch-desktop-extension group of containers and select the containerwatch conatiner.

To put the extension's frontend application in debug mode

make update-debug-extension

This will open a Chrome DevTools window for the frontend so you can view logs and errors

Contributions

We welcome contributions from the community. If you are interested in contributing to this project or have questions, contact the team or submit an issue.

Our Team


Patrick Vuong
GitHub
LinkedIn

Scott Hallock
GitHub
LinkedIn

Jun Lee
GitHub
LinkedIn

David Chuang
GitHub
LinkedIn