Book Image

Monitoring Docker

By : Russ McKendrick
Book Image

Monitoring Docker

By: Russ McKendrick

Overview of this book

This book will show you how monitoring containers and keeping a keen eye on the working of applications helps improve the overall performance of the applications that run on Docker. With the increased adoption of Docker containers, the need to monitor which containers are running, what resources they are consuming, and how these factors affect the overall performance of the system has become the need of the moment. This book covers monitoring containers using Docker's native monitoring functions, various plugins, as well as third-party tools that help in monitoring. Well start with how to obtain detailed stats for active containers, resources consumed, and container behavior. We also show you how to use these stats to improve the overall performance of the system. Next, you will learn how to use SysDig to both view your containers performance metrics in real time and record sessions to query later. By the end of this book, you will have a complete knowledge of how to implement monitoring for your containerized applications and make the most of the metrics you are collecting
Table of Contents (15 chapters)
Monitoring Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Compiling cAdvisor from source


As mentioned in the previous section, cAdvisor really ought to be executed on the host machine; this means, you may have to use a case to compile your own cAdvisor binary and run it directly on the host.

To compile cAdvisor, you will need to perform the following steps:

  1. Install Go and Mercurial on the host machine—version 1.3 or higher of Go is needed to compile cAdvisor.

  2. Set the path for Go to work from.

  3. Grab the source code for cAdvisor and godep.

  4. Set the path for your Go binaries.

  5. Build the cAdvisor binary using godep to source the dependencies for us.

  6. Copy the binary to /usr/local/bin/.

  7. Download either an Upstart or Systemd script and launch the process.

If you followed the instructions in the previous section, you will already have a cAdvisor process running. Before compiling from source, you should start with a clean host; let's log out of the host and launch a fresh copy:

[vagrant@centos7 ~]$ exit
logout
Connection to 127.0.0.1 closed.
[russ@mac ~]$ vagrant destroy...